@canra/cli
Command-line client for Canra, a registry of machine-readable specifications (library APIs, protocols, data formats). Fetch a spec, generate an implementation in any language, and check it against the spec's test vectors.
Runs on Node 20+ or Bun. No install needed:
npx @canra/cli search json
npx @canra/cli info canra/json
npx @canra/cli fetch canra/json
Commands
Or install it to get the canra command:
npm install -g @canra/cli
canra search json
| Command | What it does |
|---|---|
canra search <query> | Search the registry |
canra info <owner>/<name> | Show a spec's metadata |
canra fetch <owner>/<name>[@version] | Download a spec (latest or a pinned version), verify its SHA-256, and save it to .canra/specs/<owner>/<name>/ |
canra outdated [--json] | Check fetched specs for newer versions; exits 1 if any is outdated or quarantined |
canra update [<owner>/<name>] | Re-fetch the latest version of every outdated spec (or the named one); exits 1 if any spec is quarantined or fails to update |
canra remove <owner>/<name> | Delete a fetched spec from .canra/specs/ |
canra login | Save a registry URL and API token |
canra whoami | Show which account your saved token belongs to |
canra publish <file.spec.md> [--accepts <suggestion-id>] | Publish a spec (needs a token); --accepts marks that suggestion on the spec accepted |
canra suggest <owner>/<name> --title "..." [--body "..."] [--file <path.spec.md>] | Suggest a change to a spec you don't own (needs a token); --file attaches a full edited spec, which the owner reviews as a diff |
canra logout | Remove saved credentials |
canra version / canra help | Version and usage |
<owner> is a user or organization name in any case: Canra/json and canra/json are the same spec, saved under the lowercase owner in .canra/specs/.
Vendoring specs
Commit .canra/ to source control. The saved specs are the record of which spec versions your project implemented (a version is exact and immutable). After canra update, git diff .canra/ shows what changed in each spec.
Publishing
Create an API token at canra.dev → Account → API tokens, choosing its permissions and expiry (canra publish needs Publish specs), then:
npx @canra/cli login # paste the token when asked
npx @canra/cli publish my-spec.spec.md
Credentials are stored in ~/.canra/config.json.
For agents
You may not need the CLI at all:
- Raw spec markdown:
https://canra.dev/specs/{owner}/{name}.md - Site index for LLMs:
https://canra.dev/llms.txt - Remote MCP server (no auth):
https://canra.dev/mcp, e.g.claude mcp add --transport http canra https://canra.dev/mcp
API docs: https://canra.dev/docs/api
License
MIT