create-cli
Skill2 starsChanged 4 months agoMITView on GitHub
Build command-line interfaces for AI agents. Use when building a new CLI or refactoring an existing one for agent use.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- antoniolg/agent-kittheir own version, first seen Nov 8, 2026
- davisbuilds/dojotheir own version, first seen Nov 1, 2026
- steipete/agent-scriptstheir own version, first seen Oct 20, 2026
- sublimecoder/aiostheir own version, first seen Sep 18, 2026
- jakenuts/agent-skillstheir own version, first seen Jul 14, 2026
- pavelsimo/skillstheir own version, first seen Jul 7, 2026
Used with
Projects with it also use markdown-converter, frontend-design and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
bongartzdiazSkillmarkdown-converter
Convert documents and files to Markdown using markitdown. Use when converting PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, CSV, JSON, XML, images (with EXIF/OCR), audio (with transcription), ZIP archives, YouTube URLs, or EPubs to Markdown format for LLM processing or text analysis.
Also in 3 projects that use this
BlockSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- steipete/agent-scripts★ 7.4ksame name
- antoniolg/agent-kit★ 100same name
- magnusrodseth/dotfiles★ 3same name
- jakenuts/agent-skills★ 2same name
- sublimecoder/aios★ 2same name
- tunnckoCore/skills★ 2same name
- pavelsimo/skills★ 1same name
- davisbuilds/dojo★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- claude-mdSkill
- commit-pushSkill
- debug-agentSkill
- domain-modelingSkill
- grillingSkill
- grill-with-docsSkill
- handoffSkill
- helpSkill
- prototypeSkill
- review-structureSkill
- schedule-tasksSkill
- skill-masterSkill
- wayfinderSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 10 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
If required input is missing, fail immediately with an actionable error—don't prompt
- Very specific: line 45
Every --help includes Examples (agents pattern-match faster than reading prose)
- Very specific: line 62
Prefer --json for structured input—agents generate it directly with zero translation loss.
- Very specific: line 86
Add -q/--quiet when useful.
- Distinctive: line 113
No duplicate side effects.
- Very specific: line 120
Avoid ambiguous pairs (update vs upgrade, remove vs delete) unless sharply differentiated
- Distinctive: line 171
Don't hang. Give agents something to self-correct with.
- Distinctive: line 188
When errors are recoverable (missing files, missing directories, stale cache), fix them and continue.
- Distinctive: line 190
Document magic numbers: If a constant exists, explain why:
- Distinctive: line 202
If you don't know the right value, the agent won't either.
- Distinctive: line 218
Avoid odd positional ordering that breaks piping
- Very specific: line 223
If requirements aren't already clear from context, ask these questions using AskUserQuestion/request_user_input:
- Distinctive: line 245
After implementation, test the CLI before reporting done.
- Distinctive: line 249
Primary use case works: - Run the main workflow the CLI was built for.
- Very specific: line 251
Help is useful: - Check that --help shows usage, flags, and examples.
- Distinctive: line 263
Input validation: - If the CLI accepts paths, IDs, or user-provided strings, test that malformed inputs (traversal paths, control chars, …
- Very specific: line 267
Dry-run works: - If --dry-run is supported, verify it shows what would happen without making changes.
- Very specific: line 273
Shell script (bash): Default. Prefer long options (--env, --force) over short (-e, -f).
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create CLI
Build CLIs for AI agents. Assume 100% agent usage.
Default Assumptions
- Language: Shell script (bash) by default. Use Python (uv + typer) or TypeScript (bun + commander) only when:
- SDK works better in that language
- Requires specific packages (e.g., data analysis → Python)
- User explicitly requests it
- Non-interactive: Agents cannot respond to prompts—commands just hang
- Parseable output: JSON for machine consumption; human-readable as fallback
Core Principles
1. Non-interactive first
Agents cannot answer prompts. Every input must be expressible as a flag.
# Bad: hangs the agent
mycli deploy
? Which environment? (use arrow keys)
# Good: works
mycli deploy --env staging- Gate confirmations behind
--yesor--forceflags - If required input is missing, fail immediately with an actionable error—don't prompt
- For optional human interactivity, gate behind
--interactiveflag
2. Layered discovery
Agents discover incrementally: mycli → mycli deploy --help. Don't dump all docs upfront.
- Each subcommand has its own
--help - Every
--helpincludes Examples (agents pattern-match faster than reading prose) - Suggest next commands in output when helpful
Options:
--env Target environment (staging, production)
--tag Image tag (default: latest)
--force Skip confirmation
Examples:
mycli deploy --env staging
mycli deploy --env production --tag v1.2.3
mycli deploy --env staging --force3. JSON input for complex data
Prefer --json for structured input—agents generate it directly with zero translation loss.
# Accept full JSON payload
mycli create --json '{"title": "Doc", "locale": "en_US", "gridProperties": {"frozenRowCount": 1}}'
# Also accept JSON from stdin
cat config.json | mycli create --stdinJSON maps directly to API schemas. No need to flatten nested structures into flags.
4. Parseable output
- Provide
--jsonfor structured output; human-readable text as default - On success, return machine-useful data: IDs, URLs, durations, state changes
deployed v1.2.3 to staging
url: https://staging.myapp.com
deploy_id: dep_abc123
duration: 34s- Add
-q/--quietwhen useful; keep success output brief but informative
5. Input hardening against hallucinations
Agents don't typo like humans—they hallucinate. Validate defensively:
| Threat | Example | Defense |
| Path traversal | ../../.ssh | Canonicalize and sandbox to CWD |
| Control characters | Invisible chars below ASCII 0x20 | Reject them |
| Embedded query params | fileId?fields=name | Reject ? and # in IDs |
| Pre-encoded URLs | %2e%2e for .. | Reject % in resource IDs |
"The agent is not a trusted operator. Build like it."
6. Idempotency
Agents retry constantly. The same successful command run twice should be safe:
$ mycli deploy --env staging --tag v1.2.3
✓ Deployed v1.2.3 to staging
$ mycli deploy --env staging --tag v1.2.3
✓ Already deployed, no-opNo duplicate side effects. Design for crash-only recovery when feasible.
7. Predictable structure
Be consistent across subcommands:
- Reuse verbs: if you have
listsomewhere, uselisteverywhere (notshoworget) - Avoid ambiguous pairs (
updatevsupgrade,removevsdelete) unless sharply differentiated - Share global flags/config/help across subcommands
For complex CLIs managing multiple resource types (like Docker, kubectl), see references/multi-resource-clis.md.
8. Destructive actions
Preview before committing. Require explicit confirmation flags.
# Preview what would happen
$ mycli delete --env production --dry-run
Would delete 3 instances in production
- instance-a
- instance-b
- instance-c
No changes made.
# Execute with confirmation
$ mycli delete --env production --force
✓ Deleted 3 instances--dry-runvalidates without executing--forceor--yesbypasses confirmation (required for destructive ops)
9. Schema introspection (for API-backed CLIs)
Let agents self-serve without static docs baked into prompts:
$ mycli schema drive.files.list
{
"params": {"fields": "string", "pageSize": "integer"},
"scopes": ["drive.readonly"],
...
}The CLI becomes the canonical source of truth for what the API accepts right now.
10. Fail fast with actionable errors
On missing required flags, exit immediately with a clear message and correct invocation:
Error: No image tag specified.
mycli deploy --env staging --tag <image-tag>
Available tags: mycli build list --output tagsDon't hang. Give agents something to self-correct with.
11. Solve, don't punt
Handle recoverable errors in the CLI rather than failing and forcing the agent to figure it out.
# Good: CLI handles the missing file
$ mycli process data.json
File data.json not found, creating with defaults...
✓ Created data.json
# Bad: CLI fails, agent must diagnose and retry
$ mycli process data.json
Error: No such file or directory: data.jsonWhen errors are recoverable (missing files, missing directories, stale cache), fix them and continue. Only fail when there's no reasonable recovery path.
Document magic numbers. If a constant exists, explain why:
# Good: self-documenting
TIMEOUT=30 # HTTP requests typically complete within 30s
RETRIES=3 # Most intermittent failures resolve by second retry
# Bad: voodoo constants
TIMEOUT=47 # Why 47?
RETRIES=5 # Why 5?If you don't know the right value, the agent won't either.
12. Stdin and pipelines
Agents think in pipelines. Accept stdin and support chaining.
# Pipe data between commands
cat config.json | mycli validate --stdin
mycli list --json | mycli process --stdin
# Chain with other tools
mycli export --json | jq '.items[]' | mycli import --stdin- Accept
--stdinor-for input where it makes sense - Avoid odd positional ordering that breaks piping
- Output should be pipeable (clean stdout, errors to stderr)
Interview (only if not already done)
If requirements aren't already clear from context, ask these questions using AskUserQuestion/request_user_input:
- Command name + purpose: What's the CLI called and what does it do?
- Input sources: Args only, or also stdin/files? Any secrets? (remind: never via flags—use stdin or
--password-file) - Output needs: Does output need to be piped? (if yes, add
--json) - Subcommands: Single command or multiple subcommands?
- Complexity check: Does it need external SDKs/packages? (if yes, ask Python or TypeScript)
Proceed with sensible defaults for unanswered questions.
Default Conventions
-h/--helpalways shows help and ignores other args--versionprints version to stdout- Primary data to stdout; diagnostics/errors to stderr
--jsonfor machine output; consider--plainfor stable line-based text- Support
-for stdin/stdout when input/output is a file - Respect
NO_COLOR,TERM=dumb; provide--no-color - Handle Ctrl-C: exit fast, bounded cleanup, crash-only when possible
Testing the CLI
After implementation, test the CLI before reporting done. Don't just check that it runs—verify it behaves correctly for agents.
Required tests:
- Primary use case works - Run the main workflow the CLI was built for. Verify output matches expectations.
- Help is useful - Check that
--helpshows usage, flags, and examples. Subcommands should have their own help. - Non-interactive - Pipe empty input or run without a TTY. The CLI must not hang waiting for prompts. Missing required args should fail fast with an actionable error.
- Exit codes are correct - Success returns 0. Invalid usage returns non-zero. Check a few failure cases.
- JSON output parses (if
--jsonsupported) - Pipe output throughjqor equivalent to verify it's valid JSON with expected fields. - Errors go to stderr - Redirect stdout to
/dev/nulland trigger an error. The error message should still appear (via stderr).
If applicable:
- Input validation - If the CLI accepts paths, IDs, or user-provided strings, test that malformed inputs (traversal paths, control chars, embedded params) are rejected.
- Idempotency - For state-changing commands, run the same command twice. Second run should be safe (no-op or "already exists").
- Dry-run works - If
--dry-runis supported, verify it shows what would happen without making changes.
Fix any failures before considering the CLI complete.
Language Notes
- Shell script (bash): Default. Prefer long options (--env, --force) over short (-e, -f).
- Python: uv + typer. Choose when SDK is Python or needs data processing.
- TypeScript: bun + commander. Choose when SDK is JS/TS.
References
references/cli-guidelines.md- Extended philosophy, edge cases (man pages, distribution, analytics), full rationale behind the core principlesreferences/context-window-discipline.md- Field masks, NDJSON streaming, output limiting for CLIs that return large resultsreferences/auth-for-agents.md- Env vars for tokens, service accounts, headless auth patternsreferences/response-sanitization.md- Protecting against prompt injection in API responsesreferences/multi-resource-clis.md- Noun-verb pattern for complex CLIs managing multiple resource types (like Docker, kubectl)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

