cli-development

Guide CLI application development across multiple programming languages.

Updated Apr 11, 2023
One-click install
npx skills add https://github.com/salverius-tech/dotfiles --skill cli-development-salverius-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-development
Source: https://github.com/salverius-tech/dotfiles/tree/main/home/dot_claude/skills/cli-development
Command: npx skills add https://github.com/salverius-tech/dotfiles --skill cli-development-salverius-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for designing, building, and testing effective command-line interface (CLI) applications across various programming languages.

Core Features & Use Cases

  • Design Principles: Adheres to Unix philosophy, command structure, and subcommand/flag usage.
  • Argument Parsing: Handles required/optional arguments, flags, environment variables, and configuration files with clear precedence.
  • User Interface: Focuses on clear help text, version info, progress indicators, color output, and interactive prompts.
  • Output & Error Handling: Defines standards for human-readable vs. machine-readable output, proper exit codes, and informative error messages with debugging options.
  • Cross-Platform Compatibility: Addresses path separators, line endings, and terminal capabilities.
  • Testing Strategies: Outlines integration tests, output verification, and exit code checks.
  • Documentation: Emphasizes READMEs, man pages, and built-in help.
  • Libraries: Introduces common libraries for Python, Node.js, Go, and Rust.
  • Use Case: A developer needs to build a new CLI tool for managing cloud resources. They can consult this Skill for best practices on argument parsing, user feedback, and error handling to ensure the tool is user-friendly and robust.

Quick Start

Use the cli-development skill to learn how to implement clear help text for a new command-line tool.

Frequently Asked Questions about cli-development

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

FAQPage Schema
What are the best practices for command-line interface design and argument parsing?

Argument parsing best practices involve defining clear precedence between environment variables, configuration files, and command-line flags to ensure robust and predictable CLI application behavior.

How do I handle errors and format output in a CLI application?

To handle errors in a CLI application, implement proper exit codes and informative error messages with debugging options, while separating human-readable output from machine-readable formats for scriptability.

Does this CLI development guidance apply to multiple programming languages?

Yes, this CLI development guidance applies across multiple programming languages, offering cross-platform considerations for path separators and line endings, and introducing common libraries for Python, Node.js, Go, and Rust.

How do I test command-line tools and verify their argument handling?

Test command-line tools by implementing integration tests that verify output formatting, check proper exit codes, and ensure argument handling works correctly across different input scenarios and environment configurations.

What should be included in command-line tool documentation and user interface elements?

Command-line tool documentation should include READMEs, man pages, and built-in help text, while the user interface requires clear version info, progress indicators, color output, and interactive prompts.