cli-building
Skill22 starsChanged 11 months agoMITView on GitHub
Build command-line interfaces with async-first design, composable commands, and proper output formatting. Use when creating CLI tools, commands, or interactive terminal applications.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- damusix/skillstheir own version, first seen Jun 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- damusix/skills★ 62same 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 repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend-engineerSkill
- code-reviewSkill
- context-engineeringSkill
- create-agents-mdSkill
- create-skillSkill
- cursor-best-practicesSkill
- debuggingSkill
- frontend-engineerSkill
- media-processingSkill
- psiSkill
- pythonSkill
- semantic-gitSkill
- software-engineerSkill
- typescriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 13 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Async-first: All I/O operations should be async/await, avoid blocking operations
- Distinctive: line 22
Strategy pattern: Use strategy pattern for branching workflows or task-based commands
- Distinctive: line 64
Use strategy pattern for:
- Distinctive: line 72
No emojis: Do not use emojis unless explicitly directed
- Distinctive: line 73
Unicode symbols: Use unicode symbols (✓, ✗, →, ⚠) for status indicators
- Distinctive: line 74
Color support: Use color libraries, never hardcoded ANSI codes
- Very specific: line 75
NO_COLOR: Always respect NO_COLOR environment variable
- Distinctive: line 76
Formatting: Use formatting for better readability (bold, dim, etc.)
- Distinctive: line 82
All I/O should be async:
- Distinctive: line 91
Use try/catch with await
- Distinctive: line 135
Async by default: All operations should be async
- Distinctive: line 137
Strategy pattern: Use for workflow branching
- Distinctive: line 140
Type safety: Use TypeScript types or Python type hints
- Distinctive: line 141
Testing: Test commands in isolation
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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 Building
Guidelines for building command-line interfaces with modern patterns and best practices.
When to Use
- Creating new CLI tools or commands
- Building interactive terminal applications
- Adding commands to existing projects
- Implementing command-line interfaces
- Working with CLI frameworks
Core Principles
- Async-first: All I/O operations should be async/await, avoid blocking operations
- Composable commands: Commands should be modular and reusable, use command composition
- Strategy pattern: Use strategy pattern for branching workflows or task-based commands
- Output formatting: Proper formatting with unicode symbols and color support
Framework Selection
TypeScript/JavaScript
stricli (@bloomberg/stricli, recommended for modern async-first CLIs):
- Built for async/await from ground up
- Type-safe command definitions with full type inference
- Lazy loading for startup performance
- Zero dependencies
oclif (alternative):
- Mature framework with extensive features
- Plugin system
- Good for complex CLIs
Python
cyclopts (recommended for async-first):
- Modern async-first CLI framework
- Type-safe with excellent async support
- Clean API design
typer (when fully async support available):
- Based on Python type hints
- Clean and intuitive
- Good for simple to medium complexity CLIs
Command Architecture
Composable Commands
Design commands as reusable modules:
- Shared command utilities
- Command middleware
- Reusable command modules
- Command composition patterns
Strategy Pattern
Use strategy pattern for:
- Workflow branching
- Task-based commands
- Dynamic command routing
- Conditional command execution
Output Formatting
- No emojis: Do not use emojis unless explicitly directed
- Unicode symbols: Use unicode symbols (✓, ✗, →, ⚠) for status indicators
- Color support: Use color libraries, never hardcoded ANSI codes
- NO_COLOR: Always respect
NO_COLORenvironment variable - Formatting: Use formatting for better readability (bold, dim, etc.)
Async Patterns
Async-First Design
All I/O should be async:
- File operations: use async file APIs
- Network requests: use async HTTP clients
- Process execution: use async process APIs
- Database operations: use async database clients
Error Handling
Handle async errors properly:
- Use try/catch with await
- Handle promise rejections
- Provide clear error messages
- Exit with appropriate codes
Command Structure
Basic Command
// stricli example
import { createCli } from '@bloomberg/stricli';
async function myCommand() {
// Async implementation
}
const cli = createCli({
name: 'my-cli',
commands: {
'my-command': myCommand
}
});
cli.run();# cyclopts example
from cyclopts import App
app = App()
@app.default
async def my_command():
# Async implementation
pass
if __name__ == '__main__':
app()Best Practices
- Async by default: All operations should be async
- Composable design: Build reusable command modules
- Strategy pattern: Use for workflow branching
- Proper formatting: Unicode symbols and color with NO_COLOR support
- Error handling: Clear error messages and exit codes
- Type safety: Use TypeScript types or Python type hints
- Testing: Test commands in isolation
References
For detailed guidance, see:
references/async-patterns.md- Async/await best practicesreferences/composable-commands.md- Command composition patternsreferences/strategy-pattern.md- Strategy pattern for workflowsreferences/output-formatting.md- Output formatting guidelinesreferences/frameworks.md- Framework comparisons and selection
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.

