Skip to Content
CLI

CLI

Wire Solidus — self-sovereign identity, verifiable credentials, did:solidus — into your app in one command.

npx @solidus-network/cli init

Every 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 init

Or install globally:

npm install -g @solidus-network/cli solidus init

Commands

CommandDoesNeeds a key?
solidus init [--yes] [--with-mcp]Detect your framework (Next.js today) and wire in .env.local placeholders + a lib/solidus.ts SDK stubNo — write-only to local files, never a secret
solidus did resolve <did>Resolve a did:solidus DID documentNo
solidus did create --public-key <hex> [--signer-key <hex>]Register a DID the signer key ownsYes — SOLIDUS_SIGNER_KEY env var or --signer-key
solidus credential verify <vcId>Verify a Solidus verifiable credentialNo
solidus mcp installAdd @solidus-network/mcp (run-time agent tools) to this project’s .mcp.json, merging with any existing serversNo

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.localSOLIDUS_RPC_URL, plus a commented placeholder for SOLIDUS_SIGNER_KEY
  • lib/solidus.ts — a createSdk() 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

  • --json on: stdout is exactly one line of JSON.stringify(result) — no color, no spinner, no extra logging.
  • --json off: stdout is human-readable (key: value per line).
  • Exit 0: the command completed and printed a result — even a “not found” answer (did resolve on an unregistered DID returns {"resolved":false} with exit 0; 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

VariableDefaultUsed by
SOLIDUS_RPC_URLhttps://rpc.solidus.networkevery command
SOLIDUS_SDK_MODEtestnetevery command
SOLIDUS_SIGNER_KEYnonedid 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

Last updated on