en un clic
cli-building
Build command-line interfaces with async-first design, composable commands, and proper output formatting. Use when creating CLI tools, commands, or interactive terminal applications.
Menu
Build command-line interfaces with async-first design, composable commands, and proper output formatting. Use when creating CLI tools, commands, or interactive terminal applications.
| name | cli-building |
| description | Build command-line interfaces with async-first design, composable commands, and proper output formatting. Use when creating CLI tools, commands, or interactive terminal applications. |
Guidelines for building command-line interfaces with modern patterns and best practices.
stricli (@bloomberg/stricli, recommended for modern async-first CLIs):
oclif (alternative):
cyclopts (recommended for async-first):
typer (when fully async support available):
Design commands as reusable modules:
Use strategy pattern for:
NO_COLOR environment variableAll I/O should be async:
Handle async errors properly:
// 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()
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 selectionManage Git commits using conventional commit format with atomic staging. Always generate plain git commands before running them and offer to let the user run them manually.
Create AGENTS.md files for project-specific inline rules. Use when adding small, project-specific instructions that should be committed in repos.
Media processing utilities for images, audio, and video using FFmpeg and ImageMagick. Use when working with media conversion, optimization, or batch processing tasks.
Core software engineering principles for code style, documentation, and development workflow. Applies when editing code, working in software repositories, or performing software development tasks.
Python development guidelines and best practices. Use when working with Python code.
Build robust backend systems with modern technologies (Node.js, Python, Go, Rust), frameworks (NestJS, FastAPI, Django), databases (PostgreSQL, MongoDB, Redis), APIs (REST, GraphQL, gRPC), authentication (OAuth 2.1, JWT), testing strategies, security best practices (OWASP Top 10), performance optimization, scalability patterns (microservices, caching, sharding), DevOps practices (Docker, Kubernetes, CI/CD), and monitoring. Use when designing APIs, implementing authentication, optimizing database queries, setting up CI/CD pipelines, handling security vulnerabilities, building microservices, or developing production-ready backend systems.