py-cli

Develop Python command-line applications with structured argument parsing and exit codes.

1|1|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/stevenke1981/python_skills --skill py-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: py-cli
Source: https://github.com/stevenke1981/python_skills/tree/main/py-cli
Command: npx skills add https://github.com/stevenke1981/python_skills --skill py-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized framework for building command-line interfaces that are user-friendly for humans, stable for shell scripts, and reliable for CI/CD automation.

Core Features & Use Cases

  • Framework Selection: Guidance on choosing between argparse, Typer, Click, or Textual based on project complexity and requirements.
  • Contract Management: Best practices for defining command arguments, exit codes, and stdout/stderr streams to ensure predictable behavior.
  • Automation Readiness: Implementation patterns for non-interactive execution, JSON output, and atomic file operations.

Quick Start

Use the py-cli skill to generate a new command-line tool structure using Typer that includes proper argument parsing and error handling.

Frequently Asked Questions about py-cli

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

FAQPage Schema
How do I build a robust Python CLI tool for CI/CD pipelines?

To build a robust Python CLI tool, define clear command contracts, standardize exit codes, and implement machine-readable output formats to ensure predictable execution in CI/CD pipelines.

What is the best way to choose between argparse, Click, and Typer for a command-line application?

Choosing between argparse, Click, and Typer depends on your project complexity and requirements, balancing built-in standard library support against advanced features for structured argument parsing and error handling.

How do I structure stdout and stderr streams for reliable shell script automation?

Structure stdout and stderr streams by separating machine-readable output from error messages, defining strict command contracts and exit code standards to ensure stable behavior for shell script automation.

Does this Python CLI framework support non-interactive execution in automated environments?

Yes, the framework supports non-interactive execution in automated environments by implementing patterns for machine-readable JSON output and atomic file operations tailored for containerized tasks.

Why define command contracts and exit code standards for terminal applications?

Defining command contracts and exit code standards for terminal applications ensures high-quality CLI UX, predictable behavior across interactive shells, and reliable error handling for shell scripts.