Four open conventions that make any CLI fully agent-first: learnable, drivable, reportable, and self-updating. Adopt any subset in 30 minutes per spec.
An agent lands on a fresh machine with only the binary. Four commands, four specs.
Each is independently adoptable. Together they make a CLI fully agent-first.
The output contract. stdout = data only (JSON, parseable, versioned). stderr = context only (progress, logs). Semantic exit codes (80–119). Typed errors with recoverable and suggestions. help-json introspection. No internal retries.
The embedded mental model. <tool> guide bakes the full operator manual into the binary — the model, the loop, the concepts, the gotchas. An agent reads it once and drives the tool with no external docs. Optional HTTP: GET /guide + GET /llms.txt.
The dual-write relay. <tool> feedback sends feedback to the tool's own endpoint AND a central relay — same idempotency key, never fails the caller. Open submission, admin-gated reads. FEEDBACK_RELAY=off to opt out.
Content-hash self-update. <tool> update downloads, verifies sha256[:12], smoke-tests, atomically swaps (current → .bak, new → in place). Passive stderr nudge when stale. No silent auto-update — manual by default.
Same contract, two languages, five tools. Each is a worked example.
| Tool | Language | output | guide | feedback | update | |
|---|---|---|---|---|---|---|
| grepapi | machin + shell | ✓ | ✓ | ✓ | ✓ | |
| mago | Go | ✓ | ✓ | — | #10003;✓ | |
| automaintainer | Go | ✓ | ✓ | — | #10003;✓ | |
| remotecmd | Go | ✓ | ✓ | ✓ | — | #10003;|
| chatsnip | machin | ✓ | ✓ | ✓ | — | #10003;
The old Unix philosophy, tightened for LLMs.
One command, one endpoint, one JSON shape. Addable in 30 minutes.
The contract is the JSON shape and the behavior, not the implementation.
Each spec is adoptable alone. No cross-dependencies.
JSON by default, stderr for context, semantic exit codes, self-describing.
stdout is a pipe-friendly API. stderr is ignorable context. Exit codes are actionable.
Copy them, fork them, adopt them. No attribution required.