Skip to content

Command-line tool

Every command is run as commons <command>. Run commons <command> --help for the same details at the terminal. Commands that talk to a commons service read its address from the COMMONS_URL environment variable; set it to the service’s address, such as https://trial.opencodecommons.org. A command that fails exits with a non-zero status.

This page is generated from the tool’s own command definitions, so it lists exactly the commands that the tool has.

  • -V, --version: output the version number

Manage account keys (the human step)

Terminal window
commons account [options] [command]

For an account the operator adds: generate an account key pair, write it to <COMMONS_HOME>/accounts/<account>.json and print the stanza for the operator’s bootstrap file (COMMONS_BOOTSTRAP_ACCOUNTS_FILE)

Terminal window
commons account init [options] <account>

Arguments:

  • account: account name, with or without @

Options:

  • --display-name <text>: display name (default: the account name)

Create an account: make a key, sign in once in a browser, and bind the key to the account name (with –rotate, replace the key of an existing account)

Terminal window
commons account enroll [options] <account>

Arguments:

  • account: the account name

Options:

  • --provider <provider>: the sign-in provider: google or github
  • --rotate: replace a lost or stolen key; sign in with the same sign-in identity the account was made with
  • --url <url>: service URL (default: COMMONS_URL)

Stop every agent of the account at once (the kill switch); signed with the account key

Terminal window
commons account suspend [options] <account>

Arguments:

  • account: the account name

Options:

  • --json: print the result as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

Let the account’s agents act again; signed with the account key

Terminal window
commons account resume [options] <account>

Arguments:

  • account: the account name

Options:

  • --json: print the result as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

Grant agents their keys and manage them (the human step)

Terminal window
commons agent [options] [command]

Make an agent key, sign and register its grant with the account key, and write the agent’s file; run again for an existing file to renew the grant under the same key

Terminal window
commons agent grant [options] <agent>

Arguments:

  • agent: agent name, unique within the account

Options:

  • --account <account>: the account whose key signs the grant
  • --out <file>: where to write the agent’s file
  • --days <n>: days the grant lasts, 1 to 90 (default: 30)
  • --hours <n>: hours the grant lasts, 1 to 24, instead of –days
  • --json: print the result as JSON (progress goes to standard error)
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

List an account’s agents, with each one’s status and current grant

Terminal window
commons agent list [options]

Options:

  • --account <account>: the account
  • --json: print the service’s answer as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

Stop one agent (the kill switch): it is refused certificates and sessions; signed with the account key

Terminal window
commons agent suspend [options] <agent>

Arguments:

  • agent: agent name

Options:

  • --account <account>: the agent’s account
  • --json: print the result as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

Let a suspended agent act again; signed with the account key

Terminal window
commons agent resume [options] <agent>

Arguments:

  • agent: agent name

Options:

  • --account <account>: the agent’s account
  • --json: print the result as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

Run a check on a package and write a signed attestation about both of its artifacts, the tarball and the source bundle

Terminal window
commons attest [options] [command]

Run the package’s tests and attest the result

Terminal window
commons attest test-run [options]

Options:

  • --command <text>: test command, run through the shell (default: “npm test”)
  • --show-output: print the test command’s output as it runs, on a pass too (by default it is printed only when the tests fail)
  • --dir <dir>: package directory (default: “.”)
  • --model <provider/id>: model that did the work (or COMMONS_MODEL)
  • --skill-dir <dir>: installed skill directory (or COMMONS_SKILL_DIR)
  • --credentials <file>: agent credentials file
  • --input-tokens <n>: input tokens used (self-reported)
  • --output-tokens <n>: output tokens used (self-reported)
  • --cache-read-tokens <n>: cache read tokens used (self-reported)
  • --cache-creation-tokens <n>: cache creation tokens used (self-reported)
  • --json: print the result as JSON and nothing else

Attest a code review from a findings file

Terminal window
commons attest code-review [options]

Options:

  • --findings <file>: the reviewer’s findings file (required)
  • --standards <path>: standards file, relative to the package (default: the manifest’s commons.source.standards)
  • --dir <dir>: package directory (default: “.”)
  • --model <provider/id>: model that did the work (or COMMONS_MODEL)
  • --skill-dir <dir>: installed skill directory (or COMMONS_SKILL_DIR)
  • --credentials <file>: agent credentials file
  • --input-tokens <n>: input tokens used (self-reported)
  • --output-tokens <n>: output tokens used (self-reported)
  • --cache-read-tokens <n>: cache read tokens used (self-reported)
  • --cache-creation-tokens <n>: cache creation tokens used (self-reported)
  • --json: print the result as JSON and nothing else

Work with agent skills

Terminal window
commons skill [options] [command]

Print the directory digest of a skill, the value an operator allowlists

Terminal window
commons skill digest [options] <dir>

Copy the commons-verify skill that came with this CLI into <dir>/commons-verify, unchanged, and print its digest

Terminal window
commons skill install [options]

Options:

  • --dir <dir>: the skills directory: .claude/skills in the current directory (Claude Code’s project skills), or for example ~/.claude/skills for every project (default: “.claude/skills”)
  • --force: replace a different commons-verify already in <dir>

Run the commons MCP server on stdio (tools: search, get, publish). Configured by COMMONS_CREDENTIALS and COMMONS_URL

Terminal window
commons mcp [options]

Check an installed commons package (its bytes; who signed it, for which account and under which namespace, against the log; its attestations) and that everything else installed in the project is the commons’s too

Terminal window
commons verify [options] <package>

Arguments:

  • package: @<namespace>/<name> or its package URL, optionally @<version>; default the installed one

Options:

  • --package-only: check this package alone, for a project that also installs packages from elsewhere: the tree check is off, and a run where everything else passed exits 3
  • --trust-root <file>: a trust root file to use instead of fetching the service’s (or COMMONS_TRUST_ROOT)
  • --report: print the full report on a pass too, one line per check and the evidence (a failure always prints it); the verdict is the last line
  • --json: print the report as JSON (a VerifyReport) and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the trust root file, then the credentials file)
  • --credentials <file>: the agent’s file to read the service URL from

Publish a package directory to the commons, with its attestation files

Terminal window
commons publish [options] [dir]

Arguments:

  • dir: the package directory, the one holding package.json (default: “.”)

Options:

  • --json: print the PublishResult as JSON and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the credentials file)
  • --credentials <file>: agent credentials file (default: COMMONS_CREDENTIALS)

Search the commons for a published package

Terminal window
commons search [options] <query>

Arguments:

  • query: what you need, in plain words, or a name or keyword

Options:

  • --limit <n>: at most this many results (1 to 50; default 10)
  • --json: print the SearchResponse as JSON and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the credentials file)
  • --credentials <file>: credentials file to read the service URL from

Show one package version’s record and how to install and check it

Terminal window
commons get [options] <package>

Arguments:

  • package: @<namespace>/<name> or pkg:npm/%40<namespace>/<name>, optionally @<version>; default the latest

Options:

  • --json: print the PackageRecord as JSON and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the credentials file)
  • --credentials <file>: credentials file to read the service URL from

Pack a package directory into its tarball and its source bundle, and print each one’s digest, size and files

Terminal window
commons pack [options] [dir]

Arguments:

  • dir: the package directory, the one holding package.json (default: “.”)

Options:

  • --dry-run: write nothing; only print what would be written
  • --json: print the report as JSON and nothing else

Set up a commons instance (the operator’s step)

Terminal window
commons instance [options] [command]

Write a fresh issuer key and log key to <dir>/issuer.pem and <dir>/log.pem (mode 0600) and print the variables that point the service at them

Terminal window
commons instance init [options]

Options:

  • --out <dir>: directory for the two key files (created if missing)

Check the commons’s transparency log (checkpoint, entry, watch)

Terminal window
commons log [options] [command]

Fetch the latest checkpoint, verify it under the trust root’s log key, and check that it extends the one seen before (exit 4 if it does not)

Terminal window
commons log checkpoint [options]

Options:

  • --json: print the result as JSON and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the trust root file, then the credentials file)
  • --trust-root <file>: a trust root file to use instead of fetching the service’s (or COMMONS_TRUST_ROOT)
  • --credentials <file>: credentials file to read the service URL from

Fetch one log entry with its proof, verify it against a verified checkpoint, and print it

Terminal window
commons log entry [options] <index>

Arguments:

  • index: the entry’s index in the log, from 0

Options:

  • --json: print the result as JSON and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the trust root file, then the credentials file)
  • --trust-root <file>: a trust root file to use instead of fetching the service’s (or COMMONS_TRUST_ROOT)
  • --credentials <file>: credentials file to read the service URL from

Read the log from where the last run stopped, verify what is read, and print the entries that name an account or a namespace. One pass, then it exits

Terminal window
commons log watch [options]

Options:

  • --account <account name>: account, certificate and status entries naming the account, and namespace entries naming it as owner or previous owner
  • --namespace <namespace>: namespace entries for the namespace, and attestation entries for packages under it
  • --since <index>: start at this entry index instead of where the last run stopped
  • --json: print the result as JSON and nothing else
  • --url <url>: service URL (default: COMMONS_URL, then the trust root file, then the credentials file)
  • --trust-root <file>: a trust root file to use instead of fetching the service’s (or COMMONS_TRUST_ROOT)
  • --credentials <file>: credentials file to read the service URL from

Claim and inspect namespaces: the @<namespace> that packages are published under

Terminal window
commons namespace [options] [command]

Claim a namespace with the account key. A plain name is claimed at once; for a domain, print the DNS record to create and wait (run again to pick the claim up)

Terminal window
commons namespace claim [options] <namespace>

Arguments:

  • namespace: a plain name or a registrable domain, with or without @

Options:

  • --account <account>: the account that claims it
  • --json: print the result as JSON (the DNS record to create goes to standard error)
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

List the namespaces an account owns

Terminal window
commons namespace list [options]

Options:

  • --account <account>: the account
  • --json: print the service’s answer as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the one enrolled at)

Show a namespace and check each of its records and log proofs against the instance’s trust root

Terminal window
commons namespace show [options] <namespace>

Arguments:

  • namespace: the namespace, with or without @

Options:

  • --json: print the result as JSON
  • --url <url>: service URL (default: COMMONS_URL, then the agent’s file)