# CLI For Agents

> Design/review CLIs for agent-friendliness: non-interactive flags, layered help, idempotency, dry-run, actionable errors. Trigger: 'agent CLI', 'automation-friendly CLI', 'headless CLI design'.

- Skill: `aryaminus/cli-for-agents` (Agent Skill)
- Install (CLI): `npx skillmds@latest add aryaminus/cli-for-agents`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aryaminus/cli-for-agents/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: Apache-2.0
- Author: aryaminus (https://skillmd.com/u/aryaminus)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/aryaminus/cli-for-agents

---


# 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**: `--help` per 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-run` to preview, `--yes`/`--force` to skip confirmations.
- **Predictable structure**: `resource verb` pattern 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_finding` records for agent-unfriendly patterns

