refactor, split to two versions - cli and service

This commit is contained in:
Jev
2026-05-25 23:28:24 +02:00
parent 79d86961e3
commit 7188b20797
14 changed files with 335 additions and 69 deletions
+20 -2
View File
@@ -1,6 +1,15 @@
# Python CLI Template
# Python Project Template
Minimal Cookiecutter template for python CLI tools. Python 3.12+, uv, Typer, ruff, mypy, pytest.
Minimal Cookiecutter template for Python 3.12+ projects using uv, ruff, mypy,
and pytest. Pick a variant when generating:
- **`cli`** — a Typer command-line tool (distributed as a wheel / `uv tool install`).
- **`service`** — a long-running, containerized script (e.g. an email poller):
poll loop with graceful SIGTERM shutdown, a self-contained Docker image, and a
registry-free `docker save | ssh` deploy task.
Versioning is git-tag based (`hatch-vcs`): the tag is the single source of
truth and `inv bump <part>` creates the next `vX.Y.Z` tag.
## Usage
@@ -8,6 +17,15 @@ Minimal Cookiecutter template for python CLI tools. Python 3.12+, uv, Typer, ruf
cruft create https://git.roxautomation.com/sjev/python-cli-template.git
```
You'll be prompted for `project_type` (`cli` or `service`). The generated
project is git-initialized, tagged `v0.1.0`, and ready to `source init.sh`.
## Development (this template)
```bash
bash test.sh # renders + lint/tests both variants
```
## License
MIT