CLI Reference
The BaseID CLI provides command-line access to key generation, DID operations, credential signing and verification, and demo servers.
Installation
Section titled “Installation”cargo install baseid-cliKey Generation
Section titled “Key Generation”# Generate an Ed25519 key pair (default)baseid key generate --type ed25519
# Generate a P-256 key pair with JSON outputbaseid key generate --type p256 --output json
# Save to filebaseid key generate --type ed25519 --output json > key.jsonDID Operations
Section titled “DID Operations”# Create a did:key from an Ed25519 keybaseid did create --method key --type ed25519
# Resolve any DID to its documentbaseid did resolve did:key:z6Mk...
# Create a did:web configurationbaseid did create --method web --domain example.comCredential Operations
Section titled “Credential Operations”# Sign a Verifiable Credentialbaseid credential sign --key key.json --input vc.json
# Verify a JWT credentialbaseid credential verify --jwt eyJ...
# Verify from a filebaseid credential verify --input signed-vc.jwtSD-JWT Operations
Section titled “SD-JWT Operations”# Create an SD-JWT with selective disclosurebaseid sd-jwt issue --key key.json --input claims.json --sd family_name --sd given_name
# Present with selected disclosuresbaseid sd-jwt present --input sd-jwt.txt --disclose family_name
# Verify an SD-JWT presentationbaseid sd-jwt verify --input presentation.txtDemo Servers
Section titled “Demo Servers”# Start a demo issuer serverbaseid demo issuer --port 3000
# Accept a credential offer from the demo issuerbaseid demo accept-offer '{"credential_issuer":"http://localhost:3000",...}'
# Start a demo verifier serverbaseid demo verifier --port 3001Global Options
Section titled “Global Options”| Flag | Description |
|---|---|
--output json | Output in JSON format |
--output text | Output in human-readable text (default) |
--verbose | Enable verbose logging |
--help | Show help for any command |