MCPInstall

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.

Installs
198
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/siviter-xyz/dot-agent --skill cli-building
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads cli-building automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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_COLOR environment 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

  1. Async by default: All operations should be async
  2. Composable design: Build reusable command modules
  3. Strategy pattern: Use for workflow branching
  4. Proper formatting: Unicode symbols and color with NO_COLOR support
  5. Error handling: Clear error messages and exit codes
  6. Type safety: Use TypeScript types or Python type hints
  7. Testing: Test commands in isolation

References

For detailed guidance, see:

  • references/async-patterns.md - Async/await best practices
  • references/composable-commands.md - Command composition patterns
  • references/strategy-pattern.md - Strategy pattern for workflows
  • references/output-formatting.md - Output formatting guidelines
  • references/frameworks.md - Framework comparisons and selection

FAQ

What does the cli-building skill do?

Build command-line interfaces with async-first design, composable commands, and proper output formatting. Use when creating CLI tools, commands, or interactive terminal applications.

How do I install cli-building?

Run npx skills add https://github.com/siviter-xyz/dot-agent --skill cli-building in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cli-building/ (personal) or .claude/skills/cli-building/ (project).

Which AI agents can use cli-building?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is cli-building safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains cli-building?

It is published by siviter-xyz in siviter-xyz/dot-agent. It has 198 recorded installs.

More from siviter-xyz/dot-agent

View all →

create-skill

siviter-xyz/dot-agent

Guide for creating effective skills following best practices. Use when creating or updating skills that extend agent capabilities.

cursor-best-practices

siviter-xyz/dot-agent

Best practices for working with Cursor. Use when learning how to effectively use Cursor features or optimizing your workflow.

software-engineer

siviter-xyz/dot-agent

Core software engineering principles for code style, documentation, and development workflow. Applies when editing code, working in software repositories, or performing software development tasks.

Docs & Writing623 installs

python

siviter-xyz/dot-agent

Python development guidelines and best practices. Use when working with Python code.

backend-engineer

siviter-xyz/dot-agent

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.

Backend & APIs342 installs

frontend-engineer

siviter-xyz/dot-agent

Open the skill to read its SKILL.md instructions.

Frontend & Design319 installs

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs