toolbelt-cli 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/CHANGELOG.md +8 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/PKG-INFO +91 -105
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/README.md +90 -104
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/pyproject.toml +1 -1
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/__init__.py +1 -1
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/commands/version.py +1 -1
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt_cli.egg-info/PKG-INFO +91 -105
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/.env.example +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/LICENSE +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/MANIFEST.in +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/assets/demo.png +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/setup.cfg +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/cli.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/commands/__init__.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/commands/audit.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/commands/commit.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/commands/new.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/services/__init__.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/services/auditor.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/services/llm.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/services/scaffolder.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/java/.gitignore.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/java/LICENSE.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/java/README.md.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/java/pom.xml.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/java/src/main/java/com/{{project_name}}/App.java.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/java/src/test/java/com/{{project_name}}/AppTest.java.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/.eslintrc.json.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/.gitignore.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/.prettierrc.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/LICENSE.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/README.md.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/package.json.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/src/index.test.ts.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/src/index.ts.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/node/tsconfig.json.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/.github/workflows/ci.yml.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/.gitignore.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/.pre-commit-config.yaml.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/Dockerfile.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/LICENSE.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/Makefile.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/README.md.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/pyproject.toml.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/src/{{project_name}}/__init__.py.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/src/{{project_name}}/main.py.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/tests/test_main.py.j2 +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/utils/__init__.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/utils/console.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/utils/git.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt_cli.egg-info/SOURCES.txt +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt_cli.egg-info/dependency_links.txt +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt_cli.egg-info/entry_points.txt +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt_cli.egg-info/requires.txt +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt_cli.egg-info/top_level.txt +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/tests/test_audit.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/tests/test_commit.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/tests/test_new.py +0 -0
- {toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/tests/test_version.py +0 -0
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.1] - 2026-11-08
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated the README with accurate installation, command usage, configuration, and deployment instructions.
|
|
12
|
+
- Synchronized the docs site and version-command fallback with the package version.
|
|
13
|
+
- Updated GitHub Actions to current Node.js 24-compatible major versions.
|
|
14
|
+
- Restricted CI workflow permissions to read-only repository contents.
|
|
15
|
+
|
|
8
16
|
## [0.2.0] - 2026-10-17
|
|
9
17
|
|
|
10
18
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toolbelt-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A developer productivity CLI that scaffolds projects, generates conventional commit messages with Claude API, and audits repos.
|
|
5
5
|
Author-email: Christopher Njihia <crnjihia@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -42,13 +42,8 @@ Dynamic: license-file
|
|
|
42
42
|
<img src="assets/demo.png" alt="Toolbelt CLI in action" width="800" />
|
|
43
43
|
</p>
|
|
44
44
|
|
|
45
|
-
*The screenshot above demonstrates live execution of Toolbelt CLI in Windows Terminal:*
|
|
46
|
-
1. **`toolbelt --help`**: Rich command overview, argument formatting, and shell completion options.
|
|
47
|
-
2. **`toolbelt version`**: Fast local package version readout and automated PyPI release checking.
|
|
48
|
-
3. **`toolbelt audit .`**: 10-point repository quality audit checking README sections, license files, `.gitignore` entries, test directories, and CI workflows.
|
|
49
|
-
|
|
50
45
|
<p align="center">
|
|
51
|
-
<strong>
|
|
46
|
+
<strong>Scaffold projects, draft Conventional Commits, and audit repositories.</strong>
|
|
52
47
|
</p>
|
|
53
48
|
|
|
54
49
|
<p align="center">
|
|
@@ -67,15 +62,16 @@ Dynamic: license-file
|
|
|
67
62
|
- [Overview](#overview)
|
|
68
63
|
- [Installation](#installation)
|
|
69
64
|
- [Command Reference](#command-reference)
|
|
65
|
+
- [Usage](#usage)
|
|
70
66
|
- [Feature Tour & Usage Examples](#feature-tour)
|
|
71
67
|
- [1. Project Scaffolding (`toolbelt new`)](#1-toolbelt-new-type-name)
|
|
72
68
|
- [2. AI-Powered Commits (`toolbelt commit`)](#2-toolbelt-commit)
|
|
73
69
|
- [3. Repository Auditing (`toolbelt audit`)](#3-toolbelt-audit-path)
|
|
74
|
-
- [4. Version
|
|
70
|
+
- [4. Version Check (`toolbelt version`)](#4-toolbelt-version)
|
|
75
71
|
- [Configuration & Environment Variables](#configuration--environment-variables)
|
|
76
72
|
- [Architecture & Tech Stack](#architecture--tech-stack)
|
|
77
73
|
- [Development & Testing](#development--testing)
|
|
78
|
-
- [
|
|
74
|
+
- [Deployments](#deployments)
|
|
79
75
|
- [Publishing to PyPI](#publishing-to-pypi)
|
|
80
76
|
- [Contributing](#contributing)
|
|
81
77
|
- [License](#license)
|
|
@@ -84,12 +80,10 @@ Dynamic: license-file
|
|
|
84
80
|
|
|
85
81
|
## Overview
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
3. 🔍 **Repository Auditing (`toolbelt audit`)**: Scan any codebase for missing documentation sections (`Installation`, `Usage`, `License`), required configuration files (`.gitignore`, `pyproject.toml`, test suites, CI workflows), and automatically repair missing files with `--fix`.
|
|
92
|
-
4. 📦 **Version & PyPI Sync (`toolbelt version`)**: Inspect currently installed version and verify release availability against the Python Package Index.
|
|
83
|
+
Toolbelt CLI is a Python 3.11+ command-line utility built with Typer, Rich, and
|
|
84
|
+
Jinja2. It provides starter templates for Python, Node.js/TypeScript, and Java,
|
|
85
|
+
commit-message drafting from staged Git changes, repository checks, and an
|
|
86
|
+
optional PyPI update check.
|
|
93
87
|
|
|
94
88
|
---
|
|
95
89
|
|
|
@@ -112,13 +106,15 @@ uv tool install toolbelt-cli
|
|
|
112
106
|
pip install toolbelt-cli
|
|
113
107
|
```
|
|
114
108
|
|
|
115
|
-
###
|
|
109
|
+
### Install from source
|
|
116
110
|
```bash
|
|
117
111
|
git clone https://github.com/crnjihia/toolbelt-cli.git
|
|
118
112
|
cd toolbelt-cli
|
|
119
113
|
pip install -e ".[dev]"
|
|
120
114
|
```
|
|
121
115
|
|
|
116
|
+
The installation provides both `toolbelt` and `zana` command names.
|
|
117
|
+
|
|
122
118
|
---
|
|
123
119
|
|
|
124
120
|
## Command Reference
|
|
@@ -133,10 +129,25 @@ pip install -e ".[dev]"
|
|
|
133
129
|
|
|
134
130
|
---
|
|
135
131
|
|
|
132
|
+
## Usage
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
toolbelt --help
|
|
136
|
+
toolbelt new python my_service
|
|
137
|
+
git add src/
|
|
138
|
+
toolbelt commit --dry-run
|
|
139
|
+
toolbelt audit .
|
|
140
|
+
toolbelt version
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`toolbelt commit` reads staged changes. Use `--dry-run` to preview a message
|
|
144
|
+
without creating a commit.
|
|
145
|
+
|
|
136
146
|
## Feature Tour
|
|
137
147
|
|
|
138
148
|
### 1. `toolbelt new <type> <name>`
|
|
139
|
-
Scaffolds a new project directory
|
|
149
|
+
Scaffolds a new project directory. When options are omitted, the command prompts
|
|
150
|
+
for author, license, CI, and Docker choices:
|
|
140
151
|
|
|
141
152
|
```bash
|
|
142
153
|
toolbelt new python my_service
|
|
@@ -164,22 +175,26 @@ Include Docker? (y/n) [False]: y
|
|
|
164
175
|
- `pyproject.toml` (configured with Ruff, MyPy, and Pytest)
|
|
165
176
|
- `.pre-commit-config.yaml`
|
|
166
177
|
- `Makefile` (`install`, `test`, `lint`, `format`, `clean`)
|
|
167
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
168
|
-
- `.github/workflows/ci.yml`
|
|
169
|
-
- `Dockerfile`
|
|
178
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
179
|
+
- `.github/workflows/ci.yml` when CI is enabled
|
|
180
|
+
- `Dockerfile` when Docker is enabled
|
|
170
181
|
|
|
171
182
|
- **Node.js / TypeScript (`toolbelt new node <name>`)**:
|
|
172
|
-
- `package.json` (TypeScript, ESLint, Prettier, Vitest)
|
|
183
|
+
- `package.json` (TypeScript, ESLint, Prettier, and Vitest dependencies/scripts)
|
|
173
184
|
- `tsconfig.json`
|
|
174
185
|
- `src/index.ts`, `src/index.test.ts`
|
|
175
186
|
- `.eslintrc.json`, `.prettierrc`
|
|
176
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
187
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
177
188
|
|
|
178
189
|
- **Java (`toolbelt new java <name>`)**:
|
|
179
190
|
- `pom.xml` (Maven, JUnit 5 Jupiter, compiler plugins)
|
|
180
191
|
- `src/main/java/com/<name>/App.java`
|
|
181
192
|
- `src/test/java/com/<name>/AppTest.java`
|
|
182
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
193
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
194
|
+
|
|
195
|
+
`--yes` accepts defaults: the configured Git author (or `Developer`), MIT license,
|
|
196
|
+
CI enabled, and Docker disabled. CI and Docker templates are currently available
|
|
197
|
+
for Python projects.
|
|
183
198
|
|
|
184
199
|
---
|
|
185
200
|
|
|
@@ -199,10 +214,16 @@ Apply commit? [y/n/edit] (y): y
|
|
|
199
214
|
✅ Commit created successfully!
|
|
200
215
|
```
|
|
201
216
|
|
|
202
|
-
- **Claude
|
|
203
|
-
- **
|
|
217
|
+
- **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.
|
|
218
|
+
- **Local fallback**: Without an API key, a heuristic uses the diff to draft a message without making a network call.
|
|
204
219
|
- **Dry-run Mode**: Preview generated messages without applying commits using `toolbelt commit --dry-run`.
|
|
205
|
-
- **
|
|
220
|
+
- **Confirmation**: Review, edit, or reject the proposed message before committing. `--yes` skips confirmation.
|
|
221
|
+
|
|
222
|
+
Use `--type` and `--scope` to provide parts of the commit header:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
toolbelt commit --type feat --scope cli
|
|
226
|
+
```
|
|
206
227
|
|
|
207
228
|
---
|
|
208
229
|
|
|
@@ -213,27 +234,9 @@ Performs a structured quality check on any repository:
|
|
|
213
234
|
toolbelt audit .
|
|
214
235
|
```
|
|
215
236
|
|
|
216
|
-
|
|
217
|
-
Repository Audit: Toolbelt-CLI
|
|
218
|
-
┌────────────────────────────┬──────────┬──────────────────────────┐
|
|
219
|
-
│ Check │ Status │ Details │
|
|
220
|
-
├────────────────────────────┼──────────┼──────────────────────────┤
|
|
221
|
-
│ README.md exists │ ✅ │ 227 lines │
|
|
222
|
-
│ README has Install │ ✅ │ found "## Installation" │
|
|
223
|
-
│ README has Usage │ ✅ │ found "## Usage" │
|
|
224
|
-
│ README has License │ ✅ │ found "## License" │
|
|
225
|
-
│ LICENSE file │ ✅ │ MIT │
|
|
226
|
-
│ .gitignore exists │ ✅ │ 29 entries │
|
|
227
|
-
│ .gitignore has __pycache__ │ ✅ │ │
|
|
228
|
-
│ Tests directory │ ✅ │ tests/ found │
|
|
229
|
-
│ CI config │ ✅ │ .github/workflows/ci.yml │
|
|
230
|
-
│ pyproject.toml │ ✅ │ │
|
|
231
|
-
└────────────────────────────┴──────────┴──────────────────────────┘
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
- **Exit Code**: Returns `0` if all checks pass, and `1` if any check fails (ready for pre-commit hooks and CI gates).
|
|
235
|
-
- **Auto-Fix (`--fix`)**: Automatically prompts to create missing `.gitignore` files and `LICENSE` files (MIT or Apache-2.0).
|
|
237
|
+
- **Auto-Fix (`--fix`)**: Prompts to create a missing `.gitignore` and/or MIT or Apache-2.0 `LICENSE`. It does not repair other failed checks.
|
|
236
238
|
- **JSON Mode (`--json`)**: Outputs machine-readable JSON for integration into reporting tools or CI/CD pipelines.
|
|
239
|
+
- **Exit status**: Returns `0` when all checks pass and `1` when one or more checks fail.
|
|
237
240
|
|
|
238
241
|
---
|
|
239
242
|
|
|
@@ -248,16 +251,26 @@ toolbelt version
|
|
|
248
251
|
|
|
249
252
|
## Configuration & Environment Variables
|
|
250
253
|
|
|
251
|
-
|
|
254
|
+
The optional `ANTHROPIC_API_KEY` environment variable is used by `toolbelt commit`.
|
|
255
|
+
The CLI does not load `.env` files; set the variable in your shell before running
|
|
256
|
+
the command.
|
|
252
257
|
|
|
253
|
-
|
|
254
|
-
# Optional: Set Claude API key for AI-assisted git commit message generation
|
|
255
|
-
ANTHROPIC_API_KEY=sk-ant-api03-...
|
|
258
|
+
PowerShell:
|
|
256
259
|
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
```powershell
|
|
261
|
+
$env:ANTHROPIC_API_KEY = "your-api-key"
|
|
262
|
+
toolbelt commit
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
macOS/Linux:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
export ANTHROPIC_API_KEY="your-api-key"
|
|
269
|
+
toolbelt commit
|
|
259
270
|
```
|
|
260
271
|
|
|
272
|
+
Without this variable, commit-message generation uses the local fallback.
|
|
273
|
+
|
|
261
274
|
---
|
|
262
275
|
|
|
263
276
|
## Architecture & Tech Stack
|
|
@@ -302,66 +315,39 @@ mypy src
|
|
|
302
315
|
|
|
303
316
|
---
|
|
304
317
|
|
|
305
|
-
##
|
|
306
|
-
|
|
307
|
-
Follow these steps to publish this repository to your personal or organization GitHub account:
|
|
318
|
+
## Deployments
|
|
308
319
|
|
|
309
|
-
|
|
310
|
-
Create a new repository named `toolbelt-cli` on [GitHub](https://github.com/new) (leave "Initialize with README" unchecked). Then connect your local repository:
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
# Add your GitHub remote
|
|
314
|
-
git remote add origin https://github.com/crnjihia/toolbelt-cli.git
|
|
320
|
+
GitHub Actions manages CI, the documentation site, and PyPI releases:
|
|
315
321
|
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
- **CI** ([`.github/workflows/ci.yml`](.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.
|
|
323
|
+
- **Documentation** ([`.github/workflows/pages.yml`](.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.
|
|
324
|
+
- **PyPI release** ([`.github/workflows/release.yml`](.github/workflows/release.yml)) runs for tags matching `v*`. It builds and checks the package, then publishes using PyPI Trusted Publishing (OIDC).
|
|
318
325
|
|
|
319
|
-
|
|
320
|
-
git push -u origin main
|
|
321
|
-
```
|
|
326
|
+
### Configure PyPI Trusted Publishing
|
|
322
327
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
1. Log into your [PyPI](https://pypi.org/) account.
|
|
327
|
-
2. Navigate to **Account settings** → **Publishing** → **Add a GitHub publisher**.
|
|
328
|
-
3. Set:
|
|
329
|
-
- **PyPI Project Name**: `toolbelt-cli`
|
|
330
|
-
- **Owner**: `crnjihia`
|
|
331
|
-
- **Repository name**: `toolbelt-cli`
|
|
332
|
-
- **Workflow name**: `release.yml`
|
|
333
|
-
- **Environment name**: `pypi`
|
|
334
|
-
4. In your GitHub repository, ensure the `pypi` environment is enabled under **Settings** → **Environments**.
|
|
335
|
-
5. When ready to release, simply tag and push:
|
|
336
|
-
```bash
|
|
337
|
-
git tag v0.1.0
|
|
338
|
-
git push origin v0.1.0
|
|
339
|
-
```
|
|
340
|
-
GitHub Actions will automatically build source distributions and wheels, run `twine check`, and publish to PyPI!
|
|
341
|
-
|
|
342
|
-
### 3. Continuous Integration Checks
|
|
343
|
-
On every push and pull request, [`.github/workflows/ci.yml`](.github/workflows/ci.yml) automatically executes:
|
|
344
|
-
- Matrix testing across Python **3.11** and **3.12**.
|
|
345
|
-
- Fast code hygiene validation via `ruff check .`.
|
|
346
|
-
- Code format verification via `ruff format --check .`.
|
|
347
|
-
- Static type analysis via `mypy src`.
|
|
348
|
-
- Complete test suite execution via `pytest -v` (19 offline tests with 100% pass guarantee).
|
|
328
|
+
Before the first release, register a publisher on PyPI for the **`toolbelt-cli`**
|
|
329
|
+
project with these exact values:
|
|
349
330
|
|
|
350
|
-
|
|
331
|
+
| PyPI setting | Value |
|
|
332
|
+
|---|---|
|
|
333
|
+
| Owner | `crnjihia` |
|
|
334
|
+
| Repository | `toolbelt-cli` |
|
|
335
|
+
| Workflow filename | `release.yml` |
|
|
336
|
+
| Environment name | `pypi` |
|
|
351
337
|
|
|
352
|
-
|
|
338
|
+
The GitHub repository must also have a `pypi` environment. The build and
|
|
339
|
+
distribution checks can pass even when publishing is not configured; in that case,
|
|
340
|
+
the publish step fails with an `invalid-publisher` error. Configure the publisher
|
|
341
|
+
in the PyPI project settings. Do not add a PyPI API token to the workflow for this
|
|
342
|
+
OIDC setup.
|
|
353
343
|
|
|
354
|
-
|
|
344
|
+
For a release, update the version in `pyproject.toml` and `src/toolbelt/__init__.py`,
|
|
345
|
+
update `CHANGELOG.md`, then push a version tag:
|
|
355
346
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
git tag v0.1.0
|
|
362
|
-
git push origin v0.1.0
|
|
363
|
-
```
|
|
364
|
-
4. The `.github/workflows/release.yml` workflow will automatically build wheels and sdist distributions and publish them directly to PyPI.
|
|
347
|
+
```bash
|
|
348
|
+
git tag v0.3.0
|
|
349
|
+
git push origin v0.3.0
|
|
350
|
+
```
|
|
365
351
|
|
|
366
352
|
---
|
|
367
353
|
|
|
@@ -371,7 +357,7 @@ Contributions are welcome! Please follow these steps:
|
|
|
371
357
|
|
|
372
358
|
1. Fork the repository on GitHub.
|
|
373
359
|
2. Create a feature branch: `git checkout -b feat/my-new-feature`
|
|
374
|
-
3. Ensure
|
|
360
|
+
3. Ensure tests, lint, formatting, and type checks pass: `pytest -v`, `ruff check .`, `ruff format --check .`, and `mypy src`.
|
|
375
361
|
4. Commit your changes using conventional commits: `git commit -m "feat(scope): describe change"`
|
|
376
362
|
5. Open a Pull Request.
|
|
377
363
|
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
<img src="assets/demo.png" alt="Toolbelt CLI in action" width="800" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
*The screenshot above demonstrates live execution of Toolbelt CLI in Windows Terminal:*
|
|
8
|
-
1. **`toolbelt --help`**: Rich command overview, argument formatting, and shell completion options.
|
|
9
|
-
2. **`toolbelt version`**: Fast local package version readout and automated PyPI release checking.
|
|
10
|
-
3. **`toolbelt audit .`**: 10-point repository quality audit checking README sections, license files, `.gitignore` entries, test directories, and CI workflows.
|
|
11
|
-
|
|
12
7
|
<p align="center">
|
|
13
|
-
<strong>
|
|
8
|
+
<strong>Scaffold projects, draft Conventional Commits, and audit repositories.</strong>
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
11
|
<p align="center">
|
|
@@ -29,15 +24,16 @@
|
|
|
29
24
|
- [Overview](#overview)
|
|
30
25
|
- [Installation](#installation)
|
|
31
26
|
- [Command Reference](#command-reference)
|
|
27
|
+
- [Usage](#usage)
|
|
32
28
|
- [Feature Tour & Usage Examples](#feature-tour)
|
|
33
29
|
- [1. Project Scaffolding (`toolbelt new`)](#1-toolbelt-new-type-name)
|
|
34
30
|
- [2. AI-Powered Commits (`toolbelt commit`)](#2-toolbelt-commit)
|
|
35
31
|
- [3. Repository Auditing (`toolbelt audit`)](#3-toolbelt-audit-path)
|
|
36
|
-
- [4. Version
|
|
32
|
+
- [4. Version Check (`toolbelt version`)](#4-toolbelt-version)
|
|
37
33
|
- [Configuration & Environment Variables](#configuration--environment-variables)
|
|
38
34
|
- [Architecture & Tech Stack](#architecture--tech-stack)
|
|
39
35
|
- [Development & Testing](#development--testing)
|
|
40
|
-
- [
|
|
36
|
+
- [Deployments](#deployments)
|
|
41
37
|
- [Publishing to PyPI](#publishing-to-pypi)
|
|
42
38
|
- [Contributing](#contributing)
|
|
43
39
|
- [License](#license)
|
|
@@ -46,12 +42,10 @@
|
|
|
46
42
|
|
|
47
43
|
## Overview
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
3. 🔍 **Repository Auditing (`toolbelt audit`)**: Scan any codebase for missing documentation sections (`Installation`, `Usage`, `License`), required configuration files (`.gitignore`, `pyproject.toml`, test suites, CI workflows), and automatically repair missing files with `--fix`.
|
|
54
|
-
4. 📦 **Version & PyPI Sync (`toolbelt version`)**: Inspect currently installed version and verify release availability against the Python Package Index.
|
|
45
|
+
Toolbelt CLI is a Python 3.11+ command-line utility built with Typer, Rich, and
|
|
46
|
+
Jinja2. It provides starter templates for Python, Node.js/TypeScript, and Java,
|
|
47
|
+
commit-message drafting from staged Git changes, repository checks, and an
|
|
48
|
+
optional PyPI update check.
|
|
55
49
|
|
|
56
50
|
---
|
|
57
51
|
|
|
@@ -74,13 +68,15 @@ uv tool install toolbelt-cli
|
|
|
74
68
|
pip install toolbelt-cli
|
|
75
69
|
```
|
|
76
70
|
|
|
77
|
-
###
|
|
71
|
+
### Install from source
|
|
78
72
|
```bash
|
|
79
73
|
git clone https://github.com/crnjihia/toolbelt-cli.git
|
|
80
74
|
cd toolbelt-cli
|
|
81
75
|
pip install -e ".[dev]"
|
|
82
76
|
```
|
|
83
77
|
|
|
78
|
+
The installation provides both `toolbelt` and `zana` command names.
|
|
79
|
+
|
|
84
80
|
---
|
|
85
81
|
|
|
86
82
|
## Command Reference
|
|
@@ -95,10 +91,25 @@ pip install -e ".[dev]"
|
|
|
95
91
|
|
|
96
92
|
---
|
|
97
93
|
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
toolbelt --help
|
|
98
|
+
toolbelt new python my_service
|
|
99
|
+
git add src/
|
|
100
|
+
toolbelt commit --dry-run
|
|
101
|
+
toolbelt audit .
|
|
102
|
+
toolbelt version
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`toolbelt commit` reads staged changes. Use `--dry-run` to preview a message
|
|
106
|
+
without creating a commit.
|
|
107
|
+
|
|
98
108
|
## Feature Tour
|
|
99
109
|
|
|
100
110
|
### 1. `toolbelt new <type> <name>`
|
|
101
|
-
Scaffolds a new project directory
|
|
111
|
+
Scaffolds a new project directory. When options are omitted, the command prompts
|
|
112
|
+
for author, license, CI, and Docker choices:
|
|
102
113
|
|
|
103
114
|
```bash
|
|
104
115
|
toolbelt new python my_service
|
|
@@ -126,22 +137,26 @@ Include Docker? (y/n) [False]: y
|
|
|
126
137
|
- `pyproject.toml` (configured with Ruff, MyPy, and Pytest)
|
|
127
138
|
- `.pre-commit-config.yaml`
|
|
128
139
|
- `Makefile` (`install`, `test`, `lint`, `format`, `clean`)
|
|
129
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
130
|
-
- `.github/workflows/ci.yml`
|
|
131
|
-
- `Dockerfile`
|
|
140
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
141
|
+
- `.github/workflows/ci.yml` when CI is enabled
|
|
142
|
+
- `Dockerfile` when Docker is enabled
|
|
132
143
|
|
|
133
144
|
- **Node.js / TypeScript (`toolbelt new node <name>`)**:
|
|
134
|
-
- `package.json` (TypeScript, ESLint, Prettier, Vitest)
|
|
145
|
+
- `package.json` (TypeScript, ESLint, Prettier, and Vitest dependencies/scripts)
|
|
135
146
|
- `tsconfig.json`
|
|
136
147
|
- `src/index.ts`, `src/index.test.ts`
|
|
137
148
|
- `.eslintrc.json`, `.prettierrc`
|
|
138
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
149
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
139
150
|
|
|
140
151
|
- **Java (`toolbelt new java <name>`)**:
|
|
141
152
|
- `pom.xml` (Maven, JUnit 5 Jupiter, compiler plugins)
|
|
142
153
|
- `src/main/java/com/<name>/App.java`
|
|
143
154
|
- `src/test/java/com/<name>/AppTest.java`
|
|
144
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
155
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
156
|
+
|
|
157
|
+
`--yes` accepts defaults: the configured Git author (or `Developer`), MIT license,
|
|
158
|
+
CI enabled, and Docker disabled. CI and Docker templates are currently available
|
|
159
|
+
for Python projects.
|
|
145
160
|
|
|
146
161
|
---
|
|
147
162
|
|
|
@@ -161,10 +176,16 @@ Apply commit? [y/n/edit] (y): y
|
|
|
161
176
|
✅ Commit created successfully!
|
|
162
177
|
```
|
|
163
178
|
|
|
164
|
-
- **Claude
|
|
165
|
-
- **
|
|
179
|
+
- **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.
|
|
180
|
+
- **Local fallback**: Without an API key, a heuristic uses the diff to draft a message without making a network call.
|
|
166
181
|
- **Dry-run Mode**: Preview generated messages without applying commits using `toolbelt commit --dry-run`.
|
|
167
|
-
- **
|
|
182
|
+
- **Confirmation**: Review, edit, or reject the proposed message before committing. `--yes` skips confirmation.
|
|
183
|
+
|
|
184
|
+
Use `--type` and `--scope` to provide parts of the commit header:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
toolbelt commit --type feat --scope cli
|
|
188
|
+
```
|
|
168
189
|
|
|
169
190
|
---
|
|
170
191
|
|
|
@@ -175,27 +196,9 @@ Performs a structured quality check on any repository:
|
|
|
175
196
|
toolbelt audit .
|
|
176
197
|
```
|
|
177
198
|
|
|
178
|
-
|
|
179
|
-
Repository Audit: Toolbelt-CLI
|
|
180
|
-
┌────────────────────────────┬──────────┬──────────────────────────┐
|
|
181
|
-
│ Check │ Status │ Details │
|
|
182
|
-
├────────────────────────────┼──────────┼──────────────────────────┤
|
|
183
|
-
│ README.md exists │ ✅ │ 227 lines │
|
|
184
|
-
│ README has Install │ ✅ │ found "## Installation" │
|
|
185
|
-
│ README has Usage │ ✅ │ found "## Usage" │
|
|
186
|
-
│ README has License │ ✅ │ found "## License" │
|
|
187
|
-
│ LICENSE file │ ✅ │ MIT │
|
|
188
|
-
│ .gitignore exists │ ✅ │ 29 entries │
|
|
189
|
-
│ .gitignore has __pycache__ │ ✅ │ │
|
|
190
|
-
│ Tests directory │ ✅ │ tests/ found │
|
|
191
|
-
│ CI config │ ✅ │ .github/workflows/ci.yml │
|
|
192
|
-
│ pyproject.toml │ ✅ │ │
|
|
193
|
-
└────────────────────────────┴──────────┴──────────────────────────┘
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
- **Exit Code**: Returns `0` if all checks pass, and `1` if any check fails (ready for pre-commit hooks and CI gates).
|
|
197
|
-
- **Auto-Fix (`--fix`)**: Automatically prompts to create missing `.gitignore` files and `LICENSE` files (MIT or Apache-2.0).
|
|
199
|
+
- **Auto-Fix (`--fix`)**: Prompts to create a missing `.gitignore` and/or MIT or Apache-2.0 `LICENSE`. It does not repair other failed checks.
|
|
198
200
|
- **JSON Mode (`--json`)**: Outputs machine-readable JSON for integration into reporting tools or CI/CD pipelines.
|
|
201
|
+
- **Exit status**: Returns `0` when all checks pass and `1` when one or more checks fail.
|
|
199
202
|
|
|
200
203
|
---
|
|
201
204
|
|
|
@@ -210,16 +213,26 @@ toolbelt version
|
|
|
210
213
|
|
|
211
214
|
## Configuration & Environment Variables
|
|
212
215
|
|
|
213
|
-
|
|
216
|
+
The optional `ANTHROPIC_API_KEY` environment variable is used by `toolbelt commit`.
|
|
217
|
+
The CLI does not load `.env` files; set the variable in your shell before running
|
|
218
|
+
the command.
|
|
214
219
|
|
|
215
|
-
|
|
216
|
-
# Optional: Set Claude API key for AI-assisted git commit message generation
|
|
217
|
-
ANTHROPIC_API_KEY=sk-ant-api03-...
|
|
220
|
+
PowerShell:
|
|
218
221
|
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
```powershell
|
|
223
|
+
$env:ANTHROPIC_API_KEY = "your-api-key"
|
|
224
|
+
toolbelt commit
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
macOS/Linux:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
export ANTHROPIC_API_KEY="your-api-key"
|
|
231
|
+
toolbelt commit
|
|
221
232
|
```
|
|
222
233
|
|
|
234
|
+
Without this variable, commit-message generation uses the local fallback.
|
|
235
|
+
|
|
223
236
|
---
|
|
224
237
|
|
|
225
238
|
## Architecture & Tech Stack
|
|
@@ -264,66 +277,39 @@ mypy src
|
|
|
264
277
|
|
|
265
278
|
---
|
|
266
279
|
|
|
267
|
-
##
|
|
268
|
-
|
|
269
|
-
Follow these steps to publish this repository to your personal or organization GitHub account:
|
|
280
|
+
## Deployments
|
|
270
281
|
|
|
271
|
-
|
|
272
|
-
Create a new repository named `toolbelt-cli` on [GitHub](https://github.com/new) (leave "Initialize with README" unchecked). Then connect your local repository:
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
# Add your GitHub remote
|
|
276
|
-
git remote add origin https://github.com/crnjihia/toolbelt-cli.git
|
|
282
|
+
GitHub Actions manages CI, the documentation site, and PyPI releases:
|
|
277
283
|
|
|
278
|
-
|
|
279
|
-
|
|
284
|
+
- **CI** ([`.github/workflows/ci.yml`](.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.
|
|
285
|
+
- **Documentation** ([`.github/workflows/pages.yml`](.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.
|
|
286
|
+
- **PyPI release** ([`.github/workflows/release.yml`](.github/workflows/release.yml)) runs for tags matching `v*`. It builds and checks the package, then publishes using PyPI Trusted Publishing (OIDC).
|
|
280
287
|
|
|
281
|
-
|
|
282
|
-
git push -u origin main
|
|
283
|
-
```
|
|
288
|
+
### Configure PyPI Trusted Publishing
|
|
284
289
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
1. Log into your [PyPI](https://pypi.org/) account.
|
|
289
|
-
2. Navigate to **Account settings** → **Publishing** → **Add a GitHub publisher**.
|
|
290
|
-
3. Set:
|
|
291
|
-
- **PyPI Project Name**: `toolbelt-cli`
|
|
292
|
-
- **Owner**: `crnjihia`
|
|
293
|
-
- **Repository name**: `toolbelt-cli`
|
|
294
|
-
- **Workflow name**: `release.yml`
|
|
295
|
-
- **Environment name**: `pypi`
|
|
296
|
-
4. In your GitHub repository, ensure the `pypi` environment is enabled under **Settings** → **Environments**.
|
|
297
|
-
5. When ready to release, simply tag and push:
|
|
298
|
-
```bash
|
|
299
|
-
git tag v0.1.0
|
|
300
|
-
git push origin v0.1.0
|
|
301
|
-
```
|
|
302
|
-
GitHub Actions will automatically build source distributions and wheels, run `twine check`, and publish to PyPI!
|
|
303
|
-
|
|
304
|
-
### 3. Continuous Integration Checks
|
|
305
|
-
On every push and pull request, [`.github/workflows/ci.yml`](.github/workflows/ci.yml) automatically executes:
|
|
306
|
-
- Matrix testing across Python **3.11** and **3.12**.
|
|
307
|
-
- Fast code hygiene validation via `ruff check .`.
|
|
308
|
-
- Code format verification via `ruff format --check .`.
|
|
309
|
-
- Static type analysis via `mypy src`.
|
|
310
|
-
- Complete test suite execution via `pytest -v` (19 offline tests with 100% pass guarantee).
|
|
290
|
+
Before the first release, register a publisher on PyPI for the **`toolbelt-cli`**
|
|
291
|
+
project with these exact values:
|
|
311
292
|
|
|
312
|
-
|
|
293
|
+
| PyPI setting | Value |
|
|
294
|
+
|---|---|
|
|
295
|
+
| Owner | `crnjihia` |
|
|
296
|
+
| Repository | `toolbelt-cli` |
|
|
297
|
+
| Workflow filename | `release.yml` |
|
|
298
|
+
| Environment name | `pypi` |
|
|
313
299
|
|
|
314
|
-
|
|
300
|
+
The GitHub repository must also have a `pypi` environment. The build and
|
|
301
|
+
distribution checks can pass even when publishing is not configured; in that case,
|
|
302
|
+
the publish step fails with an `invalid-publisher` error. Configure the publisher
|
|
303
|
+
in the PyPI project settings. Do not add a PyPI API token to the workflow for this
|
|
304
|
+
OIDC setup.
|
|
315
305
|
|
|
316
|
-
|
|
306
|
+
For a release, update the version in `pyproject.toml` and `src/toolbelt/__init__.py`,
|
|
307
|
+
update `CHANGELOG.md`, then push a version tag:
|
|
317
308
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
```bash
|
|
323
|
-
git tag v0.1.0
|
|
324
|
-
git push origin v0.1.0
|
|
325
|
-
```
|
|
326
|
-
4. The `.github/workflows/release.yml` workflow will automatically build wheels and sdist distributions and publish them directly to PyPI.
|
|
309
|
+
```bash
|
|
310
|
+
git tag v0.3.0
|
|
311
|
+
git push origin v0.3.0
|
|
312
|
+
```
|
|
327
313
|
|
|
328
314
|
---
|
|
329
315
|
|
|
@@ -333,7 +319,7 @@ Contributions are welcome! Please follow these steps:
|
|
|
333
319
|
|
|
334
320
|
1. Fork the repository on GitHub.
|
|
335
321
|
2. Create a feature branch: `git checkout -b feat/my-new-feature`
|
|
336
|
-
3. Ensure
|
|
322
|
+
3. Ensure tests, lint, formatting, and type checks pass: `pytest -v`, `ruff check .`, `ruff format --check .`, and `mypy src`.
|
|
337
323
|
4. Commit your changes using conventional commits: `git commit -m "feat(scope): describe change"`
|
|
338
324
|
5. Open a Pull Request.
|
|
339
325
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "toolbelt-cli"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "A developer productivity CLI that scaffolds projects, generates conventional commit messages with Claude API, and audits repos."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Christopher Njihia", email = "crnjihia@gmail.com" }]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toolbelt-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A developer productivity CLI that scaffolds projects, generates conventional commit messages with Claude API, and audits repos.
|
|
5
5
|
Author-email: Christopher Njihia <crnjihia@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -42,13 +42,8 @@ Dynamic: license-file
|
|
|
42
42
|
<img src="assets/demo.png" alt="Toolbelt CLI in action" width="800" />
|
|
43
43
|
</p>
|
|
44
44
|
|
|
45
|
-
*The screenshot above demonstrates live execution of Toolbelt CLI in Windows Terminal:*
|
|
46
|
-
1. **`toolbelt --help`**: Rich command overview, argument formatting, and shell completion options.
|
|
47
|
-
2. **`toolbelt version`**: Fast local package version readout and automated PyPI release checking.
|
|
48
|
-
3. **`toolbelt audit .`**: 10-point repository quality audit checking README sections, license files, `.gitignore` entries, test directories, and CI workflows.
|
|
49
|
-
|
|
50
45
|
<p align="center">
|
|
51
|
-
<strong>
|
|
46
|
+
<strong>Scaffold projects, draft Conventional Commits, and audit repositories.</strong>
|
|
52
47
|
</p>
|
|
53
48
|
|
|
54
49
|
<p align="center">
|
|
@@ -67,15 +62,16 @@ Dynamic: license-file
|
|
|
67
62
|
- [Overview](#overview)
|
|
68
63
|
- [Installation](#installation)
|
|
69
64
|
- [Command Reference](#command-reference)
|
|
65
|
+
- [Usage](#usage)
|
|
70
66
|
- [Feature Tour & Usage Examples](#feature-tour)
|
|
71
67
|
- [1. Project Scaffolding (`toolbelt new`)](#1-toolbelt-new-type-name)
|
|
72
68
|
- [2. AI-Powered Commits (`toolbelt commit`)](#2-toolbelt-commit)
|
|
73
69
|
- [3. Repository Auditing (`toolbelt audit`)](#3-toolbelt-audit-path)
|
|
74
|
-
- [4. Version
|
|
70
|
+
- [4. Version Check (`toolbelt version`)](#4-toolbelt-version)
|
|
75
71
|
- [Configuration & Environment Variables](#configuration--environment-variables)
|
|
76
72
|
- [Architecture & Tech Stack](#architecture--tech-stack)
|
|
77
73
|
- [Development & Testing](#development--testing)
|
|
78
|
-
- [
|
|
74
|
+
- [Deployments](#deployments)
|
|
79
75
|
- [Publishing to PyPI](#publishing-to-pypi)
|
|
80
76
|
- [Contributing](#contributing)
|
|
81
77
|
- [License](#license)
|
|
@@ -84,12 +80,10 @@ Dynamic: license-file
|
|
|
84
80
|
|
|
85
81
|
## Overview
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
3. 🔍 **Repository Auditing (`toolbelt audit`)**: Scan any codebase for missing documentation sections (`Installation`, `Usage`, `License`), required configuration files (`.gitignore`, `pyproject.toml`, test suites, CI workflows), and automatically repair missing files with `--fix`.
|
|
92
|
-
4. 📦 **Version & PyPI Sync (`toolbelt version`)**: Inspect currently installed version and verify release availability against the Python Package Index.
|
|
83
|
+
Toolbelt CLI is a Python 3.11+ command-line utility built with Typer, Rich, and
|
|
84
|
+
Jinja2. It provides starter templates for Python, Node.js/TypeScript, and Java,
|
|
85
|
+
commit-message drafting from staged Git changes, repository checks, and an
|
|
86
|
+
optional PyPI update check.
|
|
93
87
|
|
|
94
88
|
---
|
|
95
89
|
|
|
@@ -112,13 +106,15 @@ uv tool install toolbelt-cli
|
|
|
112
106
|
pip install toolbelt-cli
|
|
113
107
|
```
|
|
114
108
|
|
|
115
|
-
###
|
|
109
|
+
### Install from source
|
|
116
110
|
```bash
|
|
117
111
|
git clone https://github.com/crnjihia/toolbelt-cli.git
|
|
118
112
|
cd toolbelt-cli
|
|
119
113
|
pip install -e ".[dev]"
|
|
120
114
|
```
|
|
121
115
|
|
|
116
|
+
The installation provides both `toolbelt` and `zana` command names.
|
|
117
|
+
|
|
122
118
|
---
|
|
123
119
|
|
|
124
120
|
## Command Reference
|
|
@@ -133,10 +129,25 @@ pip install -e ".[dev]"
|
|
|
133
129
|
|
|
134
130
|
---
|
|
135
131
|
|
|
132
|
+
## Usage
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
toolbelt --help
|
|
136
|
+
toolbelt new python my_service
|
|
137
|
+
git add src/
|
|
138
|
+
toolbelt commit --dry-run
|
|
139
|
+
toolbelt audit .
|
|
140
|
+
toolbelt version
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`toolbelt commit` reads staged changes. Use `--dry-run` to preview a message
|
|
144
|
+
without creating a commit.
|
|
145
|
+
|
|
136
146
|
## Feature Tour
|
|
137
147
|
|
|
138
148
|
### 1. `toolbelt new <type> <name>`
|
|
139
|
-
Scaffolds a new project directory
|
|
149
|
+
Scaffolds a new project directory. When options are omitted, the command prompts
|
|
150
|
+
for author, license, CI, and Docker choices:
|
|
140
151
|
|
|
141
152
|
```bash
|
|
142
153
|
toolbelt new python my_service
|
|
@@ -164,22 +175,26 @@ Include Docker? (y/n) [False]: y
|
|
|
164
175
|
- `pyproject.toml` (configured with Ruff, MyPy, and Pytest)
|
|
165
176
|
- `.pre-commit-config.yaml`
|
|
166
177
|
- `Makefile` (`install`, `test`, `lint`, `format`, `clean`)
|
|
167
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
168
|
-
- `.github/workflows/ci.yml`
|
|
169
|
-
- `Dockerfile`
|
|
178
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
179
|
+
- `.github/workflows/ci.yml` when CI is enabled
|
|
180
|
+
- `Dockerfile` when Docker is enabled
|
|
170
181
|
|
|
171
182
|
- **Node.js / TypeScript (`toolbelt new node <name>`)**:
|
|
172
|
-
- `package.json` (TypeScript, ESLint, Prettier, Vitest)
|
|
183
|
+
- `package.json` (TypeScript, ESLint, Prettier, and Vitest dependencies/scripts)
|
|
173
184
|
- `tsconfig.json`
|
|
174
185
|
- `src/index.ts`, `src/index.test.ts`
|
|
175
186
|
- `.eslintrc.json`, `.prettierrc`
|
|
176
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
187
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
177
188
|
|
|
178
189
|
- **Java (`toolbelt new java <name>`)**:
|
|
179
190
|
- `pom.xml` (Maven, JUnit 5 Jupiter, compiler plugins)
|
|
180
191
|
- `src/main/java/com/<name>/App.java`
|
|
181
192
|
- `src/test/java/com/<name>/AppTest.java`
|
|
182
|
-
- `README.md`, `.gitignore`, `LICENSE`
|
|
193
|
+
- `README.md`, `.gitignore`, and optionally `LICENSE`
|
|
194
|
+
|
|
195
|
+
`--yes` accepts defaults: the configured Git author (or `Developer`), MIT license,
|
|
196
|
+
CI enabled, and Docker disabled. CI and Docker templates are currently available
|
|
197
|
+
for Python projects.
|
|
183
198
|
|
|
184
199
|
---
|
|
185
200
|
|
|
@@ -199,10 +214,16 @@ Apply commit? [y/n/edit] (y): y
|
|
|
199
214
|
✅ Commit created successfully!
|
|
200
215
|
```
|
|
201
216
|
|
|
202
|
-
- **Claude
|
|
203
|
-
- **
|
|
217
|
+
- **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.
|
|
218
|
+
- **Local fallback**: Without an API key, a heuristic uses the diff to draft a message without making a network call.
|
|
204
219
|
- **Dry-run Mode**: Preview generated messages without applying commits using `toolbelt commit --dry-run`.
|
|
205
|
-
- **
|
|
220
|
+
- **Confirmation**: Review, edit, or reject the proposed message before committing. `--yes` skips confirmation.
|
|
221
|
+
|
|
222
|
+
Use `--type` and `--scope` to provide parts of the commit header:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
toolbelt commit --type feat --scope cli
|
|
226
|
+
```
|
|
206
227
|
|
|
207
228
|
---
|
|
208
229
|
|
|
@@ -213,27 +234,9 @@ Performs a structured quality check on any repository:
|
|
|
213
234
|
toolbelt audit .
|
|
214
235
|
```
|
|
215
236
|
|
|
216
|
-
|
|
217
|
-
Repository Audit: Toolbelt-CLI
|
|
218
|
-
┌────────────────────────────┬──────────┬──────────────────────────┐
|
|
219
|
-
│ Check │ Status │ Details │
|
|
220
|
-
├────────────────────────────┼──────────┼──────────────────────────┤
|
|
221
|
-
│ README.md exists │ ✅ │ 227 lines │
|
|
222
|
-
│ README has Install │ ✅ │ found "## Installation" │
|
|
223
|
-
│ README has Usage │ ✅ │ found "## Usage" │
|
|
224
|
-
│ README has License │ ✅ │ found "## License" │
|
|
225
|
-
│ LICENSE file │ ✅ │ MIT │
|
|
226
|
-
│ .gitignore exists │ ✅ │ 29 entries │
|
|
227
|
-
│ .gitignore has __pycache__ │ ✅ │ │
|
|
228
|
-
│ Tests directory │ ✅ │ tests/ found │
|
|
229
|
-
│ CI config │ ✅ │ .github/workflows/ci.yml │
|
|
230
|
-
│ pyproject.toml │ ✅ │ │
|
|
231
|
-
└────────────────────────────┴──────────┴──────────────────────────┘
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
- **Exit Code**: Returns `0` if all checks pass, and `1` if any check fails (ready for pre-commit hooks and CI gates).
|
|
235
|
-
- **Auto-Fix (`--fix`)**: Automatically prompts to create missing `.gitignore` files and `LICENSE` files (MIT or Apache-2.0).
|
|
237
|
+
- **Auto-Fix (`--fix`)**: Prompts to create a missing `.gitignore` and/or MIT or Apache-2.0 `LICENSE`. It does not repair other failed checks.
|
|
236
238
|
- **JSON Mode (`--json`)**: Outputs machine-readable JSON for integration into reporting tools or CI/CD pipelines.
|
|
239
|
+
- **Exit status**: Returns `0` when all checks pass and `1` when one or more checks fail.
|
|
237
240
|
|
|
238
241
|
---
|
|
239
242
|
|
|
@@ -248,16 +251,26 @@ toolbelt version
|
|
|
248
251
|
|
|
249
252
|
## Configuration & Environment Variables
|
|
250
253
|
|
|
251
|
-
|
|
254
|
+
The optional `ANTHROPIC_API_KEY` environment variable is used by `toolbelt commit`.
|
|
255
|
+
The CLI does not load `.env` files; set the variable in your shell before running
|
|
256
|
+
the command.
|
|
252
257
|
|
|
253
|
-
|
|
254
|
-
# Optional: Set Claude API key for AI-assisted git commit message generation
|
|
255
|
-
ANTHROPIC_API_KEY=sk-ant-api03-...
|
|
258
|
+
PowerShell:
|
|
256
259
|
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
```powershell
|
|
261
|
+
$env:ANTHROPIC_API_KEY = "your-api-key"
|
|
262
|
+
toolbelt commit
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
macOS/Linux:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
export ANTHROPIC_API_KEY="your-api-key"
|
|
269
|
+
toolbelt commit
|
|
259
270
|
```
|
|
260
271
|
|
|
272
|
+
Without this variable, commit-message generation uses the local fallback.
|
|
273
|
+
|
|
261
274
|
---
|
|
262
275
|
|
|
263
276
|
## Architecture & Tech Stack
|
|
@@ -302,66 +315,39 @@ mypy src
|
|
|
302
315
|
|
|
303
316
|
---
|
|
304
317
|
|
|
305
|
-
##
|
|
306
|
-
|
|
307
|
-
Follow these steps to publish this repository to your personal or organization GitHub account:
|
|
318
|
+
## Deployments
|
|
308
319
|
|
|
309
|
-
|
|
310
|
-
Create a new repository named `toolbelt-cli` on [GitHub](https://github.com/new) (leave "Initialize with README" unchecked). Then connect your local repository:
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
# Add your GitHub remote
|
|
314
|
-
git remote add origin https://github.com/crnjihia/toolbelt-cli.git
|
|
320
|
+
GitHub Actions manages CI, the documentation site, and PyPI releases:
|
|
315
321
|
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
- **CI** ([`.github/workflows/ci.yml`](.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.
|
|
323
|
+
- **Documentation** ([`.github/workflows/pages.yml`](.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.
|
|
324
|
+
- **PyPI release** ([`.github/workflows/release.yml`](.github/workflows/release.yml)) runs for tags matching `v*`. It builds and checks the package, then publishes using PyPI Trusted Publishing (OIDC).
|
|
318
325
|
|
|
319
|
-
|
|
320
|
-
git push -u origin main
|
|
321
|
-
```
|
|
326
|
+
### Configure PyPI Trusted Publishing
|
|
322
327
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
1. Log into your [PyPI](https://pypi.org/) account.
|
|
327
|
-
2. Navigate to **Account settings** → **Publishing** → **Add a GitHub publisher**.
|
|
328
|
-
3. Set:
|
|
329
|
-
- **PyPI Project Name**: `toolbelt-cli`
|
|
330
|
-
- **Owner**: `crnjihia`
|
|
331
|
-
- **Repository name**: `toolbelt-cli`
|
|
332
|
-
- **Workflow name**: `release.yml`
|
|
333
|
-
- **Environment name**: `pypi`
|
|
334
|
-
4. In your GitHub repository, ensure the `pypi` environment is enabled under **Settings** → **Environments**.
|
|
335
|
-
5. When ready to release, simply tag and push:
|
|
336
|
-
```bash
|
|
337
|
-
git tag v0.1.0
|
|
338
|
-
git push origin v0.1.0
|
|
339
|
-
```
|
|
340
|
-
GitHub Actions will automatically build source distributions and wheels, run `twine check`, and publish to PyPI!
|
|
341
|
-
|
|
342
|
-
### 3. Continuous Integration Checks
|
|
343
|
-
On every push and pull request, [`.github/workflows/ci.yml`](.github/workflows/ci.yml) automatically executes:
|
|
344
|
-
- Matrix testing across Python **3.11** and **3.12**.
|
|
345
|
-
- Fast code hygiene validation via `ruff check .`.
|
|
346
|
-
- Code format verification via `ruff format --check .`.
|
|
347
|
-
- Static type analysis via `mypy src`.
|
|
348
|
-
- Complete test suite execution via `pytest -v` (19 offline tests with 100% pass guarantee).
|
|
328
|
+
Before the first release, register a publisher on PyPI for the **`toolbelt-cli`**
|
|
329
|
+
project with these exact values:
|
|
349
330
|
|
|
350
|
-
|
|
331
|
+
| PyPI setting | Value |
|
|
332
|
+
|---|---|
|
|
333
|
+
| Owner | `crnjihia` |
|
|
334
|
+
| Repository | `toolbelt-cli` |
|
|
335
|
+
| Workflow filename | `release.yml` |
|
|
336
|
+
| Environment name | `pypi` |
|
|
351
337
|
|
|
352
|
-
|
|
338
|
+
The GitHub repository must also have a `pypi` environment. The build and
|
|
339
|
+
distribution checks can pass even when publishing is not configured; in that case,
|
|
340
|
+
the publish step fails with an `invalid-publisher` error. Configure the publisher
|
|
341
|
+
in the PyPI project settings. Do not add a PyPI API token to the workflow for this
|
|
342
|
+
OIDC setup.
|
|
353
343
|
|
|
354
|
-
|
|
344
|
+
For a release, update the version in `pyproject.toml` and `src/toolbelt/__init__.py`,
|
|
345
|
+
update `CHANGELOG.md`, then push a version tag:
|
|
355
346
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
git tag v0.1.0
|
|
362
|
-
git push origin v0.1.0
|
|
363
|
-
```
|
|
364
|
-
4. The `.github/workflows/release.yml` workflow will automatically build wheels and sdist distributions and publish them directly to PyPI.
|
|
347
|
+
```bash
|
|
348
|
+
git tag v0.3.0
|
|
349
|
+
git push origin v0.3.0
|
|
350
|
+
```
|
|
365
351
|
|
|
366
352
|
---
|
|
367
353
|
|
|
@@ -371,7 +357,7 @@ Contributions are welcome! Please follow these steps:
|
|
|
371
357
|
|
|
372
358
|
1. Fork the repository on GitHub.
|
|
373
359
|
2. Create a feature branch: `git checkout -b feat/my-new-feature`
|
|
374
|
-
3. Ensure
|
|
360
|
+
3. Ensure tests, lint, formatting, and type checks pass: `pytest -v`, `ruff check .`, `ruff format --check .`, and `mypy src`.
|
|
375
361
|
4. Commit your changes using conventional commits: `git commit -m "feat(scope): describe change"`
|
|
376
362
|
5. Open a Pull Request.
|
|
377
363
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/.github/workflows/ci.yml.j2
RENAMED
|
File without changes
|
|
File without changes
|
{toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/.pre-commit-config.yaml.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{toolbelt_cli-0.2.0 → toolbelt_cli-0.2.1}/src/toolbelt/templates/python/tests/test_main.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|