Skip to content

Miyamura80/CLI-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

86 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

cli-template

2

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

Project Version Python Version GitHub repo size GitHub Actions Workflow Status


CLI Demo

Agent Prompt

Copy and paste this into your AI coding agent (Claude Code, Cursor, Copilot, etc.) to install:

Install the CLI and download the usage skill:

pip install miyamura80-cli-template

curl -fsSL https://raw.githubusercontent.com/Miyamura80/CLI-Template/main/scripts/install-skills.sh -o install-skills.sh
bash install-skills.sh && rm install-skills.sh

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

Full comparison

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

Full configuration docs

Credits

This software uses the following tools:

About the Core Contributors

Made with contrib.rocks.

About

πŸͺ› CLI tool template (python) with batteries included. Auto-install, updates, linting, dead code analysis, and a whole lot more.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors