skillfed

fire

A library for automatically generating command line interfaces.

fire v0.7.1 21.2M downloads/30d#1,006 on PyPI28,206
Permissive license Apache-2.0 Active released

What it is and what it does

Python Fire is a library that turns any Python object into a command-line interface by introspecting its structure and automatically mapping arguments to parameters. You pass a function, class, module, or data structure to fire.Fire() and it generates a CLI with help text, argument parsing, and interactive mode—no explicit argument parser configuration needed. The library handles functions with default arguments, class methods, nested objects, dictionaries, and lists, making it useful for quick prototyping, debugging, and exposing existing Python code as command-line tools.

The package depends only on termcolor for colored output and supports Python 3.7 through 3.13. It's maintained by Google, with active development and no known security vulnerabilities. The approach trades some control and customization for speed and simplicity—ideal when you want a working CLI in minutes rather than building one from scratch with argparse or Click.

Use it for:

  • Quickly expose a Python function or class as a command-line tool for one-off scripts or internal utilities
  • Debug and test Python code interactively via CLI without writing separate test harnesses
  • Turn an existing Python module or library into a usable command-line interface for exploration or automation
  • Build REPL environments with pre-imported modules and objects for interactive development
  • Create simple CLI wrappers around Python functions for shell integration or CI/CD pipelines

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically generates command-line interfaces from any Python object—functions, classes, modules, or data structures—without requiring explicit argument parsing or CLI framework setup.

Yes. Python Fire is a low-friction, well-maintained library with no security issues and permissive licensing. It's ideal if you need to quickly expose Python code as a CLI without the overhead of a full argument-parsing framework. Install it when you want rapid prototyping or need to turn existing Python objects into command-line tools; skip it if you need fine-grained control over CLI behavior or complex argument validation.

Install

fire on PyPI

pip

pip install fire

uv

uv add fire

poetry

poetry add fire

Installing fire

Before you install

Low install friction with a single lightweight dependency (termcolor). Active maintenance with recent release activity; last commit 2026-07-01 and latest release 2025-08-16 indicate ongoing support.

License in practice

Licensed under Apache 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install fire

import fire

def hello(name="World"):
  return "Hello %s!" % name

if __name__ == '__main__':
  fire.Fire(hello)

# Then: python script.py --name=David

Verify before relying

  • Whether the package handles complex nested object hierarchies or only flat function/class interfaces
  • Performance characteristics when exposing large APIs or deeply nested module structures

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — termcolor
Maintenance actively maintained — 363 days since the last release
Last repo commit
First released
Downloads 21,233,843/month — #1,006 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fire-0.7.1-py3-none-any.whl

Keywords: command, line, interface, cli, python, fire, interactive, bash, tool

Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: MacOSOperating System :: OS IndependentOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

python cli generatorautomatic command line interfacefire cli librarypython function to clicli from python objectcommand line tool builderbash interface generator
cli-generationrapid-prototypingdeveloper-tools

More Python Modules packages