cli-tools
Skill1 starsChanged 11 days agoMITView on GitHub
Build production-grade CLI tools with argument parsing, exit codes, colored output, progress, and error handling. Triggers: CLI, terminal, shell script. Do NOT use for GUI applications.
- Reads credentials
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
Use a standard parser: Never parse argv manually.
- Distinctive: line 74
Never exit 0 on failure: Every error path returns a non-zero code.
- Very specific: line 84
Piped output must be clean: When stdout is piped, strip colors and progress indicators automatically.
- Very specific: line 89
Use libraries: cli-spinners (Node), rich.progress (Python), indicatif (Rust)
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLI Tools
A CLI without standards is a script no one wants to run.
This skill covers the patterns that separate professional CLI tools from ad-hoc scripts: predictable argument parsing, meaningful exit codes, colored output, progress indication, and proper error handling.
When to Use
MANDATORY when:
- Building a new CLI tool or command
- Adding a CLI interface to an existing project or service
- Refactoring ad-hoc scripts into a proper CLI (argument parsing, exit codes, composability)
- Creating developer tooling: scaffolds, code generators, linters, formatters, migration tools
- Building a multi-command tool (git-style subcommands:
tool <noun> <verb>) - Implementing automation that needs reliable exit codes and piped output (CI/CD, scripts)
User says: "build a CLI", "terminal app", "command line tool", "make a tool that...", "create a command"
When NOT to Use
- GUI applications (desktop, web, mobile)
- Simple one-off shell scripts (use a shell script directly)
- Full-screen TUI applications (emacs, vim-style interactive interfaces)
Output Contract
| Artifact | Format | Location | Quality Criteria |
| CLI tool source code | CLI executable (language-agnostic, framework-independent) | src/cli/ or project root | Standard argument parser used, exit codes (0=success, non-zero=error), stdout for data + stderr for logs/errors, --help + --version flags, --quiet suppresses non-essential output, colors auto-suppressed when non-TTY (isatty), NO_COLOR env var respected, --json flag for machine-readable output, config file at ~/.config/<tool>/ with --config override, SIGINT handler for clean shutdown, -- separates options from positional args |
Core Principles
1. Argument Parsing
Use a standard parser. Never parse argv manually.
| Language | Library |
| Node.js | commander, yargs, clack |
| Python | click, typer, argparse |
| Rust | clap, structopt |
| Go | cobra, urfave/cli |
| Bash | getopt (long options), argbash |
Convention:
- Flags before arguments (
tool --verbose build) --separates options from positional args-h/--helpshows usage-v/--version(unless-vis verbose)
2. Exit Codes
0 — Success
1 — General error
2 — Misuse (invalid args, wrong usage)
127 — Command not found
130 — Interrupted (Ctrl+C)Never exit 0 on failure. Every error path returns a non-zero code.
3. Output Channels
| Stream | When |
stdout | Command output (data, results, lists) |
stderr | Logs, warnings, errors, progress |
/dev/null | Hide when --quiet is set |
Piped output must be clean. When stdout is piped, strip colors and progress indicators automatically. Detect with: !isatty(sys.stdout).
4. Progress Indication
- Tasks > 2s: show a spinner or progress bar
- Use libraries:
cli-spinners(Node),rich.progress(Python),indicatif(Rust) - Suppress when non-TTY or
--quiet
5. Error Messages
❌ Error: File not found: /path/to/missing
Hint: Check the path and try again. Use --help for options.Format: [context] Error: [what happened] then optional hint on next line.
6. Configuration
~/.config/<tool>/config.{json,yaml,toml}for user config--config <path>to override.envin project root for env varsCLI_TOOL_*env vars with clear prefix
Language-Specific Patterns
→ See guides/LANGUAGE-GUIDE.md for code examples in Node.js (commander/clack), Python (click), Rust (clap), and Go (cobra).
Anti-Patterns
→ See guides/ANTI-SLOP-GUIDE.md for CLI-specific anti-patterns and best practices.
Verification
- Uses standard argument parser
--helpand--versionwork- Exit codes: 0 = success, non-zero = error
- Errors go to stderr, results to stdout
- Colors suppressed when non-TTY
--quietsilences non-essential output- Config file with
--configoverride - README with install + usage + examples
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- dragnoir/Shopify-agent-skills★ 48same name
- YepAPI/skills★ 8same name
- niksavis/basicly★ 2same 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.
- AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- adapt-skillSkill
- api-and-interface-designSkill
- architecture-analysisSkill
- audit-skillSkill
- backend-api-masterySkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- clarify-skillSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- critique-skillSkill
- customize-opencodeSkill
- debugging-and-error-recoverySkill
- debugging-three-strikesSkill
- delight-skillSkill
- deprecation-and-migrationSkill
- dev-environment-auditSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- engineering-fundamentalsSkill
- frontend-desktopSkill
- frontend-mobileSkill
- frontend-pwaSkill
- frontend-ui-engineeringSkill
- frontend-webSkill
- fullstack-shippingSkill
- gateSkill
- git-init-and-versioningSkill
- git-workflow-and-versioningSkill
- hard-skillSkill
- idea-refineSkill
- incremental-implementationSkill
- industrial-brutalist-uiSkill
- interview-meSkill
- minimalist-uiSkill
- multi-agent-orchestrationSkill
- observability-and-instrumentationSkill
- optimize-skillSkill
- output-skillSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- polish-skillSkill
- project-health-checkSkill
- project-metricsSkill
- redesign-skillSkill
- security-and-hardeningSkill
- self-improvementSkill
- shipping-and-launchSkill
- skill-creatorSkill
- skill-improverSkill
- soft-premium-uiSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- typeset-skillSkill
- user-onboardingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

