How to use the CLI
Install the standards CLI, log in to the hosted API, and script your workspace with JSON, table or CSV output.
The standards CLI (@standards/cli) talks to the Standards API over HTTP. It is the shortest path from a terminal to your records, documents, schema, MCP servers and agents. Every output is plain text or JSON, so a coding agent drives it as well as a person.
Install and log in
npm i -g @standards/clistandards loginlogin opens your browser on the instance's device page and prints a code in the terminal. Type that code into the page (the link never carries it), pick the workspace and allow. The CLI then stores a personal key named Standards CLI - <host> and a profile named after the workspace. The key works for you: the environments, sessions and records you create from the CLI are yours, in your app. A decision a session started from the CLI stops on is answered in the app for now: standards decisions reads and answers the key's own decisions only.
- The key acts with your access, minus key management: it cannot create or revoke other keys and cannot appoint owners.
- One login per workspace. Logging in again revokes the keys of your earlier browser-login profiles of that workspace; a profile whose key was revoked is removed, and
loginnames it. A profile of another workspace on the same instance keeps its key. - Ctrl-C stops the login. Pressed while the key is being created,
loginnames the key to revoke in Settings, API keys in case the server created it. - Over SSH the browser is not opened for you: open the printed link yourself.
- Without a terminal,
loginexits with code 2 instead of waiting. Agents and CI setSTANDARDS_API_KEY.
Browser login works on hosted Standards. A self-hosted instance offers it once it runs the client authorization server with the cli resource (scope cli:login) and the standards-cli client registered for the device grant. Otherwise login tells you to create a personal key in Settings, API keys and pass it with --key:
standards login --url https://api.standards.new/v1 --name prod --key stndrds_your_api_keyPass --url for any instance but hosted Standards
Without --url, login targets the hosted API. For a self-hosted or local instance, pass its URL; commands other than login fall back to http://localhost:4100/v1 when no profile is selected.
With --key, login validates the key against the API before it saves anything. Confirm the profile is usable:
standards whoamiwhoami prints the active profile, its API URL and its key's prefix, then checks the key with one call and prints API key is valid.
Profiles
Profiles live in ~/.standards/config.json, written with mode 0600. Set STANDARDS_CONFIG_DIR to move the whole directory, for example in CI.
standards instancesstandards use prodstandards logout prodlogout without a name removes the active profile. When the profile came from a browser login, logout first revokes its key on the server, so the key stops working everywhere; if the server cannot be reached in time it warns and still removes the profile. A key stored with --key is only forgotten locally.
The environment profile
STANDARDS_API_URL and STANDARDS_API_KEY form a profile of their own. standards instances lists it as sandbox with source: "env". It is active only while no profile is selected in the config file.
STANDARDS_API_URL=https://api.standards.new/v1 STANDARDS_API_KEY=stndrds_ci_key standards records list contactsResolution order
--api-urlor--api-keyon the command line. Either flag bypasses every profile; the other value falls back to the environment, then to the compiled default.--instance <name>, then the profile selected withuse.STANDARDS_API_URL/STANDARDS_API_KEY.- The compiled default URL, with no key.
Global flags
| Flag | Description |
|---|---|
--format <fmt> | json (default), table or csv. |
--api-url <url> | API base URL. Bypasses the profile. |
--api-key <key> | API key. Bypasses the profile. |
--instance <name> | Use a named profile for this call. |
--tenant <id> | The tenant you are authenticated in. A confirmation of intent, not a selector: the API refuses any other value. |
Commands
| Command | What it does | Page |
|---|---|---|
login, use, instances, logout, whoami | Profiles and the key they hold. | This page |
records, documents, files, meetings | Records and their sharing, documents and their files, uploaded files, meetings and their transcripts. | Records, Documents and files |
schema list|inspect|groups|pull|diff | Inspect the deployed schema and compare it with the shared runtime. | Schema and bundles |
bundles | Sync, add, update and remove bundles. | Schema and bundles |
skills | Pull, push, find and add workspace skills. | Skills |
mcp, connectors | Outbound MCP servers, mailbox and calendar connections. | MCP servers, Connectors |
keys, invitations | API keys and tenant invitations. | This page |
usage | AI usage, wallet and quotas in one read. | Usage |
environments, secrets, machines, links | Where agents run and what their machines receive and publish. | Agents from the CLI |
sessions, decisions, status, watch | Run agents, answer them and monitor them. | Agents from the CLI |
init, guide | Install the agent skill and print its guides. | The agent skill |
standards <command> --help lists a command's subcommands and flags. Where a dry run exists, --dry-run shows what a command would do and writes nothing.
Output formats
json prints the response as-is. table and csv read the first row's keys as columns; a scalar or object response becomes a one-row table. Nested values are serialised as JSON. Table cells are truncated at 50 characters.
standards keys list --format tablerecords list and records search return { data, page }, so the table shows two columns. Pipe the JSON through jq instead:
standards records list contacts --limit 20 | jq .dataThe streaming commands (sessions start, send and follow, watch) and status write human text while --format is left at its default. Pass --format json explicitly to get one JSON object per line from a stream, or one object from status.
Record saves are acknowledged after the database write. Search indexing runs through durable batches, so a newly saved record can appear in records search shortly after the save response. The CLI has no job producer mode setting.
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | The API refused the request or the command failed. The message reads ✗ Error (status): message, for example ✗ Error (404): Record not found. |
2 | No instance is configured: no profile, no --api-key, no STANDARDS_API_KEY. login without a terminal and without --key also exits with 2. |
3 | Streaming commands (sessions start, send and follow) and watch --until decision only: a decision is waiting. See Agents from the CLI. |
One command reads them differently: schema diff uses exit code 1 to report differences, not a failure; it exits 0 when equal and 2 on any error. See Schema and bundles.
Every command except login, use, instances, logout, help, init and guide needs a key. Without one the CLI prints ✗ Error: No Standards instance configured and stops with exit code 2.
API keys
standards keys liststandards keys create --name laptop --yes # personal: acts with your access
standards keys create --name ci-bot --workspace --role ci --yes
standards keys detach <keyId> --yes
standards keys revoke <keyId> --yescreate, detach and revoke refuse to run without --yes. create makes a personal key (it acts for the person behind the key you run it with); --workspace makes an integration key that acts with its own roles; --role <name> binds that role instead of member. See Workspaces and API keys.
A browser-login profile holds no key management: with it, keys list shows its own key alone, revoke revokes only that key, and create and detach are refused. To manage keys from the CLI, log in with --key and a key that holds api-keys rights, or use Settings, API keys.
Tenant invitations
Manage the current tenant's explicit invitation lifecycle. Creating an invitation sends an email; the person becomes a member only after accepting it with their verified identity.
standards invitations list --format tablestandards invitations create --email [email protected] --role <roleId> --yesstandards invitations resend <invitationId>standards invitations revoke <invitationId> --yescreate requires --email and --role (an existing role ID). Both create and revoke require --yes: omitting it prints a message asking you to confirm and exits 1, before any API request. resend sends another email without a confirmation flag, and invalidates the link in the previous email. Use an invitation ID from list for resend and revoke: anything that is not an invitation ID is refused the same way, before any request, so the ID can only ever address its own route segment.
| Command | Required system permission |
|---|---|
list | people:read |
create | people:create |
resend | people:update |
revoke | people:delete |
The API refuses callers without the required permission (SCHEMA_FORBIDDEN). Creating an invitation for an address already in this tenant, including a deactivated member, fails with SCHEMA_DUPLICATE_OBJECT; an unknown role fails with SCHEMA_ROLE_NOT_FOUND. Resending the same invitation twice inside a minute fails with SCHEMA_STATE_GATE: the API allows one resend per minute per invitation. An address already invited and still pending returns its existing invitation unchanged. These commands require the server's tenant invitation capability to be configured. The people permission group is described in Workspaces and API keys.
There is deliberately no invitations accept command: an API key cannot accept on someone else's behalf. Acceptance requires the invitee's verified bearer identity and the invitation proof.
Usage, wallet and quotas
standards usage
standards usage --from 2026-11-01 --to 2026-11-07 --scope workspaceusage prints { usage, wallet, quotas } in one command, over the current UTC month unless --from and --to name other days. A part your key may not read is null, with its reason on stderr; the command still exits 0 while one part succeeds. See Usage and limits.
The agent skill
standards init
standards init --global
standards guide
standards guide agents
standards guide --listinit installs a skill named standards for coding agents: it writes .agents/skills/standards/SKILL.md in the current directory and links .claude/skills/standards to it, or copies it where a link fails. With --global it writes the same under ~/.agents/skills/ and ~/.claude/skills/. Codex reads the first, Claude Code the second. The skill is a short stub that tells the agent to load standards guide core, so its content always matches the installed CLI. init only overwrites a SKILL.md it wrote itself and never follows a link it did not create: anything else at the target is refused with nothing written.
guide [topic] prints a guide written for an agent: core by default (profiles, global flags, output and exit codes, the agent loop), then records, schema-and-bundles and agents. guide --list lists the topics, one per line.
Maintenance routes
Search, memory and meeting maintenance have no command: they are routes an operator calls over HTTP, with a key holding the settings update permission. Each acts on the key's own workspace: the body's tenantId confirms it, and the API rejects any other. Each starts a background job and answers 202 once accepted.
curl -X POST "$STANDARDS_API_URL/admin/search/full-reindex" \
-H "Authorization: Bearer $STANDARDS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tenantId": "<tenantId>" }'| Route | Body | What it does |
|---|---|---|
POST /admin/search/full-reindex | { "tenantId" } | Rebuilds the workspace's record search index beside the current one, which keeps answering, and replaces it in one step once every record is in it. Records saved meanwhile are included; nothing is cleared first. Refused (409) while a rebuild runs. |
POST /admin/search/email-reindex | { "tenantId", "afterId"? } | Hands the workspace's stored messages back to the email indexer, which delivers them in the background. Messages already waiting keep their place; the index is not cleared. The server logs report how many messages were handed back and the last email id processed: after a failure, resume with that id as afterId. |
POST /admin/search/email-reindex | { "tenantId", "rebuild": true } | Rebuilds the mail index from the stored messages beside the current one, then swaps it in. It only recovers a mail index that is not built or whose indexer stopped on an uncertain write: on a healthy one it is refused (409), as it is while a rebuild runs, and beside afterId (400). |
POST /admin/memory/backfill | { "tenantId" } | Feeds agent memory the workspace's last 30 days of conversations and meeting transcripts, oldest first, each source once. It stops at 200 memory passes or 2,000,000 model tokens; calling it again resumes. See Skills and memories. |
POST /admin/meetings/grants-recompute | { "tenantId" } | Recomputes who private meetings are shared with, as a retry or a repair; idempotent, it deletes nothing. A server without a calendar answers 404. See Record access. |
POST /admin/embeddings/drain | { "tenantId" } | Catches up the workspace's pending embeddings. A server without embeddings answers 404. |
Shell pitfalls
- Single-quote JSON so the shell keeps the double quotes:
--data '{"name":"Alice"}'. --filtertakes the raw filter tree as JSON, exactly as the API expects it.--sorttakes one rule,attribute:direction. Pass it once.--fields ""hydrates no reference attribute. Omit the flag to hydrate all of them.- Wrap
--queryin quotes when it contains spaces.
Connectors
List configured providers and workspace connections:
standards connectors providers
standards connectors liststandards connectors connect --provider github prints that the account is connected from the app: open the Connectors page and connect it there, because the person who consents must come back to a signed-in Standards session. Supported provider IDs are github, slack, gmail, outlook, google-calendar and outlook-calendar; availability depends on the instance configuration shown by connectors providers. A mailbox or calendar provider first prints what the connection allows and refuses to run, before any request, until you add --yes: see Connected mailboxes and calendars.
Disconnect a connection with --yes; the command refuses to run without it, before any request:
standards connectors disconnect <connectionId> --yes
standards connectors disconnect <connectionId> --yes --remove-importedBy default the mail and meetings a mailbox or calendar connection imported stay. With --remove-imported they are deleted too, for everyone, the owner included. Only the owner of a personal connection can ask it: on a connection made for the whole workspace, what it imported is the workspace's shared history, and the API refuses it (403, SCHEMA_WORKSPACE_INVARIANT) with nothing deleted. A GitHub or Slack connection imports neither, so the flag changes nothing there. What is kept and what goes is described in Record access.
Next steps
- Records: list, search, create, update, attach a file and share a private record.
- Documents and files: manage packs and read OCR text.
- Schema and bundles: inspect the deployed schema and sync its bundles.
- MCP servers: connect outbound servers from a terminal.
- Skills: pull, push, find and add workspace skills.
- Agents from the CLI: environments, secrets, sessions, decisions and monitoring.
- Device fleet: enroll a machine your agents run commands on, with the
standards-deviceworker. - Usage and limits: what
standards usagereports. - Book a demo
Connected mailboxes and calendars
How to connect Gmail, Outlook, Google Calendar or Outlook Calendar, what Standards reads, what each access level allows, and how to change it, disconnect and delete what was synced.
Records
Read, search, write, move and delete records of any object, and attach a local file to one of them, from a terminal.