Fast. Scalable. Elegant. Command the CLI like a boss. π§ββοΈ
Documentation: https://sayer.dymmond.com π
Source Code: https://github.com/dymmond/sayer
The official supported version is always the latest released.
Sayer is a modern, async-native Python CLI framework built for developers who want more:
- More structure.
- More power.
- More expressiveness.
Less boilerplate. Less headache. Less "why doesn't this just work?".
Designed to scale from weekend scripts to enterprise-grade CLI suites β with a touch of magic.
Using pip:
pip install sayerOr with uv (blazing fast):
uv pip install sayer- β Fully async support out-of-the-box
- β
Param metadata via
Option(...),Argument(...),Env(...)β inspired by the best - β Declarative CLI building with decorators
- β Built-in middleware system (yes, for CLI!)
- β Shared app state and lifecycle management
- β
Terminal-rich output via
rich - β
Easy testing with
SayerTestClient - β Flexible help and docs rendering
- β Clean project scaffolding, sensible defaults
- β 100% type annotated.
| Feature | Sayer | Notes |
|---|---|---|
| Async Support | β Yes | Truly async from top to bottom |
| Param Metadata | β Yes | With rich options, env vars, etc. |
| Middleware Support | β Yes | Per-command, app-wide, scoped |
| Lifecycle Hooks | β Yes | on_startup, on_shutdown |
| State Management | β Yes | Like a Flask g but better |
| Testability | β Yes | CLI client for unit tests |
| Output Styling | β Yes | Built-in rich integration |
| Based on Modern Tools | β Hatch + UV | Modern dev setup from day 1 |
| Full Typing | β Yes | Mypy + Ruff compliant |
| Fun to Use? | πΊ Extremely | Let the code dance with you |
Create your first CLI app:
from sayer import Sayer, Option
app = Sayer()
@app.command()
def hello(name: str = Option(..., help="Your name")):
"""Say hello to someone"""
print(f"Hello, {name}!")
if __name__ == "__main__":
app()Run it:
$ python app.py hello --name Ada
Hello, Ada!hatch run test:testOr with pytest:
pytest -vFull docs available at: https://sayer.dymmond.com
You'll find:
- Full API reference
- Command examples
- Parameter deep dives
- Middleware patterns
- Configuration strategies
- ... and some fun easter eggs π£