python-cli-click

Automate design and testing of Python CLI apps with Click and Rich.

1|2|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/co-labs-co/context-harness --skill python-cli-click
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-cli-click
Source: https://github.com/co-labs-co/context-harness/tree/main/.opencode/skill/python-cli-click
Command: npx skills add https://github.com/co-labs-co/context-harness --skill python-cli-click

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides patterns for building Python CLI applications using Click with Rich-based output, shell completion, and interactive prompts. It guides how to structure commands, formatters, and testing with CliRunner, so teams can rapidly create robust CLIs.

Core Features & Use Cases

  • Command Groups & Subcommands: Organize complex CLIs into logical groups with consistent help and completion.
  • Rich UI & Interaction: Produce rich terminal output and interactive prompts for streamlined user experiences.
  • Test & Validation: Use CliRunner-based tests to verify command behavior and edge cases across environments.
  • Use Case: Example: Create a new feature flag command that lists available options and auto-completes shell completions.

Quick Start

Install dependencies, scaffold a new command using the provided templates, and run tests to validate behavior.

Frequently Asked Questions about python-cli-click

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

FAQPage Schema
How do I build a Python CLI with Rich output and interactive prompts?

Build a Python CLI with Rich output by using Click for command structuring and Rich for terminal formatting. This approach integrates interactive pickers and shell completion to create streamlined user experiences across projects.

What is the best way to test Click command groups and subcommands?

The best way to test Click command groups is using CliRunner-based tests to verify command behavior and edge cases. This method validates complex command structures and interactive prompts across different environments.

Do I need Questionary to create interactive prompts in a Click CLI?

Yes, you need Questionary to create interactive prompts in a Click CLI. It works alongside Click and Rich to provide interactive pickers and streamlined user experiences within the terminal application.

How do I add shell completion to a Python command-line application?

Add shell completion to a Python command-line application by using Click's built-in completion features. This Skill provides patterns to organize commands and auto-complete shell completions for complex CLI groups.

Can I use Click and Rich together to format terminal output?

Yes, you can use Click and Rich together to format terminal output. Click handles command parsing and group structuring while Rich produces rich terminal UI elements for a better user experience.

Why use CliRunner for testing Python command-line interfaces?

Use CliRunner for testing Python command-line interfaces to automate the validation of command behavior and edge cases. It allows you to simulate CLI invocations and verify outputs without manual terminal interaction.