Agent-Friendly CLI Design

•
24
•

Optimizes command-line interfaces for dual compatibility with human users and AI agents to improve reliability and reduce token costs.

The CLI Design skill provides a robust framework for building and refactoring command-line tools that work seamlessly for both humans and LLM agents. It addresses the critical 'two-reader' challenge, ensuring that outputs are clean for pipes and machine-readable for agents while remaining intuitive for interactive terminal use. By implementing standards for stream discipline, structured JSON output, and deterministic error codes, this skill helps developers eliminate common failure modes such as terminal hangs and ANSI corruption, ultimately making tools up to 35 times more token-efficient for AI-driven workflows.

주요 기능

0124 GitHub stars
02Two-reader optimization for TTY and non-interactive environments
03Structured error handling with actionable recovery paths and exit codes
04Mutation safety patterns including dry-runs and idempotency
05Standardized machine-readable JSON/JSONL output patterns
06Strict stream discipline separating data (stdout) from diagnostics (stderr)

사용 사례

01Building a new developer tool or internal CLI from scratch
02Refactoring existing CLIs to make them compatible with AI agents and CI/CD pipelines
03Adding machine-readable output modes to legacy command-line utilities