Toolbelt CLI
Scaffold projects, draft Conventional Commits, and audit repositories.
Table of Contents
- Overview
- Installation
- Command Reference
- Usage
- Feature Tour & Usage Examples
- Configuration & Environment Variables
- Architecture & Tech Stack
- Development & Testing
- Deployments
- Publishing to PyPI
- Contributing
- License
Overview
Toolbelt CLI is a Python 3.11+ command-line utility built with Typer, Rich, and Jinja2. It provides starter templates for Python, Node.js/TypeScript, and Java, commit-message drafting from staged Git changes, repository checks, and an optional PyPI update check.
Installation
With pipx (Recommended)
Isolate CLI tools in their own dedicated virtual environments:
pipx install toolbelt-cli
With uv
Fast single-step tool installation:
uv tool install toolbelt-cli
With standard pip
pip install toolbelt-cli
Install from source
git clone https://github.com/crnjihia/toolbelt-cli.git
cd toolbelt-cli
pip install -e ".[dev]"
The installation provides both toolbelt and zana command names.
Command Reference
| Command | Arguments | Flags | Description |
|---|---|---|---|
toolbelt new |
<type> <name> |
--author, --license, --ci/--no-ci, --docker/--no-docker, -y/--yes |
Scaffold an opinionated Python, Node, or Java project. |
toolbelt commit |
(none) | --dry-run, -t/--type, -s/--scope, -y/--yes |
Inspect staged diff and generate Conventional Commit message. |
toolbelt audit |
[path=.] |
--json, --fix |
Run 10-point repository audit with Rich table or JSON output. |
toolbelt version |
(none) | (none) | Display installed version and check PyPI for updates. |
toolbelt --help |
(none) | (none) | Show global options and available commands. |
Usage
toolbelt --help
toolbelt new python my_service
git add src/
toolbelt commit --dry-run
toolbelt audit .
toolbelt version
toolbelt commit reads staged changes. Use --dry-run to preview a message
without creating a commit.
Feature Tour
1. toolbelt new <type> <name>
Scaffolds a new project directory. When options are omitted, the command prompts for author, license, CI, and Docker choices:
toolbelt new python my_service
Author name [Jane Doe]: Jane Doe
License (MIT | Apache-2.0 | none) [MIT]: MIT
Include CI? (y/n) [True]: y
Include Docker? (y/n) [False]: y
┌──────────────────────────── 🎉 Toolbelt Scaffold ────────────────────────────┐
│ ✨ Project successfully scaffolded! │
│ │
│ Next steps: │
│ cd my_service && make install && make test │
└─────────────────────────────────────────────────────────────────────────────┘
Supported Stacks & Project Layouts
-
Python (
toolbelt new python <name>):src/<name>/__init__.py,main.pytests/test_main.pypyproject.toml(configured with Ruff, MyPy, and Pytest).pre-commit-config.yamlMakefile(install,test,lint,format,clean)README.md,.gitignore, and optionallyLICENSE.github/workflows/ci.ymlwhen CI is enabledDockerfilewhen Docker is enabled
-
Node.js / TypeScript (
toolbelt new node <name>):package.json(TypeScript, ESLint, Prettier, and Vitest dependencies/scripts)tsconfig.jsonsrc/index.ts,src/index.test.ts.eslintrc.json,.prettierrcREADME.md,.gitignore, and optionallyLICENSE
-
Java (
toolbelt new java <name>):pom.xml(Maven, JUnit 5 Jupiter, compiler plugins)src/main/java/com/<name>/App.javasrc/test/java/com/<name>/AppTest.javaREADME.md,.gitignore, and optionallyLICENSE
--yes accepts defaults: the configured Git author (or Developer), MIT license,
CI enabled, and Docker disabled. CI and Docker templates are currently available
for Python projects.
2. toolbelt commit
Reads your staged git diff (git diff --staged) and drafts a Conventional Commit message:
git add src/
toolbelt commit
┌────────────────────────── Proposed Commit Message ──────────────────────────┐
│ feat(auth): add bearer token validator and refresh middleware │
└─────────────────────────────────────────────────────────────────────────────┘
Apply commit? [y/n/edit] (y): y
✅ Commit created successfully!
- Claude integration: Set
ANTHROPIC_API_KEYto draft a message with the Anthropic API (claude-sonnet-4). The staged diff is sent to Anthropic when this is enabled. - Local fallback: Without an API key, a heuristic uses the diff to draft a message without making a network call.
- Dry-run Mode: Preview generated messages without applying commits using
toolbelt commit --dry-run. - Confirmation: Review, edit, or reject the proposed message before committing.
--yesskips confirmation.
Use --type and --scope to provide parts of the commit header:
toolbelt commit --type feat --scope cli
3. toolbelt audit [path]
Performs a structured quality check on any repository:
toolbelt audit .
- Auto-Fix (
--fix): Prompts to create a missing.gitignoreand/or MIT or Apache-2.0LICENSE. It does not repair other failed checks. - JSON Mode (
--json): Outputs machine-readable JSON for integration into reporting tools or CI/CD pipelines. - Exit status: Returns
0when all checks pass and1when one or more checks fail.
4. toolbelt version
Displays installed package version and checks whether updates are available on PyPI:
toolbelt version
Configuration & Environment Variables
The optional ANTHROPIC_API_KEY environment variable is used by toolbelt commit.
The CLI does not load .env files; set the variable in your shell before running
the command.
PowerShell:
$env:ANTHROPIC_API_KEY = "your-api-key"
toolbelt commit
macOS/Linux:
export ANTHROPIC_API_KEY="your-api-key"
toolbelt commit
Without this variable, commit-message generation uses the local fallback.
Architecture & Tech Stack
toolbelt-cli/
├── src/toolbelt/
│ ├── cli.py # Typer application definition and routing
│ ├── commands/ # Subcommand handlers (new, commit, audit, version)
│ ├── services/ # Scaffolder, LLM Commit Generator, and Auditor
│ ├── templates/ # Jinja2 project templates (python, node, java)
│ └── utils/ # Git interface, Rich console helpers
├── tests/ # Full offline pytest test suite with CliRunner
└── .github/workflows/ # CI matrix & PyPI Trusted Publishing release
- CLI Framework: Typer
- Terminal UI: Rich
- Templating: Jinja2
- HTTP Client: HTTPX
- LLM Integration: Anthropic Python SDK
- Quality: Ruff & MyPy
- Testing: Pytest &
CliRunner
Development & Testing
Run the automated test suite locally:
# Run unit and integration tests (100% offline)
pytest -v
# Check linting and style
ruff check .
ruff format --check .
# Run static type analysis
mypy src
Deployments
GitHub Actions manages CI, the documentation site, and PyPI releases:
- CI (
.github/workflows/ci.yml) runs on pushes and pull requests targetingmain. It tests Python 3.11 and 3.12 with Ruff, MyPy, and Pytest. - Documentation (
.github/workflows/pages.yml) deploys the staticdocs/site to GitHub Pages when documentation or its workflow changes onmain; it can also be started manually. In repository settings, Pages must use GitHub Actions as its deployment source. - PyPI release (
.github/workflows/release.yml) runs for tags matchingv*. It builds and checks the package, then publishes using PyPI Trusted Publishing (OIDC).
Configure PyPI Trusted Publishing
Before the first release, register a publisher on PyPI for the toolbelt-cli
project with these exact values:
| PyPI setting | Value |
|---|---|
| Owner | crnjihia |
| Repository | toolbelt-cli |
| Workflow filename | release.yml |
| Environment name | pypi |
The GitHub repository must also have a pypi environment. The build and
distribution checks can pass even when publishing is not configured; in that case,
the publish step fails with an invalid-publisher error. Configure the publisher
in the PyPI project settings. Do not add a PyPI API token to the workflow for this
OIDC setup.
For a release, update the version in pyproject.toml and src/toolbelt/__init__.py,
update CHANGELOG.md, then push a version tag:
git tag v0.3.0
git push origin v0.3.0
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository on GitHub.
- Create a feature branch:
git checkout -b feat/my-new-feature - Ensure tests, lint, formatting, and type checks pass:
pytest -v,ruff check .,ruff format --check ., andmypy src. - Commit your changes using conventional commits:
git commit -m "feat(scope): describe change" - Open a Pull Request.
License
Distributed under the MIT License.
Metadata
Release files for toolbelt-cli 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| toolbelt_cli-0.2.1.tar.gz | 166.9 kB | With provenance | Details for toolbelt_cli-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| toolbelt_cli-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for toolbelt_cli-0.2.1-py3-none-any.whl |
Total release size: 199.3 kB
Release files / toolbelt_cli-0.2.1.tar.gz
| Download URL | toolbelt_cli-0.2.1.tar.gz |
|---|---|
| Size | 166.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98e0e442a9f7e4b9e4bd7132e0425cbd24baf1bcd50279217d9cd2e2695b98fa
|
|
BLAKE2b-256 checksum How to use checksums |
580abbc6c475032976bab823ed66427d28ae347cdad6d5457c4e9ce1552f1b2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / toolbelt_cli-0.2.1-py3-none-any.whl
| Download URL | toolbelt_cli-0.2.1-py3-none-any.whl |
|---|---|
| Size | 32.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38cd318f4ed8c6e438335ce1f1442781e25ec0697cdb7254f805f732bff49335
|
|
BLAKE2b-256 checksum How to use checksums |
793dd388ab7d3473dd52a6fa6c69e68ef2649f80193d261cb1fa2508b5249f4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for toolbelt-cli 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for toolbelt_cli-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.