cli-development
Skill157 starsChanged 3 months agoMITView on GitHub
CLI tool design, argument parsing, interactive prompts, shell completions, cross-platform considerations, and distribution strategies.
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- fmind/dottheir own version, first seen Oct 5, 2026
- cashew-labs/librettotheir own version, first seen Aug 18, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Jul 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- cashew-labs/libretto★ 904same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- fmind/dot★ 10same 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 repository59 other files it gives its agents.
- github-pages/agents.mdAGENTS.md
- adrSkill
- agent-protocolsSkill
- angular-idiomsSkill
- api-documentationSkill
- axum-idiomsSkill
- browser-automationSkill
- chaos-testingSkill
- ci-cdSkill
- code-auditSkill
- code-reviewSkill
- cpp-idiomsSkill
- csharp-idiomsSkill
- data-engineeringSkill
- debugging-protocolSkill
- django-idiomsSkill
- dotnet-idiomsSkill
- elixir-idiomsSkill
- embedded-systemsSkill
- feature-flagsSkill
- flutter-idiomsSkill
- frontend-designSkill
- git-commit-integritySkill
- go-idiomsSkill
- guardrailsSkill
- hono-idiomsSkill
- incident-responseSkill
- java-idiomsSkill
- javascript-idiomsSkill
- kotlin-idiomsSkill
- laravel-idiomsSkill
- logging-implementationSkill
- ml-engineeringSkill
- mobile-designSkill
- mobile-testingSkill
- nextjs-idiomsSkill
- parallel-dispatchSkill
- payment-integrationSkill
- perf-optimizationSkill
- php-idiomsSkill
- postgres-idiomsSkill
- python-idiomsSkill
- rails-idiomsSkill
- react-idiomsSkill
- refactoring-patternsSkill
- research-methodologySkill
- ruby-idiomsSkill
- rust-idiomsSkill
- security-auditSkill
- sequential-thinkingSkill
- spring-boot-idiomsSkill
- sql-idiomsSkill
- structured-specSkill
- supply-chain-securitySkill
- swift-idiomsSkill
- testability-patternsSkill
- testing-strategySkill
- typescript-idiomsSkill
- vue-idiomsSkill
The file
Files
CLI Development Principles
Guidelines for building fast, intuitive, cross-platform CLI tools.
When to Invoke
- Designing CLI tool architecture
- Implementing command hierarchies and argument parsing
- Adding shell completions and interactive features
- Cross-platform distribution planning
Architecture
Command Hierarchy
app <command> [subcommand] [flags] [args]
app task create --priority high "Deploy fix"
app task list --status active --format jsonDesign Principles
- Startup time < 100ms — lazy-load expensive dependencies.
- Sensible defaults — zero-config for common cases.
- Progressive disclosure — simple interface, advanced flags for power users.
- Machine-readable output —
--format jsonfor scripting. - Exit codes — 0 = success, 1 = error, 2 = usage error.
Argument Parsing Libraries
| Language | Library | Notes |
| Go | cobra + pflag | Most popular, auto-completions |
| Rust | clap (derive) | Type-safe, auto-help |
| Python | click or typer | Decorator-based, typer for type hints |
| Node.js | commander or yargs | Mature, well-documented |
Error Handling
- Helpful error messages — what went wrong, why, how to fix:
Error: config file not found at ~/.myapp/config.yaml Hint: run 'myapp init' to create a default config --verbose/--debugflags for diagnostic output.- Never show stack traces by default — only with
--debug.
Shell Completions
Generate completions for bash, zsh, fish, PowerShell. Most CLI frameworks support this.
# Generate completions
myapp completion bash > /etc/bash_completion.d/myapp
myapp completion zsh > ~/.zsh/completions/_myappCross-Platform
- Path handling — use
filepath.Join(Go),Path(Python), not string concat. - Line endings — handle
\r\non Windows. - Color support — detect terminal capabilities, respect
NO_COLORenv var. - Unicode — test with non-ASCII filenames and input.
Distribution
| Method | Best For |
| Go/Rust binary | Single binary, no runtime dependency |
pip install / npm install -g | Language ecosystem users |
| Homebrew formula | macOS/Linux users |
| Docker image | Containerized environments |
| GitHub Releases | Universal, with checksums |
Testing
For universal testing principles, see
.agents/rules/testing-strategy.md. Below: language-specific patterns only.
- Unit test command logic — separate from CLI framework.
- Integration tests — run actual CLI commands, assert exit codes and output.
- Golden file tests — snapshot expected output for complex commands.
Related
- Command Execution Principles @.agents/rules/command-execution-principles.md
- Error Handling Principles .agents/rules/error-handling-principles.md
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.

