CLI reference
Every command, argument, flag and exit status, rendered from the program. The command list is the registered command set, and each command's flags are read back from its own registrations — so this page cannot describe a flag the CLI does not have, or miss one it does.
stamity with no arguments prints help and exits 0: a first touch is not a
mistake.
Every command
| Command | Advertised | Effect | What it does |
|---|---|---|---|
stamity init | yes | writes | set up this repo: detect the stack, decide the defaults, write the state |
stamity sync | yes | writes | regenerate every managed file from the manifest and bundled content |
stamity upgrade | yes | writes | move this setup to the running release: run its sync and move the package.json pin |
stamity check | yes | reads only | diagnose the environment and gate on drift between disk and the engine's output |
stamity validate | yes | reads only | check the content, hooks, learnings and credentials this repo authored |
stamity ready | yes | reads only | report whether this repository is ready for unattended runs, reading files only |
stamity add | yes | writes | install a content pack: run the gate chain, show every command it would wire, then write |
stamity config | yes | writes | inspect and change the setup: keys, detection refresh, MCP servers |
stamity workspace | yes | writes | one policy across several repositories: status, guided creation, and the cascade |
stamity worktree | yes | writes | parallel checkouts of this repository: the inventory, guided setup, and receipt-based teardown |
stamity clean | yes | writes | remove every generated file and the setup's own state, keeping yours under .stamity/ |
stamity gc | yes | writes | report the disk local runs, branches, worktrees and handoffs hold, and free it with --apply |
stamity skill | yes | writes | copy in a skill from a trusted source, pinned and scanned; list copied skills and their drift; remove one |
stamity away | yes | writes | turn the nobody-watching switch on or off, or show it and the asks it held for you |
stamity learn | plumbing | writes | capture a learning through the engine's write gates, or read them through its screen (plumbing) |
stamity handoff | plumbing | writes | prepare, resume, list, complete and prune handoffs through the engine's gates (plumbing) |
stamity ledger | plumbing | writes | append findings to a run's ledger, close its rows, print its resume card, and read and write the deferral inbox (plumbing) |
stamity gate | plumbing | writes | classify a change, scan its added lines or an outbound text for secrets, check an unattended start, or digest held test files (plumbing) |
stamity plan | plumbing | reads only | check that plans are ready for an unattended start (plumbing) |
stamity run | plumbing | writes | put an unattended run on a branch of its own, and push its work there (plumbing) |
What every command shares
These are registered by the program, not by the individual commands, so they behave identically everywhere they apply.
| Flag | Applies to | What it does |
|---|---|---|
-h, --help | program | print usage and exit |
-v, --version | program | print the version and exit |
--no-color | program | disable colored output |
--json | every command | machine-readable JSON output (non-interactive) |
-y, --yes | every command | take the non-interactive path: every prompt resolves to its default, and a destructive confirmation proceeds instead of declining |
--dry-run | mutating commands | preview changes without writing |
JSON output
--json produces exactly one JSON document on stdout, and nothing else, for every
run that reaches a command — all 20 of the commands above, success and
failure alike. Human output is suppressed in the same run, so a reader never has to
separate prose from payload. Every document carries ok, command and version;
a success adds the command's own fields, and a failure adds error with code and
message.
A command line that is rejected before any command runs (exit 2 below — an unknown verb,
a missing required argument, a value outside a flag's choices) never reaches an action, so
stdout is empty and the diagnostic is on stderr. Parse stdout only after checking that
the status is not 2.
The error object carries two OPTIONAL further lines, why and
next, which mirror the why: / next: lines the human
rendering prints. They appear when the failure was raised with them and are absent
otherwise: a throw site that knows the cause and the remedy states them, and one that does
not omits the keys rather than filling them with a guess. Treat both as optional when
parsing.
--json makes a run NON-INTERACTIVE — stdout belongs to the single document, so no
prompt can be written there — but it is NOT consent. It does not imply -y, --yes:
a command whose prompt is a destructive confirmation refuses the run instead of proceeding
on an assumed yes, so a pipeline that means to delete says -y explicitly.
Diagnostics still go to stderr, which is what keeps stdout parseable.
Exit statuses
Three, and only three.
| Status | What it means |
|---|---|
0 | the command succeeded — --help and --version leave through here too |
1 | the command ran and failed; the code below says which failure it was |
2 | the command line was rejected before any command ran |
A failure is always status 1. Which failure it was travels in the error document's
error.code field, not in the exit number, so a CI script branches on the code
string — there is no second numbering to read.
error.code | What failed |
|---|---|
VALIDATION_ERROR | content or config in this repository is structurally invalid |
CONFIG_ERROR | an input file is malformed — manifest, YAML, pack manifest |
ADAPTER_ERROR | a target-tool adapter could not produce its output |
UNKNOWN_ERROR | an internal fault; the engine reached a state it does not classify |
INTEGRITY_ERROR | a check found drift, a pack failed a trust or integrity gate, a write was refused over injection patterns in content it would keep, or a handoff failed its read-back digest |
FS_ERROR | a filesystem operation failed |
CLEAN_ERROR | clean's confirmation was declined or could not be asked, or a file it would keep is one a sync with this version rewrites; nothing was removed |
NETWORK_ERROR | a git transport failed — worktree setup could not reach origin to plan its branch; a remote with no such branch is not this |
LOCK_TIMEOUT | a write lock could not be taken before the retry schedule ran out; another stamity run was holding it |
EXPECTATION_ERROR | check was told which release, clients or install mode to expect (--expect-*), and the repository records another |
AUTONOMY_LOOSENED | a sync, init, workspace sync or upgrade would write a guard looser than the one on disk, the setting committed at HEAD or the manifest it replaces; nothing was written, and the person runs the command with --loosen |
Two more codes exist only at the CLI edge and never come from the engine:
USAGE for a rejected command line, and FAILURE for a fault that
carries no engine classification.
stamity init
set up this repo: detect the stack, decide the defaults, write the state
May write when it runs, so --dry-run previews any change without making it.
| Flag | What it does | Default |
|---|---|---|
--tools <csv> | target tools, comma-separated (claude, cursor, copilot, codex) | — |
--maturity <tier> | investment-calibration tier — one of solo, team, scaleup, enterprise | — |
--migrate <mode> | what to do with a detected predecessor setup — one of full, skip | — |
--import-config <mode> | what to do with an existing agent config file; under --force, a file the replaced setup already decided keeps that decision, and the note init prints for that file says how to choose again — one of supplement, replace, skip | — |
--force | replace an existing setup in place | — |
--loosen | write a guard copy looser than the autonomy setting on disk, at HEAD or in the manifest it replaces (the person's act) | — |
stamity sync
regenerate every managed file from the manifest and bundled content
May write when it runs, so --dry-run previews any change without making it.
| Flag | What it does | Default |
|---|---|---|
--force | overwrite colliding unmanaged files after a verified .bak | — |
--loosen | write a guard copy looser than the autonomy setting on disk, at HEAD or in the manifest it replaces (the person's act) | — |
stamity upgrade
move this setup to the running release: run its sync and move the package.json pin
May write when it runs, so --dry-run previews any change without making it.
| Flag | What it does | Default |
|---|---|---|
--to <version> | the release to move to, which must be the release running this command | required |
--allow-downgrade | move to a release older than the one that wrote the setup | — |
--allow-major | move to another major release | — |
--loosen | write a guard copy looser than the autonomy setting on disk, at HEAD or in the manifest it replaces (the person's act) | — |
stamity check
diagnose the environment and gate on drift between disk and the engine's output
Reads only. Nothing is written, so there is no preview mode to need.
| Flag | What it does | Default |
|---|---|---|
--expect-version <semver> | fail unless this exact release generated the repository and runs this check | — |
--expect-tools <csv> | fail unless the manifest's clients are exactly the listed ids, each one of claude, cursor, copilot, codex | — |
stamity validate
check the content, hooks, learnings and credentials this repo authored
Reads only. Nothing is written, so there is no preview mode to need.
Adds no flags of its own beyond the shared matrix above.
stamity ready
report whether this repository is ready for unattended runs, reading files only
Reads only. Nothing is written, so there is no preview mode to need.
| Flag | What it does | Default |
|---|---|---|
--path <dir> | the repository root to read (default: the current folder) | — |
stamity add
install a content pack: run the gate chain, show every command it would wire, then write
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<pack-spec> | catalog id (frontend), pack directory (./packs/frontend), or an installed package name (@acme/ops) |
| Flag | What it does | Default |
|---|---|---|
--allow-untrusted | install a pack with no trust basis at all — its hook and MCP definitions become commands your client runs as you (for packs you authored) | — |
--preview | print every planned file's full body (bounded by the pack's footprint cap) | — |
stamity config
inspect and change the setup: keys, detection refresh, MCP servers
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
[subcommand] | list | get | set | detect | mcp | policy — omit on a terminal for the interactive picker |
[key] | config key, the mcp action (list | add | remove | own), or the policy action (list | init | allow | deny | remove) |
[value] | new value, the MCP server id, the own server row file, or the policy pattern |
| Flag | What it does | Default |
|---|---|---|
--force | config policy init: replace an existing .stamity/policy.json — including a defective one, which is the way out of a fail-closed policy | — |
--remove <id> | config mcp own: deselect an own server, take its entries out of the client documents, then delete its row | — |
stamity workspace
one policy across several repositories: status, guided creation, and the cascade
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
[subcommand] | status | init | sync — omit for status |
| Flag | What it does | Default |
|---|---|---|
--tools <csv> | defaults.tools for the created workspace, comma-separated (claude, cursor, copilot, codex) — workspace init only | — |
--force | workspace init: overwrite a workspace.json already at this directory, or create one nested inside an outer workspace. workspace sync: in every member, overwrite colliding unmanaged files after a verified .bak | — |
--loosen | workspace sync only: in every member, write a guard copy looser than the autonomy setting on disk, at HEAD or in the manifest it replaces (the person's act) | — |
stamity worktree
parallel checkouts of this repository: the inventory, guided setup, and receipt-based teardown
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
[subcommand] | list | setup | cleanup — omit for list |
[name] | the worktree name — its directory under the farm, and the branch it checks out |
| Flag | What it does | Default |
|---|---|---|
--use-existing | worktree setup: attach to an existing local branch of that name | — |
--no-use-existing | worktree setup: refuse rather than attach to an existing local branch | — |
--track | worktree setup: track the remote branch of that name | — |
--no-track | worktree setup: create a new local branch off HEAD instead of tracking | — |
--copy-secrets | worktree setup: copy entries marked secret in the policy — without it they are skipped and the report says so | — |
--run <run-id> | worktree setup: name the run this lane belongs to in its receipt | — |
--all | worktree cleanup: sweep every worktree this lane manages | — |
--files-only | worktree cleanup: invert the receipt's files and leave the checkout in place | — |
--force | worktree cleanup: proceed on a worktree carrying uncommitted changes | — |
stamity clean
remove every generated file and the setup's own state, keeping yours under .stamity/
May write when it runs, so --dry-run previews any change without making it.
| Flag | What it does | Default |
|---|---|---|
--pack <id> | remove one installed pack — its files and ledger rows — and keep everything else | — |
--purge | also delete the whole .stamity/ directory: learnings, handoffs, overrides, installed packs and run records | — |
stamity gc
report the disk local runs, branches, worktrees and handoffs hold, and free it with --apply
May write when it runs, so --dry-run previews any change without making it.
| Flag | What it does | Default |
|---|---|---|
--apply | free the default set; without it the run is a preview | — |
--reports-older-than <days> | free run reports older than this many days | 30 |
--runs-older-than <days> | also free the untracked files of run folders older than this many days | — |
--branches | also delete merged local stamity/* branches, with git branch -d | — |
stamity skill
copy in a skill from a trusted source, pinned and scanned; list copied skills and their drift; remove one
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<subcommand> | add | list | remove |
[source-or-name] | add: the source id from .stamity/skill-sources.json; remove: the skill name |
[name] | add: the skill's folder name in the source |
| Flag | What it does | Default |
|---|---|---|
--tag <tag> | skill add: the source's version tag, which must name --commit (the root --version prints the engine's) | — |
--commit <sha> | skill add: the pinned commit, 40 hex digits | — |
--sha256 <aggregate> | skill add: the aggregate sha256 the source published; a copy reading any other is refused | — |
stamity away
turn the nobody-watching switch on or off, or show it and the asks it held for you
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<subcommand> | on | off | status |
Adds no flags of its own beyond the shared matrix above.
stamity learn
capture a learning through the engine's write gates, or read them through its screen (plumbing)
Plumbing. This verb is not listed in stamity --help because its caller is generated
agent content rather than a person. Hidden is not secret — stamity learn --help prints
in full — and it is documented here because a verb that exists and is undocumented is
worse than one that is merely unadvertised.
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<subcommand> | capture a learning, accept a run's proposal, or read the screened index — one of capture, read, accept |
| Flag | What it does | Default |
|---|---|---|
--title <text> | capture (required): what the learning is about; also its file-name slug | — |
--summary <text> | capture (required): one index line, under 200 characters | — |
--confidence <level> | capture: how much evidence backs the finding — one of low, medium, high | medium |
--body-file <path> | capture: read the body from a file instead of stdin | — |
--review-by <date> | capture: when the learning should be re-checked (YYYY-MM-DD) | — |
--validated-against <text> | capture: the command, test or path the finding was checked against | — |
--body <id> | read: print one loaded learning's body instead of the index | — |
--propose | capture: run the gates and write the note to the run's folder, not to the live learnings | — |
--run <id> | capture --propose, accept (required): the run whose folder holds the proposal | — |
--proposal <slug> | accept (required): the proposal to take live | — |
--digest <sha256> | accept (required): the digest the morning row printed; a proposal reading any other is refused | — |
stamity handoff
prepare, resume, list, complete and prune handoffs through the engine's gates (plumbing)
Plumbing. This verb is not listed in stamity --help because its caller is generated
agent content rather than a person. Hidden is not secret — stamity handoff --help prints
in full — and it is documented here because a verb that exists and is undocumented is
worse than one that is merely unadvertised.
May write when it runs, so --dry-run previews any change without making it.
In resume mode that preview is the status advance: the screens, the drift report and
the framed body all still print, and the run names the transition it withheld —
Dry run: <id> would go active → in-progress. Nothing was written.
| Argument | What it is |
|---|---|
<mode> | which handoff mode to run — one of prepare, resume, list, complete, prune |
[id] | handoff id, for resume and complete |
| Flag | What it does | Default |
|---|---|---|
--title <text> | what the work is about; also the id's slug source | — |
--summary <text> | one line the next session reads first, under 200 characters | — |
--from-tool <tool> | the client writing the handoff — one of claude, cursor, copilot, codex | — |
--to-tool <tool> | the client meant to resume it — one of claude, cursor, copilot, codex | — |
--git-ref <ref> | the ref the work sat on, as | — |
--body-file <path> | read the body from a file instead of stdin | — |
stamity ledger
append findings to a run's ledger, close its rows, print its resume card, and read and write the deferral inbox (plumbing)
Plumbing. This verb is not listed in stamity --help because its caller is generated
agent content rather than a person. Hidden is not secret — stamity ledger --help prints
in full — and it is documented here because a verb that exists and is undocumented is
worse than one that is merely unadvertised.
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<subcommand> | which ledger action to run — one of append, close, status, inbox, inbox-write |
| Flag | What it does | Default |
|---|---|---|
--run <run-id> | the run folder's name under .stamity/runs/ | — |
--phase <phase> | the phase the rows are filed under, a lowercase slug (review, build) | — |
--source <role> | the role whose findings these are, a lowercase slug (reviewer) | — |
--report <path> | a report inside the run's reports/ folder | — |
--stdin | read the findings block, or inbox-write's rows, from stdin | — |
--ids <ledger-ids> | the comma-separated ledger ids handed to this re-review | — |
--id <ledger-id> | the one row a manual close or a retirement moves | — |
--state <state> | the state a manual close sets — one of fixed, rejected, deferred | — |
--rationale <text> | why a manual close moves the row, recorded on it | — |
--retired <disposition> | retire a deferred row whose inbox row left: keeps its state and records the date and this disposition | — |
--remove <refs> | the comma-separated Ref: values whose inbox bullets inbox-write removes | — |
--paths <paths...> | the paths a change touches; the inbox rows naming them are printed | — |
--plan <path> | a plan path; the inbox rows whose Ref: or location names it are printed | — |
--area <words...> | whole words matched in an inbox row that names no path | — |
--due [date] | a day as YYYY-MM-DD, today when no value is given; the inbox rows whose by: day is on or before it are printed | — |
stamity gate
classify a change, scan its added lines or an outbound text for secrets, check an unattended start, or digest held test files (plumbing)
Plumbing. This verb is not listed in stamity --help because its caller is generated
agent content rather than a person. Hidden is not secret — stamity gate --help prints
in full — and it is documented here because a verb that exists and is undocumented is
worse than one that is merely unadvertised.
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<subcommand> | which gate action to run — one of classify, scan, preflight, held |
| Flag | What it does | Default |
|---|---|---|
--base <ref> | the base the change is read against (default: HEAD, reported as no base) | — |
--paths <path...> | classify these paths by path rules instead of reading the change from git; held: the files to digest, from the project root | — |
--expect <digest> | held: the digest the files must still give; any other exits 1 | — |
--text <file> | scan this outbound text file instead of the change (with --label) | — |
--label <label> | what the --text file is — one of pr-body, morning, reply, comment | — |
--unattended | preflight: check that an unattended run may start here, the one mode it checks | — |
--item <owner/repo#n> | preflight: the board item or issue the run takes as input | — |
stamity plan
check that plans are ready for an unattended start (plumbing)
Plumbing. This verb is not listed in stamity --help because its caller is generated
agent content rather than a person. Hidden is not secret — stamity plan --help prints
in full — and it is documented here because a verb that exists and is undocumented is
worse than one that is merely unadvertised.
Reads only. Nothing is written, so there is no preview mode to need.
| Argument | What it is |
|---|---|
<subcommand> | which plan action to run — one of check |
<plan...> | one or more plan files, in chain order with --chain |
| Flag | What it does | Default |
|---|---|---|
--chain | the plans are one chain: each file's head depends_on names the file before it | — |
--since <sha> | the run's base: a path moved only after it is exempt; one plan takes it alone, several need --chain | — |
--contract <path> | the run contract the plans run under | — |
stamity run
put an unattended run on a branch of its own, and push its work there (plumbing)
Plumbing. This verb is not listed in stamity --help because its caller is generated
agent content rather than a person. Hidden is not secret — stamity run --help prints
in full — and it is documented here because a verb that exists and is undocumented is
worse than one that is merely unadvertised.
May write when it runs, so --dry-run previews any change without making it.
| Argument | What it is |
|---|---|
<subcommand> | which run action to run — one of start, checkpoint, end, land, contract, overview, metrics |
| Flag | What it does | Default |
|---|---|---|
--run <run-id> | the run folder's name under .stamity/runs/ | — |
--paths <path...> | checkpoint and end: also stage these paths, relative to the project root | — |
--pr [number] | checkpoint: open or update the run's draft pull request after the push (with --title); land --job: the pull request to land | — |
--title <title> | checkpoint and end: the draft pull request's title (end needs it) | — |
--signoff | checkpoint and end: add the Signed-off-by line to the commit | — |
--refused | end: title the draft pull request Refused: | — |
--final-round | end: the run's last end; write the run-ended marker the final question round needs (a plain end removes one) | — |
--drop-held <path...> | checkpoint and end: withdraw the held patch's sections for these paths, which the run undid (one it still changes stays held) | — |
--fast-forward | land: fast-forward the default branch to the pull request's head instead of merging it | — |
--method <method> | land: the merge method — one of merge, squash, rebase | — |
--ready | land: mark the run's draft ready for review once the evidence holds, then land it | — |
--wait <minutes> | land: wait up to this many minutes (at most 9) for pending check runs | — |
--approved <sha> | land: the head commit the person approved over an asks outcome; land it if the head is still that commit and nothing refuses (never in an unattended run) | — |
--job | land: run as the land workflow's job, which alone may use it: the run comes from the pull request's marker, and pending evidence exits 0 | — |
--item <owner/repo#n> | contract: the GitHub issue the run takes as its input | — |
--transcript <path> | metrics: a Claude Code session transcript (JSONL) to take tokens and cost from; only its usage counts are read, and they cover this transcript only, not sub-agents' transcripts | — |
Regenerate this page with node scripts/generate-docs.mjs.