This repo is boilerplate for quickly creating Python click applications. It assumes the use of uv. Click "Use this template" to create a new repo using this framework.
With your new repo pulled and ready to go:
- Rename the
pyclidirectory to whatever you want your package to be called - Edit the
[project]metadata in the pyproject.toml file - Edit the
[project.scripts]section to fit your needs. Remember thepycliis the core command of your CLI and the"pycli.cli:cli"portion is the entrypoint.
From there you're ready to uv sync and you should be good to go for starting dev on your CLI application!
- python ^3.12
- click
- rich-click
- pyserde
- pydantic
- ruff
These are a good starting point for all python projects in my opinion. To add new dependencies use uv add <package> and to remove uv remove <package>.
An empty .envrc is kept to remind myself of integrations possible with direnv.
Pytest and pre-commit hooks are set up as optional dependencies and can be included with uv sync --extra test. To initialize pre-commit hooks, check the .pre-commit-hooks.yaml file, and then do pre-commit install to have each commit checked.
If you need to pull things from private registries such as Artifactory check out the uv indexes docs. You can either set up a uv.toml file, define them explicitly in your pyproject.toml, or use the many UV environment variables, or pass them at installation time via --extra-index-url. There are probably other options as well!