Skip to content
/ sayer Public

The Modern Python CLI Framework

License

dymmond/sayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Sayer

Sayer logo

Fast. Scalable. Elegant. Command the CLI like a boss. πŸ§™β€β™‚οΈ

Test Suite Package version Supported Python versions


Documentation: https://sayer.dymmond.com πŸ“š

Source Code: https://github.com/dymmond/sayer

The official supported version is always the latest released.


πŸ€” What is Sayer?

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.


πŸ“¦ Installation

Using pip:

pip install sayer

Or with uv (blazing fast):

uv pip install sayer

🧩 Features

  • βœ… 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.

πŸ”₯ Why Sayer?

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

πŸš€ Getting Started

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!

πŸ§ͺ Testing

hatch run test:test

Or with pytest:

pytest -v

πŸ“š Documentation

Full 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 🐣

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages