CLI
Wire Solidus — self-sovereign identity, verifiable credentials, did:solidus — into your app in one command.
npx @solidus-network/cli initEvery command works two ways: interactively for a human, and agent-unattended for an AI coding agent — --json output, clean exit codes, no prompts required. Point your coding agent at this page and it can run the CLI directly.
Install
No install needed — run it with npx:
npx @solidus-network/cli initOr install globally:
npm install -g @solidus-network/cli
solidus initCommands
| Command | Does | Needs a key? |
|---|---|---|
solidus init [--yes] [--with-mcp] | Detect your framework (Next.js today) and wire in .env.local placeholders + a lib/solidus.ts SDK stub | No — write-only to local files, never a secret |
solidus did resolve <did> | Resolve a did:solidus DID document | No |
solidus did create --public-key <hex> [--signer-key <hex>] | Register a DID the signer key owns | Yes — SOLIDUS_SIGNER_KEY env var or --signer-key |
solidus credential verify <vcId> | Verify a Solidus verifiable credential | No |
solidus mcp install | Add @solidus-network/mcp (run-time agent tools) to this project’s .mcp.json, merging with any existing servers | No |
Every command also accepts the global --json flag for machine-readable output.
init — wire an app in one command
solidus init detects your framework, then writes (never clobbers) the files a Next.js app needs to start using Solidus:
.env.local—SOLIDUS_RPC_URL, plus a commented placeholder forSOLIDUS_SIGNER_KEYlib/solidus.ts— acreateSdk()instance ready to import
cd my-nextjs-app
npx @solidus-network/cli init --yes --json{"framework":"nextjs","wrote":["/path/to/my-nextjs-app/.env.local","/path/to/my-nextjs-app/lib/solidus.ts"]}init is idempotent and non-destructive: re-running it never clobbers existing content and writes nothing new once your app is already wired.
--with-mcp — chain in the MCP server
--with-mcp also runs mcp install, wiring @solidus-network/mcp — the run-time half of agent-native distribution — into .mcp.json. It is opt-in and off by default, even under --yes: init scaffolds your app, while .mcp.json configures your app’s own agent tooling — a separate consent boundary a scaffold command shouldn’t silently cross.
npx @solidus-network/cli init --yes --with-mcp --json{"framework":"nextjs","wrote":[],"mcp":{"wrote":"/path/to/my-nextjs-app/.mcp.json","alreadyPresent":false}}Run solidus mcp install on its own at any time to add or update the .mcp.json entry without touching anything else — it merges alongside any other MCP servers already configured, and is a no-op if the solidus entry already exists.
--json contract
--jsonon: stdout is exactly one line ofJSON.stringify(result)— no color, no spinner, no extra logging.--jsonoff: stdout is human-readable (key: valueper line).- Exit
0: the command completed and printed a result — even a “not found” answer (did resolveon an unregistered DID returns{"resolved":false}with exit0; that is a valid answer, not an error). - Exit
1: the command threw — network failure, invalid input, missing signer key. The error message goes to stderr, formatted the same way (--json→{"error": "..."}, human → plain text).
Environment variables
| Variable | Default | Used by |
|---|---|---|
SOLIDUS_RPC_URL | https://rpc.solidus.network | every command |
SOLIDUS_SDK_MODE | testnet | every command |
SOLIDUS_SIGNER_KEY | none | did create only |
solidus login (interactive credential storage) is not shipped yet — set SOLIDUS_SIGNER_KEY yourself for now.
Quickstart: wire a Next.js app, then resolve and verify
cd my-nextjs-app
npx @solidus-network/cli init --yes --json
# {"framework":"nextjs","wrote":["/path/to/my-nextjs-app/.env.local","/path/to/my-nextjs-app/lib/solidus.ts"]}
npx @solidus-network/cli did resolve did:solidus:testnet:doesnotexist --json
# {"did":"did:solidus:testnet:doesnotexist","document":null,"resolved":false}
npx @solidus-network/cli credential verify vc-123 --json
# {"vcId":"vc-123","result":{"valid":false,"error":"Credential not found","checks":{...}}}Next steps
- Getting Started — the full 5-minute SDK walkthrough
- Next.js Integration — the hand-written version of what
initscaffolds for you - SDK Reference — every package
lib/solidus.tsbuilds on