fire-patterns

Generate Python CLIs from class designs using Google Fire.

Updated Nov 11, 2025
One-click install
npx skills add https://github.com/vanman2024/cli-builder --skill fire-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fire-patterns
Source: https://github.com/vanman2024/cli-builder/tree/main/plugins/cli-builder/skills/fire-patterns
Command: npx skills add https://github.com/vanman2024/cli-builder --skill fire-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enables quickly building Python CLIs using Google Fire, where commands are auto-generated from class methods and documented via docstrings.

Core Features & Use Cases

  • Class-Based CLI: Define a Python class and expose commands via methods.
  • Docstring-Driven Help: Command help text is derived from method docstrings.
  • Nested Command Groups: Support for nested classes to group commands.
  • Rich Output Integration: Optional Rich console integration for polished output.

Quick Start

Create a Python module with a main class and methods; run with python to view auto-generated commands and help text.

Frequently Asked Questions about fire-patterns

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

FAQPage Schema
How do I auto-generate a Python CLI from class methods using Fire?

Auto-generate Python CLIs by defining a class with methods and running it through Google Fire. Fire introspects class structure, exposing each method as a command with arguments derived from function signatures. The result is a fully functional CLI with no boilerplate configuration needed.

Can I use docstrings to document Fire CLI commands automatically?

Yes. Fire parses method docstrings to generate command help text. Document parameters and behavior in docstrings, and Fire surfaces that documentation in the CLI's help output, eliminating separate help maintenance.

How do I organize nested command groups in a Python Fire CLI?

Nest command groups by defining classes as attributes of a parent class. Fire traverses nested class instances, creating hierarchical command structures where sub-classes become command groups, allowing logical organization of large CLI surfaces.

What's the best way to add formatted output to a Fire CLI?

Integrate Rich console for polished output rendering. Rich provides styled tables, colors, and formatting that enhance CLI readability. Combine it with Fire's class-based structure to format command results without modifying core Fire logic.

Do I need type hints to use class-based Fire CLIs effectively?

Type hints are optional but recommended. Fire can infer types from function signatures and defaults, but explicit type annotations improve argument parsing accuracy and enable better validation in CLI commands.