cli-development

Design and implement CLIs with subcommand-scoped help and actionable output.

862|67|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/saffron-health/libretto --skill cli-development-saffron-health
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-development
Source: https://github.com/saffron-health/libretto/tree/main/.agents/skills/cli-development
Command: npx skills add https://github.com/saffron-health/libretto --skill cli-development-saffron-health

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and implement command-line interfaces (CLIs) that are user-friendly, provide clear feedback, and are easy to debug, ensuring a smooth experience for both human users and automated agents.

Core Features & Use Cases

  • Actionable Output: Ensures CLIs provide clear next steps on success or detailed diagnostics and recovery options on failure.
  • Command Contract: Defines standards for deterministic output, conventional stream usage (stdout/stderr), meaningful exit codes, and automation support (e.g., --json mode).
  • Help and Error Patterns: Provides structured templates for help messages and error reporting to improve usability and diagnosability.
  • Use Case: When developing a new CLI tool, use this Skill to ensure its commands are well-documented, its errors are informative, and its output is predictable and machine-readable.

Quick Start

Use the cli-development skill to design a help message for a new subcommand that publishes a release.

Frequently Asked Questions about cli-development

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

FAQPage Schema
How do I design command-line interfaces with clear help text and exit codes?

Design command-line interfaces by scoping help text to subcommands, defining meaningful exit codes, and separating stdout and stderr streams to ensure predictable, user-friendly CLI interactions.

What is the best way to format CLI error messages for debugging?

The best way to format CLI error messages is to provide detailed diagnostics and actionable recovery options, avoiding dead ends to make failures easily diagnosable for both human users and automated agents.

How do I make CLI output machine-readable for automation agents?

Make CLI output machine-readable by enforcing deterministic command contracts, conventional stream usage, and automation support such as a JSON output mode for predictable parsing and integration.

Why should I scope help text to subcommands instead of a global usage message?

Scoping help text to subcommands ensures users receive actionable, relevant instructions for the specific command they are running, keeping output minimal and avoiding overwhelming global usage messages.

Does this CLI development approach support both human users and automated agents?

Yes, this CLI development approach supports both humans and agents by providing clear next steps on success, structured error patterns, and machine-readable output formats to ensure smooth UX across contexts.

When do I need to define a command contract for a command-line tool?

You need to define a command contract when developing a new CLI tool to establish deterministic output, conventional stream usage, and meaningful exit codes for reliable automation and debugging.