nohead CLI: its --json output and exit codes cost an agent less context than a list of tools.
Set up the CLI
Install the CLI, then sign in on your own machine:nohead login opens the web app for you to approve a key for the project (an agent can run it too, and shows you the code to check). nohead link <project> in a checkout keeps an agent working there in that project: see Projects.
In CI, or for an agent that should act with a key of its own, create a key in the web app instead, as in Work with agents, and set it as NOHEAD_API_KEY. In CI, pin the CLI’s version too. Don’t keep NOHEAD_API_KEY set where you’ve logged in: while it’s set, it wins over saved keys and a folder’s link.
Output agents can rely on
- With
--json, stdout carries exactly one JSON document: the API’s own representation of the result, or forschemacommands the plan. - Errors go to stderr. With
--json, they use the API’s error envelope,{ "error": { "type", "message", "request_id", "details" } }, and the CLI adds a few types of its own, such asnetwork_errorandschema_differs. Quote therequest_idwhen you ask for support. - Rate limits (
429), network failures and5xxresponses are retried on their own, and every write carries anIdempotency-Key, so a retry never applies a change twice. - Exit codes tell API errors, usage errors and an unreachable API apart: Output and exit codes lists them.
Schema as code in CI
Keep your collections and fields in anohead.schema.yaml file in your repository, and let CI apply it. nohead schema diff shows a pull request’s changes, nohead schema push --yes applies the file after merge, and a scheduled nohead schema diff --exit-code catches changes someone made in the web app instead. A push never deletes collections or fields, and changes that rewrite existing values (field migrations) need --allow-migrations. Schema as code covers the file and the workflow.
Change content safely
- Say why.
--noteis kept with the revision, the merge or the schema change it makes, and shown in history next to the key’s name and the client it came through, such as the CLI. Through the API, send theNohead-Change-Noteheader; in the SDKs, passchangeNote(TypeScript) orchange_note(Python, Ruby). - Don’t overwrite newer edits.
--if-revisionrefuses the change with412if someone changed the record since the revision the agent read. Read it again, and apply the change again. - Propose, don’t publish. A draft holds changes until a person reviews them and merges them in the editor (Publish changes, or Apply changes for an unpublished record), or with
nohead drafts merge. - Sync without duplicates. Through the API, an SDK or the MCP server’s
create_record, creating a record withupsert_on, the key of auniquefield such as a slug, updates the record that already has that value instead of adding another, so a sync job can run again and again. - Undo. Every record change is a revision you can revert,
--dry-runpreviews a revert, and deleted records, fields, collections and assets can be restored for 30 days.
A snippet for your AGENTS.md
Tell your coding agent how your project uses Nohead, inAGENTS.md, CLAUDE.md or your tool’s rules file: