Skip to main content

Toolbelt CLI

Toolbelt CLI in action

Scaffold projects, draft Conventional Commits, and audit repositories.

Documentation CI status PyPI version Supported Python versions Linted with Ruff Type checked with Mypy MIT License


Table of Contents


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

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.py
    • tests/test_main.py
    • pyproject.toml (configured with Ruff, MyPy, and Pytest)
    • .pre-commit-config.yaml
    • Makefile (install, test, lint, format, clean)
    • README.md, .gitignore, and optionally LICENSE
    • .github/workflows/ci.yml when CI is enabled
    • Dockerfile when Docker is enabled
  • Node.js / TypeScript (toolbelt new node <name>):

    • package.json (TypeScript, ESLint, Prettier, and Vitest dependencies/scripts)
    • tsconfig.json
    • src/index.ts, src/index.test.ts
    • .eslintrc.json, .prettierrc
    • README.md, .gitignore, and optionally LICENSE
  • Java (toolbelt new java <name>):

    • pom.xml (Maven, JUnit 5 Jupiter, compiler plugins)
    • src/main/java/com/<name>/App.java
    • src/test/java/com/<name>/AppTest.java
    • README.md, .gitignore, and optionally LICENSE

--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_KEY to 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. --yes skips 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 .gitignore and/or MIT or Apache-2.0 LICENSE. 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 0 when all checks pass and 1 when 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

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 targeting main. It tests Python 3.11 and 3.12 with Ruff, MyPy, and Pytest.
  • Documentation (.github/workflows/pages.yml) deploys the static docs/ site to GitHub Pages when documentation or its workflow changes on main; 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 matching v*. 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:

  1. Fork the repository on GitHub.
  2. Create a feature branch: git checkout -b feat/my-new-feature
  3. Ensure tests, lint, formatting, and type checks pass: pytest -v, ruff check ., ruff format --check ., and mypy src.
  4. Commit your changes using conventional commits: git commit -m "feat(scope): describe change"
  5. Open a Pull Request.

License

Distributed under the MIT License.

Metadata

Release files for toolbelt-cli 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toolbelt-cli 0.2.4
File Size Uploaded Provenance Actions
toolbelt_cli-0.2.4.tar.gz 167.1 kB With provenance Details for toolbelt_cli-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for toolbelt-cli 0.2.4
File Interpreter ABI Platform Actions
toolbelt_cli-0.2.4-py3-none-any.whl Python 3 none any Details for toolbelt_cli-0.2.4-py3-none-any.whl

Total release size: 199.4 kB

Release files / toolbelt_cli-0.2.4.tar.gz

Download URL toolbelt_cli-0.2.4.tar.gz
Size 167.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b0588c00efdc6b32dba0a66fdb6e8ca0fb8303bf0c7fdb4fdc1cfe3e63d60198
BLAKE2b-256 checksum
How to use checksums
26b05f4c459b14d5d554d2c64425d0d31bf489ce5abf19543e4fe933bea29e48
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 log

Release files / toolbelt_cli-0.2.4-py3-none-any.whl

Download URL toolbelt_cli-0.2.4-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d7099650f88d513d88407d635d3018fcd1536760b788cb3d80f1e946cb2da39
BLAKE2b-256 checksum
How to use checksums
f4c5e6c77ac0cec2df67344fa56f458e59bd7b7c69d8e578bd7f431df993b832
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 log

Security for toolbelt-cli 0.2.4

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.

Select from 2 files

Attestation for toolbelt_cli-0.2.4.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page