What problem does it solve?
Developing robust command-line interface (CLI) tools with proper argument parsing, help messages, and cross-platform compatibility can be intricate. This Skill provides best practices and guidance for building professional-grade CLI tools that are intuitive and maintainable.
Core Features & Use Cases
- Argument Parsing: Guides on using libraries like Click or Typer for efficient command-line argument handling.
- POSIX Compliance: Ensures CLI tools adhere to industry standards for consistent behavior across different shells.
- User-Friendly Output: Provides patterns for clear help messages, progress indicators, and rich terminal output using libraries like Rich.
- Use Case: When creating a new internal utility script, this Skill can help you design its command structure, implement robust argument validation, and generate comprehensive help documentation automatically.
Quick Start
Example: Basic CLI tool with Click (Python)
import click
@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.argument('name')
def hello(count, name):
for x in range(count):
click.echo(f"Hello {name}!")
if name == 'main':
hello()