@zespan/cli is a small, dependency-free command-line tool. It ships two binaries:
zespan-gate is not deprecated and nothing about it changed. If you already
call zespan-gate from a CI pipeline, keep doing exactly that — zespan gate
is the same logic reachable through the new binary, not a replacement for it.Install
zespan and zespan-gate into node_modules/.bin. You can also run either without installing:
Commands
zespan --help (also shown by zespan with no
arguments). An unrecognized command prints the same text to stderr and exits 2.
zespan auth— signs this machine in as you, with an OAuth 2.0 device grant a human approves in the browser. See zespan auth.zespan link/zespan projects list— choose the project a directory belongs to, and list every project you can reach. See zespan link.zespan doctor— diagnoses SDK setup problems: bad or missing API key, unreachable API, no data arriving, PII redaction posture, and the most common “I installed the SDK and see nothing” mistake. See zespan doctor.zespan policy— authors, plans and applies guardrail policy-as-code files. See zespan policy.zespan gate— gates a prompt version’s quality in CI. Identical tozespan-gate; see CI quality gate for the full flag reference and exit code contract.
Two credentials, two planes
The CLI can hold two credentials, and they are not interchangeable. Which one a command uses is decided by what the command does, not by which one you happen to have set.
If both are available, the sign-in wins on the control plane and the API key is
left untouched for the data plane — the two identities never silently mix. A
stored sign-in that is expired, or that was minted against a different API host,
produces a refusal naming the fix rather than a quiet fallback to the API key.
Configuration file — .zespan.yaml
Both zespan commands read an optional .zespan.yaml from the current working directory. It supports a flat key: value format only — no nested maps, lists, or multi-line scalars. A line the parser can’t make sense of is silently ignored rather than rejected, so a .zespan.yaml written for a future CLI version degrades gracefully on an older one instead of breaking it.
.zespan.yaml
Environment variables
Precedence
For every value except the API key and the API URL: flags > environment variable >.zespan/config.json > .zespan.yaml > built-in default. The API key and the API URL both skip both files entirely — they only ever come from --api-key/ZESPAN_API_KEY and --api-url/ZESPAN_API_URL respectively.
.zespan/config.json is written by zespan link and carries the project and org. It sits above .zespan.yaml because it is the newer, explicit act; a project with no .zespan/config.json behaves exactly as before.
Next steps
zespan auth
Sign in as yourself, and what the approval screen checks.
zespan link
Link a project to a directory, and list what you can reach.
zespan doctor
What each check verifies, sample output, and how to read a failure.
zespan policy
Author, plan and apply guardrail policies from your repository.
CI quality gate
The
zespan gate / zespan-gate flag reference and exit code contract.API keys
Create and rotate the key
zespan doctor and zespan gate authenticate with.
