/cli-for-agent:cli-for-agentsfrom cli-for-agent
Designs or reviews CLIs so coding agents can run them reliably: non-interactive flags, scoped --help with examples, stdin and pipelines, stable output, actionable errors, idempotency, dry runs, and predictable structure. Use when building a CLI, adding commands, writing --help, or reviewing terminal and automation workflows.
Ships in cli-for-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Design the command interface as a contract that a person, a CI runner, and a coding agent can use without guessing. Prefer a small, explicit, headless interface over a clever interactive flow.
Before changing implementation, identify the command's inputs, effects, outputs, failure modes, and whether it mutates anything. Keep the surface narrow and fit it to the existing CLI's conventions.
resource list, keep that order for comparable resources.The default execution path must work without a TTY. Interactive prompts may be a convenience after all required values are supplied non-interactively; they must never be the only way to complete an operation.
Bad: mycli deploy
? Which environment? (use arrow keys)
Good: mycli deploy --environment staging
--non-interactive or --no-input mode that refuses every prompt, pager, browser launch, and credential dialog even when a TTY exists.--yes only to bypass a documented confirmation. It must not invent missing values or act as a synonym for --force.Agents normally inspect mycli, then mycli deploy --help. Keep help local to the command rather than printing the full manual at every level.
Every command and subcommand should support --help. Include valid, copy-pasteable examples that cover the normal path and any consequential option. Support a fast, side-effect-free --version when the installed version can affect behavior or output.
Usage:
mycli deploy --environment <name> --tag <tag>
Options:
--environment <name> Target environment (staging, production)
--tag <tag> Image tag to deploy
--yes Skip the confirmation prompt
Examples:
mycli deploy --environment staging --tag v1.2.3
mycli deploy --environment production --tag v1.2.3 --yes
--input - or --stdin). Do not silently read stdin when a terminal user expects a prompt.mycli build --output tag | mycli deploy --tag - should not need temporary interactive state.-- as an end-of-options delimiter. For every relevant argument, document whether - means a standard stream or a literal filename.--*-stdin path and document its permissions and precedence.next_cursor value, invalid-cursor recovery, and whether traversal is snapshot-consistent or best-effort. Numeric pages are acceptable only when that limitation is explicit.Success output should carry the information needed for the next command: identifiers, paths, URLs, state, and duration. Decorative output alone is not enough.
deployed v1.2.3 to staging
url: https://staging.example.com
deploy_id: dep_abc123
duration: 34s
--output json and document fields, types, nullability, ordering, and compatibility rules.--no-color when color is otherwise enabled.Errors must name the bad input or failed dependency, state what the command did not do, and show the next valid command when one exists.
Error: no image tag was supplied; nothing was deployed.
Try: mycli deploy --environment staging --tag <image-tag>
List tags: mycli build list --output tags
Do not hide an error behind a retry loop, a hanging prompt, or a generic "failed" message. Redact secrets before rendering normal, debug, dry-run, JSON, or recovery output; never dump credential-bearing headers, environment values, connection strings, or raw request bodies by default.
Coding agents retry commands. A successful retry should be a clear no-op or report the existing result, not create a duplicate side effect.
--all, broad selectors, and named targets mutually exclusive when combining them would be unsafe.--dry-run to consequential mutations. It should run the same validation, target resolution, authorization, and cascade planning as the real command, then make zero writes.--ignore-not-found behavior an explicit opt-in so it cannot hide a wrong target.For commands that call remote services or submit background jobs, make waiting behavior bounded and observable.
--wait or --no-wait where appropriate. Emit the operation ID and state; zero then means successful submission, while a waiting command returns zero only after its documented terminal success state.When reviewing an existing CLI, check the actual commands and help text where possible. Report concrete findings with the affected command, the agent failure mode, and the smallest safe fix.
--help is scoped, complete, and includes real examples.--help exits zero without mutation.For an implementation task, make the smallest compatible change, update relevant help and examples, and run the narrowest real commands or tests that prove the contract.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mylesmcook/mcook-plugins --plugin cli-for-agent