cli-template
Batteries-included Python CLI template. Auto-discovery commands, global flags, output formatting, self-update, and a whole lot more.
Key Features • Quick Start • CLI Usage • Adding Commands • Configuration • Credits • About the Core Contributors
Key Features
Opinionated Python CLI template for fast development. The saas branch extends main with web framework, auth, and payments.
| Feature | main |
saas |
|---|---|---|
| Auto-discovery command system | ✅ | ✅ |
| Interactive fallback prompts | ✅ | ✅ |
| Shell completions | ✅ | ✅ |
| Self-update | ✅ | ✅ |
| Anonymous telemetry with opt-out | ✅ | ✅ |
| UV + Pydantic config | ✅ | ✅ |
| CI/Linters (Ruff, Vulture) | ✅ | ✅ |
| Pre-commit hooks (prek) | ✅ | ✅ |
| LLM (DSPY + LangFuse Observability) | ✅ | ✅ |
| FastAPI + Uvicorn | ❌ | ✅ |
| SQLAlchemy + Alembic | ❌ | ✅ |
| Auth (WorkOS + API keys) | ❌ | ✅ |
| Payments (Stripe) | ❌ | ✅ |
| Ralph Wiggum Agent Loop | ✅ | ✅ |
Quick Start
make onboard # interactive setup (rename, deps, env, hooks)
uv sync # install deps
uv run mycli --help # see all commands
uv run mycli greet Alice # run a command
uv run mycli init my_command # scaffold a new command
CLI Usage
Global flags go before the subcommand:
| Flag | Short | Description |
|---|---|---|
--verbose |
-v |
Increase output verbosity |
--quiet |
-q |
Suppress non-essential output |
--debug |
Show full tracebacks on error | |
--format |
-f |
Output format: table, json, plain |
--dry-run |
Preview actions without executing | |
--version |
-V |
Print version and exit |
uv run mycli --format json config show # JSON output
uv run mycli --dry-run greet Bob # preview without executing
uv run mycli --verbose greet Alice # detailed output
Adding Commands
Drop a Python file in commands/ and it is auto-discovered.
Single command - export a main() function:
# commands/hello.py
from typing import Annotated
import typer
def main(name: Annotated[str, typer.Argument(help="Who to greet.")]) -> None:
"""Say hello."""
typer.echo(f"Hello, {name}!")
uv run mycli hello World # Hello, World!
Subcommand group - export app = typer.Typer():
# commands/db.py
import typer
app = typer.Typer()
@app.command()
def migrate() -> None:
"""Run migrations."""
...
uv run mycli db migrate
Or scaffold with: uv run mycli init my_command --desc "Does something".
Configuration
from common import global_config
# Access config values from common/global_config.yaml
global_config.example_parent.example_child
# Access secrets from .env
global_config.OPENAI_API_KEY
CLI config inspection:
uv run mycli config show # full config
uv run mycli config get llm_config.cache_enabled # single value
uv run mycli config set logging.verbose false # write override
Credits
This software uses the following tools:
- Cursor: The AI Code Editor
- uv
- Typer: CLI framework
- Rich: Terminal formatting
- prek: Rust-based pre-commit framework
- DSPY: Pytorch for LLM Inference
- LangFuse: LLM Observability Tool
About the Core Contributors
Made with contrib.rocks.
Metadata
Release files for miyamura80-cli-template 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| miyamura80_cli_template-0.1.1.tar.gz | 13.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| miyamura80_cli_template-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 MB
Release files / miyamura80_cli_template-0.1.1.tar.gz
| Download URL | miyamura80_cli_template-0.1.1.tar.gz |
|---|---|
| Size | 13.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acc2539a4371e09382edc5d2a5714b61b56430b76e357b2a4e7a07f023217274
|
|
BLAKE2b-256 checksum How to use checksums |
b3bf7f5af7e62f6a98e1c7d0d70edb667c55d961ceda8411aeca880ded643ad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Release files / miyamura80_cli_template-0.1.1-py3-none-any.whl
| Download URL | miyamura80_cli_template-0.1.1-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88fcf4a6e1788222baa11c167a889c8ae85d1696d9628b765a8c9b33be3a3b38
|
|
BLAKE2b-256 checksum How to use checksums |
2a25a8bc257b9ba3339c68f7abcff9dfff92831c5099d8b358c8c05e615bc4be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|