diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..f34fe72b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,67 @@ +# Python Fire + +## Overview +Google's library for automatically generating command-line interfaces (CLIs) from any Python object. Turn any Python code into a CLI with zero additional code. + +## Repository Purpose +- **Auto CLI generation** - Instant command-line interfaces +- **Zero boilerplate** - No argparse needed +- **Rapid prototyping** - Quick CLI tools +- **Function exposure** - Expose any Python function via CLI + +## Key Features +- **Automatic CLI creation** - From classes, functions, modules +- **No decorators needed** - Just call Fire() +- **Tab completion** - Bash completion support +- **Help generation** - Automatic help text +- **Chained commands** - Call multiple methods +- **Type handling** - Automatic type conversion + +## Example +```python +import fire + +def hello(name="World"): + return f"Hello {name}!" + +if __name__ == '__main__': + fire.Fire(hello) +``` +Usage: `python script.py --name=Alice` + +## Use Cases +1. **Quick scripts** - Turn scripts into CLIs +2. **Internal tools** - Developer utilities +3. **Prototyping** - Test functions via CLI +4. **REPL alternative** - Interactive function calling +5. **DevOps tools** - System administration scripts + +## Advantages +- **Minimal code** - One line to create CLI +- **Flexible** - Works with any Python object +- **Pythonic** - Natural Python code structure +- **Fast development** - Instant CLI tools + +## Technical Stack +- Pure Python +- Works with Python 3.6+ +- No external dependencies +- Cross-platform + +## Alternatives +- **Click** - More control, more code +- **argparse** - Standard library, verbose +- **Typer** - Type hints based, modern +- **docopt** - Docstring-based + +## Target Audience +- Python developers +- DevOps engineers +- Data scientists +- Anyone needing quick CLIs + +## Important Notes +- **Google project** - Well-maintained +- **Production ready** - Used in many projects +- **Great for rapid development** - Not for complex CLIs +- **Simple is better** - Perfect for simple tools