cli-patterns

Build Python CLIs with Typer, Rich, structlog, and JSON output.

3|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/pvliesdonk/agents.md --skill cli-patterns-pvliesdonk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-patterns
Source: https://github.com/pvliesdonk/agents.md/tree/main/claude-skills/cli-patterns
Command: npx skills add https://github.com/pvliesdonk/agents.md --skill cli-patterns-pvliesdonk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the creation of user-friendly and informative command-line interfaces (CLIs) in Python, making your tools easier to use and debug.

Core Features & Use Cases

  • Intuitive Command Structure: Design complex CLIs with nested commands using Typer.
  • Rich Output: Enhance user experience with styled text, tables, panels, and progress indicators via Rich.
  • Machine-Readable Output: Support for JSON output for scripting and automation.
  • Configurable Verbosity: Control logging levels from silent to verbose debugging.
  • Use Case: Develop a data processing tool where users can run specific pipelines, view progress, and get detailed logs or concise summaries as needed.

Quick Start

Use the cli-patterns skill to create a Typer application with a 'generate' command that accepts an input file and a prompt.

Frequently Asked Questions about cli-patterns

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

FAQPage Schema
How do I build a Python CLI with nested commands and rich output?

To build a Python CLI with nested commands and rich output, use Typer to structure complex command hierarchies and Rich to render styled text, tables, and panels for enhanced user experience.

What is the best way to add progress indicators and verbosity levels to a Python command-line tool?

Adding progress indicators and verbosity levels to a Python command-line tool is best achieved using Rich for visual progress and structlog for configurable logging, allowing control from silent mode to verbose debugging.

How do I make a Python CLI support JSON output for automation?

To make a Python CLI support JSON output for automation, implement machine-readable output options alongside Rich formatting so scripts can parse structured data while users still see styled interactive text.

Does Typer support interactive prompts with non-interactive fallbacks?

Yes, Typer supports interactive prompts with non-interactive fallbacks, allowing your Python command-line interface to request user input during interactive sessions while degrading gracefully for automated scripting environments.

How do I handle errors and configure logging in a Python Typer application?

To handle errors and configure logging in a Python Typer application, use structlog for configurable verbosity levels and Rich to display formatted error output, ensuring robust debugging and scriptability.