build-cli-tool

Design CLI contracts with exit codes, stream separation, and JSON output.

9|3|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill build-cli-tool
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-cli-tool
Source: https://github.com/Sir-chawakorn/sanook-cli/tree/main/skills/build-cli-tool
Command: npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill build-cli-tool

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common pitfalls in CLI development, such as poor pipe compatibility, confusing exit codes, and lack of machine-readable output, ensuring your tools are robust and professional.

Core Features & Use Cases

  • Interface Contract Design: Standardizes stdout for data and stderr for logs, ensuring tools work seamlessly with Unix pipes and redirection.
  • Robust UX Patterns: Implements proper exit codes, signal handling, TTY-aware color/spinner logic, and machine-readable JSON modes.
  • Use Case: When building a new CLI tool, use this skill to ensure it supports shell completion, respects NO_COLOR, and provides clear, actionable error messages for CI/CD environments.

Quick Start

Use the build-cli-tool skill to audit my current command-line interface design and suggest improvements for better pipe compatibility and error handling.

Frequently Asked Questions about build-cli-tool

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

FAQPage Schema
How do I design a CLI tool interface that is fully scriptable and robust for CI/CD pipelines?

Designing a scriptable CLI interface requires standardizing exit codes, separating stdout for data and stderr for logs, and implementing machine-readable JSON output modes to ensure robust automation in CI/CD pipelines.

What's the best way to ensure my command-line program has proper pipe compatibility?

Proper pipe compatibility is achieved by strictly separating streams, routing operational data to stdout and logging information to stderr, ensuring your command-line program works seamlessly with Unix pipes and redirection.

Does this approach to CLI design work across different programming languages?

Yes, this approach applies to CLI development across various programming languages by defining a language-agnostic operational contract that standardizes exit codes, stream separation, and machine-readable output formats.

How do I handle terminal output formatting and signal cleanup in a CLI application?

Terminal output and signal cleanup are handled by implementing TTY-aware color and spinner logic, respecting the NO_COLOR environment variable, and executing proper signal handling to clean up resources on interruption.

Why does my CLI tool fail when piped to another command in a shell environment?

CLI tools fail when piped because of poor pipe compatibility, often caused by mixing data and logs on stdout, lacking machine-readable output, or using interactive prompts without checking for TTY availability.

How do I configure layered configuration precedence for a command-line application?

Layered configuration precedence is configured by defining a strict hierarchy of configuration sources, ensuring the command-line application satisfies requirements for predictable runtime behavior and override priority.