cli-for-agents/SKILL.md
Design or review CLIs so both coding agents and humans can use them reliably: dual-audience output, non-interactive paths, layered help, machine-readable data, predictable flags, safe mutations, and actionable errors. Use when building a CLI, adding commands, writing --help, or when the user mentions agents, terminals, automation-friendly CLIs, JSON output, or headless usage.
npx skillsauth add ingpoc/skills cli-for-agentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build CLIs as one engine with two renderers:
Do not maintain separate doctrine for the two audiences. Keep one command model and one source of truth, then render it differently.
--json for bounded results and --ndjson for streams or watch modes.Examples:
# Human
mycli watch --task abc123
# Agent
mycli watch --task abc123 --ndjson --no-tui
--json as the stable contract for agents, scripts, and tests.--json--full, --verbose, or --raw for large payloads.Bad:
mycli list
# dumps every row and every field
Good:
mycli list
# top items only, scoped fields only
mycli list --full
# full payload
Prefer graduated retrieval over one-shot dumps:
list or search for routingsummary for bounded orientationshow --section <name> for targeted expansionshow --full only by explicit opt-instatusquerycountresultsschema_versionnext_step when it makes the cheapest follow-up obviousmatched_on or resolved_from so agents know whether they are operating on an exact ID or a search-resolved target.If a CLI owns rich documents, logs, or traces, build commands around:
summary -> section -> full
This is better for both humans and agents than dumping the entire surface by default.
start here.Example layout:
Task Management:
send Send a message to start or continue a task (start here)
watch Subscribe to live updates for a running task
get Retrieve the current state of a task
Discovery:
describe Inspect identity, skills, and capabilities
For repeated external-service, archive, or admin workflows, aim for:
doctor Verify setup, auth, version, and reachability
discover Find top-level resources or containers
resolve Turn names, URLs, or slugs into stable IDs
read Fetch exact objects or bounded lists
write Perform one named mutation with preview or dry-run support
request Raw escape hatch
If the CLI returns knowledge-like records, every item should have:
doctor is first-classdoctor or equivalent command.doctor --json should verify config, auth source, version, endpoint reachability, and missing setup.doctor --json should report that explicitly instead of failing ambiguously.tool-name --json doctor first without reading docs.NO_COLOR and [APP]_NO_TUI environment variables.--json on everything that returns data--json.--ndjson for streaming or watch commands.- as stdin where appropriate.Examples:
mycli search "stalled tasks" --json | mycli rerank --stdin
mycli build --json | mycli deploy --spec-json -
summary or read auto-resolve obvious first-try matches and expose the resolution mode in machine output.--dry-run.--yes or --force.already done beats duplicate side effects.0 success1 general failure2 invalid usage3 auth or connectivity failureExample:
Error: database not initialized
Hint: run 'mycli init' to create the local database
Example:
deployed v1.2.3 to staging
url: https://staging.myapp.com
deploy_id: dep_abc123
duration: 34s
--env local|staging|prod.These are the highest-value behaviors to enforce in code, not just document:
--json:
--full or --verbose for expansion--json schema per command--yes or --force for dangerous actions--dry-run for previewable mutationsHint: line with the exact next command when recovery is obviousThese should be enforced through tests, quality gates, or CI:
--json output on agent-consumed commands--json--fulldoctor --json setup and auth reportingdiscover -> resolve -> read flows using stable IDsHint: guidanceIf drift keeps recurring, add a gate instead of repeating cleanup.
--json or --ndjson exists where neededsummary -> section -> full exists where the CLI exposes large documents or traces--json is treated as the stable contractdoctor --json exists for durable CLIs--dry-run--yes or --forceCheck:
If the CLI is meant for repeated use across threads, pair it with a companion skill that records:
doctor, discover, or summaryThe CLI is the executable surface. The companion skill is the routing memory for future agents.
devops
Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.
tools
Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script. Use when the user wants Codex to create a command-line tool that can run from any repo, expose composable read/write commands, return stable JSON, manage auth, and pair with a companion skill.
development
Use when configuring apps to use z.ai GLM 4.7 proxy instead of standard Anthropic API. Works with any frontend (Next.js, Vite) or backend (Python, Node.js) framework.
testing
Allows you to view the user's screen as well as several hours of history. Use when the user makes a reference to their recent work, for which it'd be helpful to see the screen. This skill MUST be used whenever you need to resolve ambiguity in a user request, where the user hasn't specified enough context to do the task. Examples include disambiguating the specific user/app/document/error the user is referring to. You must also use this skill if the user asks about any question regarding Chronicle or asks what you can see from the screen.