🪛 CLI tool template (python) with batteries included. Auto-install, updates, linting, dead code analysis, and a whole lot more.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file miyamura80_cli_template-0.1.0.tar.gz.
File metadata
- Download URL: miyamura80_cli_template-0.1.0.tar.gz
- Upload date:
- Size: 13.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
424f96b81f9683980321eb919988c84d65ffdf3341dc1c476c68cdd8d7699aa8
|
|
| MD5 |
7e62e4f73f23b9f432b2efbaa4a2a7d7
|
|
| BLAKE2b-256 |
4b1645f98bf4eb4be5a3293d7e3eca206ff275c3a9b165a228465afd5dfe7422
|
File details
Details for the file miyamura80_cli_template-0.1.0-py3-none-any.whl.
File metadata
- Download URL: miyamura80_cli_template-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92ed0a923c0e6eb3f2366c32b4404c84fabef524359457169649ab21197f696
|
|
| MD5 |
e5c0d1cfca326debc0de79ec11848470
|
|
| BLAKE2b-256 |
5c9c3b7c286e8a5376f6d8461498f43cb800ab3ebdf39d9c8ea36c6de05ebbba
|