CLI for Agents
CLIs that agents can drive reliably. Most human-oriented CLIs block agents with interactive prompts, missing examples, and ambiguous errors.
Do NOT use when
- Building web UIs or non-CLI tools
- The CLI already follows these patterns and needs no review
Checklist
Design or review against these rules. Record violations as ck_finding (rule cli.agent_unfriendly).
- Non-interactive first: Every input as a flag. Interactive is fallback, not default.
- Layered help:
--helpper subcommand, not full manual dump. - Examples on every
--help: Real copy-pasteable invocations. - stdin/pipelines: Accept stdin where sensible, support chaining.
- Actionable errors: Missing flag → correct example invocation, not a hang.
- Idempotency: Same command twice = safe (no-op or "already done").
- Destructive actions:
--dry-runto preview,--yes/--forceto skip confirmations. - Predictable structure:
resource verbpattern consistent across all subcommands. - Machine-readable output: IDs, URLs, durations on success — not just "done".
Output
- CLI design with flags, examples, error messages
- Or: review findings for existing CLI
ck_findingrecords for agent-unfriendly patterns