cli-development

Standardize command-line interface design for shell composability and POSIX compliance.

25|3|Updated Jul 14, 2026
One-click install
npx skills add https://github.com/nimadorostkar/Claude-Skills-collection --skill cli-development-nimadorostkar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-development
Source: https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/development/cli-development
Command: npx skills add https://github.com/nimadorostkar/Claude-Skills-collection --skill cli-development-nimadorostkar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common pitfalls in command-line tool development, such as poor stream management, inconsistent exit codes, and lack of composability, which often make tools difficult to use in automated pipelines.

Core Features & Use Cases

  • Stream Discipline: Ensures correct separation of stdout for data and stderr for logs and progress.
  • Standardized UX: Provides guidance on configuration precedence, TTY detection, and machine-readable output formats like JSON.
  • Use Case: When building a new deployment utility, use this skill to ensure the tool behaves predictably when piped into other commands like grep or jq.

Quick Start

Apply the cli-development skill to review the argument structure and stream handling of my new terminal utility.

Frequently Asked Questions about cli-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a CLI tool that works well when piped to other commands?

To build a CLI tool that pipes effectively, you must separate stdout for data and stderr for logs, and use predictable exit codes. This ensures your terminal utility behaves predictably in automated pipelines alongside commands like grep or jq.

Why does my deployment script break when run in an automated pipeline?

Your deployment script likely breaks because of poor stream discipline and inconsistent exit codes. Separating stdout for data and stderr for progress logs ensures the tool remains composable and doesn't corrupt data when piped into other commands.

What is the correct way to handle configuration precedence in a terminal utility?

Configuration precedence in a terminal utility should follow standardized rules, typically prioritizing explicit command-line flags, then environment variables, then default config files. This provides a predictable and shell-friendly user experience.

How do I implement machine-readable output formats like JSON in a command-line interface?

To implement machine-readable JSON output in a command-line interface, use TTY detection to switch between human-readable text and structured JSON. This ensures the CLI tool supports both interactive terminal sessions and automated data parsing.

Does my shell script need to follow POSIX standards for automation tooling?

Yes, adhering to POSIX-compliant output patterns ensures your shell script achieves maximum compatibility across different Unix environments. This standardizes stream management and configuration behavior for reliable automation tooling.

What are the limitations of using standard terminal output for automated deployment scripts?

Standard terminal output limits automated deployment scripts by mixing data with progress logs on stdout, which breaks downstream parsing. You must enforce strict stream separation and predictable exit codes to achieve reliable shell composability.