fire
A library for automatically generating command line interfaces.
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 fireuv
uv add firepoetry
poetry add fireInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
tyrotyro generates command-line interfaces and…
permissive · top 5,000 on PyPI
clizeClize turns Python functions into command-line…
permissive · top 15,000 on PyPI
argparse-dataclassBuilds command-line interfaces declaratively by…
permissive · top 5,000 on PyPI
clickClick is a Python toolkit for building…
permissive · top 100 on PyPI
click-replAdds an interactive REPL mode to Click…
permissive · top 1,000 on PyPI
prefect-cloudDeploys Python functions to Prefect Cloud and…
unclear · top 5,000 on PyPI
EventsProvides a publish-subscribe event system where…
permissive · top 1,000 on PyPI
logfuryLogfury adds automatic method-call tracing to…
permissive · top 15,000 on PyPI
EasyProcessEasyProcess wraps Python's subprocess module to…
permissive · top 5,000 on PyPI
entrypoint2Converts Python function signatures and…
permissive · top 15,000 on PyPI