Skip to content

CLI Reference

The BaseID CLI provides command-line access to key generation, DID operations, credential signing and verification, and demo servers.

Terminal window
cargo install baseid-cli
Terminal window
# Generate an Ed25519 key pair (default)
baseid key generate --type ed25519
# Generate a P-256 key pair with JSON output
baseid key generate --type p256 --output json
# Save to file
baseid key generate --type ed25519 --output json > key.json
Terminal window
# Create a did:key from an Ed25519 key
baseid did create --method key --type ed25519
# Resolve any DID to its document
baseid did resolve did:key:z6Mk...
# Create a did:web configuration
baseid did create --method web --domain example.com
Terminal window
# Sign a Verifiable Credential
baseid credential sign --key key.json --input vc.json
# Verify a JWT credential
baseid credential verify --jwt eyJ...
# Verify from a file
baseid credential verify --input signed-vc.jwt
Terminal window
# Create an SD-JWT with selective disclosure
baseid sd-jwt issue --key key.json --input claims.json --sd family_name --sd given_name
# Present with selected disclosures
baseid sd-jwt present --input sd-jwt.txt --disclose family_name
# Verify an SD-JWT presentation
baseid sd-jwt verify --input presentation.txt
Terminal window
# Start a demo issuer server
baseid demo issuer --port 3000
# Accept a credential offer from the demo issuer
baseid demo accept-offer '{"credential_issuer":"http://localhost:3000",...}'
# Start a demo verifier server
baseid demo verifier --port 3001
FlagDescription
--output jsonOutput in JSON format
--output textOutput in human-readable text (default)
--verboseEnable verbose logging
--helpShow help for any command