05 Reference
CLI contract
Fourteen commands have a terminal twin that needs no model. Five need your agent.
Terminal twins
Run npx github:nosy-hq/nosy <terminal command>. Nothing puts a global nosy on your PATH, so wherever these docs write nosy peek, type the whole thing. The terminal part is the counting. The agent adds the judgment. --pm <folder> or NOSY_PM picks the pm folder (default ./pm).
| Command in your agent | Terminal command |
|---|---|
doctor | nosy doctor · --check checks the install; --fix, --fix --dry-run and --undo fix a pm/ from an older Nosy and undo it |
peek | nosy peek |
shipped | nosy shipped · Also ship-notes, below |
psst | nosy psst · An unchecked draft |
canwe | nosy canwe "<question>" · Evidence and a guess, not the verdict |
frontyard | nosy frontyard |
bet | nosy bet place "<what>" --why "…" --estimate S |
score | nosy score |
move-in | nosy setup · Proposes pm/sources.json; the rest of move-in is the agent |
tour | nosy tour · The plan only: what Nosy reads, writes and sends, the steps and one list of questions. Your agent runs the steps |
atlas | nosy atlas · The candidate × axis matrix from pm/atlas/*.md; nosy atlas seed counts a registry file per country. The research itself is your agent |
handoff | nosy handoff · The list and the preview write nothing; --yes writes; --setup-board and --review; see below |
roadmap | nosy roadmap · --check, --pr --yes and --lang <code>; see below. The Action input roadmap runs it weekly |
neighbors | nosy watch · Which rivals’ public pages changed; the research is the agent. Also tiers, matrix-proposals, rivals-import and rival-signals, below |
tea | nosy page · nosy page-adopt for a page you built by hand |
stakeout | nosy weekly · See the weekly loop |
overheard | none: agent only |
dresscode | none: agent only |
scoop | none: agent only |
spill | none: agent only |
map | none: agent only |
nosy help lists every terminal command, including helpers that have no agent command: facts, find, todo, cite-check, never-check, inventory, notify, publish, mcp and more.
Terminal commands and flags new in 0.19.0
What each one does, and when it exits 1 (it could not run). Otherwise it returns 0 when it ran, or 2 where the contract says so, as for nosy doctor --undo below.
| Command | What it does | When it exits 1 |
|---|---|---|
nosy tour [approve|skip|done <id>…] | Prints the first look: what Nosy reads, writes and sends, the steps with their state (current, to run, skipped) and one list of questions. It runs no step itself. approve, skip and done record your answers and finished steps in pm/state/tour.json. A tour older than 2 days starts again. | approve or done without an id, or a pm/ folder that does not exist. Plain nosy tour in a repo with no pm/sources.json returns 0 and says to run move-in. |
nosy tiers [--json] | Which rivals get a full research pass (tier A), which are only watched (B) or read thinly (C), who needs work now, and the token estimate. Read-only. | There are no rival files in pm/rivals and no rivals in sources.json. |
nosy matrix-proposals check|apply|undo [--dry-run] | Sorts the matrix cells the neighbor agents propose by evidence. apply writes only the ones that earned it, after a backup. undo puts the matrix back. | check and apply have no pm/state/matrix-proposals.json or no matrix. undo has no backup in pm/.backup/. |
nosy page-adopt adopt|refresh|undo | Keeps a page you built by hand current. adopt lists its tables and the Nosy data that fits each; adopt --apply --yes marks them after a backup. refresh rewrites only the marked tables. undo restores the backup. | pm/sources.json is missing; there is no page (--page, else pm/page.html); adopt --apply without --yes; refresh on a page with no marked table; undo with no backup, or with a page you changed by hand since the backup (add --force to restore anyway). |
nosy rivals-import [--from folder] [--dry-run] | Copies rival research kept outside pm/rivals (rivalsPath in sources.json, or --from) into pm/rivals. The originals stay, and an existing rival file is never overwritten. | The folder to copy from does not exist. A folder with no rival files returns 0 and says so. |
nosy doctor --fix --dry-run · nosy doctor --undo | --fix --dry-run lists what --fix would change and writes nothing. --fix copies what it rewrites to pm/.backup/doctor-<stamp>/ first. --undo puts it back and leaves alone a file you changed since, unless you add --force. | --undo has no backup under pm/.backup/, or there is no pm/ folder. It exits 2, not 1, when a file changed since the fix and was left alone. |
nosy publish --token-file <path> | Reads your Cloud token from a file instead of the command line. Without the flag, NOSY_CLOUD_TOKEN is used, else the file named by NOSY_CLOUD_TOKEN_FILE, else ~/.config/nosy/token. A file other users can read is refused and nothing is sent. After the send it prints what the dashboard says it drew. | No target, no token, a refused token file, a privacy finding, a refusal by Cloud, a send that arrived but whose matrix the dashboard did not draw, or (also in a dry run) a bad address or an oversize file. |
node <skill>/tools/measure-size.mjs --force-fetch | The size step of canwe no longer fills a partial clone: it reads name-only history and says lines were not counted. This flag, which you run yourself because canwe does not pass it, restores the old behaviour: git downloads the missing files from your remote. | It is not a nosy command and is not in the contract table. |
Terminal commands new in 0.20.0
Three new commands. Each says what it does and when it exits 1 (it could not run) or 2 (it ran and found something).
nosy roadmap [--check | --pr --yes] [--lang <code>]
- With no flag: prints the Now / Next / Later block and writes pm/state/roadmap.md and pm/state/roadmap.json. Nothing leaves your machine.
- --check: says whether ROADMAP.md on your integration branch is current.
- --pr --yes: works in a throwaway worktree off origin/<integration branch>, edits only the block between <!-- nosy:roadmap --> and <!-- /nosy:roadmap -->, and opens a pull request with gh.
- An open Nosy roadmap PR (head branch nosy/roadmap-*) is updated, not duplicated: it prints “Updated <url>”. If the block is already on the base branch and an old PR is still open, it says that PR is now empty and leaves closing it to you.
- Without an origin remote it says so, and the preview stays in pm/state/roadmap.md.
- --lang <code>, else language in sources.json, else English. An unknown language is English, with one line on stderr.
Exits 1: No waves and nothing curated (run scoop first). No origin remote. --pr without --yes. A PR step that failed. gh could not list the open PRs (nothing is pushed). Exits 2: The privacy scan found something in a title. Or --check found ROADMAP.md behind, or with no block yet. A result, not a failure. An open Nosy PR that was updated or found empty is a 0, and so is a GitHub source that could not be read: that is a message on stderr, and the block is built from the evidence alone.
nosy rival-signals [run | init | note | notes]
- run: reads public counters, one request per address, for every rival that has a signals block in sources.json. GitHub stars, forks, releases and commits (through your gh), npm weekly downloads, the App Store rating and count, and open roles from the public Greenhouse, Lever and Ashby job-board APIs (or the JSON-LD of one careers page you name).
- Each number is saved with its change since four weeks ago in pm/state/rival-signals.json. The first run says “first reading”.
- init: proposes what to watch from your rival files and writes nothing.
- note <slug> "<text>" --source <url>: keeps your own observation, such as a founder’s public post or a funding announcement. A source link is required. Notes stay on your machine and are never published. notes lists them.
- Nothing is read from LinkedIn or any logged-in site.
Exits 1: run or init with nothing configured. A note that was refused (for example, with no source link). Exits 2: Something could not be read. The output names it, and the rest still prints. A result, not a failure.
nosy ship-notes [--since <tag|date>] [--days N] [--json <file>] [--yes]
- Finds the merged PRs since your latest release (or --since, or --days) and the issues each one closes, from GitHub’s own closing links.
- With no flag it previews one fixed comment per issue (“Shipped in #N (vX). Thanks for asking for this.”) and posts nothing.
- It skips issues opened by the PR’s author, bots or your team, locked issues, and issues Nosy already told.
- --yes: posts them one at a time and records what it posted in pm/state/ship-notes.json. It never comments on a PR and never closes, labels or edits anything.
Exits 1: With --yes, the first comment that failed: it stops there and says how many were posted. The preview is a 0. Nothing is written outside pm/ without --yes. Exits 2: It never returns 2.
nosy handoff [<#> | --item <text>] [--to <login>] [--agent [copilot]] [--project <n>] [--horizon Now|Next|Later] [--area <no|name>] [--body-file <file>] [--yes]
- With no number it lists your psst items, each with a suggested owner (who wrote most of the recent commits on its evidence file) and what became of it. With a number it previews: the issue, who is assigned, the card and its fields, and who can read the issue. Nothing is written.
- --yes: opens the issue (or edits the one the item already is), assigns, and adds the card with its Status, Horizon, Signal, Asked for and, with --area, Area and Rivals with it. --agent is the free label path; --agent copilot assigns GitHub’s paid Copilot agent.
- --setup-board [--yes]: previews, then creates the project (linked to your repo) and the fields your board lacks. --review: reads back what became of what you handed off and proposes the matrix cell and a ship-notes run; it writes nothing.
Exits 1: With --yes, the first step that failed: it stops there and says what was already written. The list, the preview and --review are a 0. Exits 2: 2: the privacy scan found something in the issue text; nothing was written.
nosy rivals-week
- Builds the page’s “Rivals this week” box from pm/state/rivals-this-week.json, never typed into the HTML. Every line needs a source address, a day and a rival; a line without them is left out and said so.
Exits 1: Without pm/state/rivals-this-week.json, or if it isn’t valid JSON, it can’t run. It is 0 when every line is sourced and dated. Exits 2: 2: some lines were left out (no source address, no day, no rival).
nosy sweep-check
- Checks every rival the sweep could read against its file: a rival whose own release page has something newer than its file may not be called “nothing new”.
Exits 1: Without pm/state/rival-sweep.json (run nosy sweep first), it can’t run. It is 0 when every rival agrees with its file. Exits 2: 2: at least one rival is behind: its newest swept entry is later than its file’s “Latest major announcement”.
nosy universe
- Lists every rival found, researched or not, and says when the search may stop: two searches in a row that add nothing, or you say stop.
Exits 1: Without pm/state/rival-universe.json it can’t run. It is 0 when the search may stop. Exits 2: 2: not finished, or the file has problems (each is listed).
nosy history [30d|90d]
- Reads the repository’s past before Nosy arrived, locally, into pm/state/history.json and history.md. A missing gh is a note in the file, not a failure.
Exits 1: Without sources.json, outside a git repository, or with a bad --days, it can’t run. Otherwise it is 0. Exits 2: It never returns 2.
nosy board-status [--days N] [--status on-track|at-risk|off-track|inactive|complete] [--yes]
- Builds the week from your board and merged PRs and releases: what shipped, the board’s own counts, the next three. Titles and counts only. The preview posts nothing.
- --yes: posts it as a status update on the project board named in roadmap.project, once per ISO week. There is no status unless you pass --status: it is your judgment.
Exits 1: With --yes, a missing project scope or a failed read or post: nothing was posted. The preview is a 0. Exits 2: 2: the privacy scan found something in the text; nothing was posted.
nosy notify adds a quiet digest when the files exist: up to three rivals whose public numbers moved, and one roadmap line. Nothing is added when nothing moved. nosy publish also sends pm/state/roadmap.json and pm/state/rival-signals.json when you made them, and never your rival notes: what, exactly.
Exit codes
| Code | Means |
|---|---|
0 | It ran, and nothing needs attention. |
2 | It ran, and found something that needs a look: a never rule matched, a bet was reverted or is overdue, a secret or personal data in something about to be sent. |
1 | It could not run: a usage error, no pm/sources.json, a git or gh failure. |
A 2 is a result, not a failure: the output says what was found. publish and notify treat any non-zero code from the privacy scan as “stop”. Reports such as shipped, peek, psst, canwe and page return 0 when they ran and 1 when they could not. The commands that can return 2, and when, are listed in CLI-CONTRACT.md.
In CI
The GitHub Action never fails its weekly step on its own: a 2 becomes a notice, a 1 a warning. To make a check gate a workflow, run it directly, from a checkout or a copy of Nosy. In a CI shell any non-zero code fails the step:
$ node skill/tools/never-check.mjs pm --base origin/mainTo fail on a finding only and let “could not run” pass:
$ node skill/tools/never-check.mjs pm --base origin/main; test $? -ne 2