commitron 1.0.0rc4__py3-none-any.whl
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.
- commitron/__init__.py +1 -0
- commitron/__main__.py +3 -0
- commitron/ai.py +407 -0
- commitron/cli.py +617 -0
- commitron/config.py +289 -0
- commitron/credentials.py +124 -0
- commitron/git_ops.py +175 -0
- commitron/providers.py +337 -0
- commitron/safety.py +28 -0
- commitron-1.0.0rc4.dist-info/METADATA +393 -0
- commitron-1.0.0rc4.dist-info/RECORD +15 -0
- commitron-1.0.0rc4.dist-info/WHEEL +5 -0
- commitron-1.0.0rc4.dist-info/entry_points.txt +3 -0
- commitron-1.0.0rc4.dist-info/licenses/LICENSE +21 -0
- commitron-1.0.0rc4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: commitron
|
|
3
|
+
Version: 1.0.0rc4
|
|
4
|
+
Summary: A safer AI-powered Git assistant for the command line
|
|
5
|
+
Author: Error404-uv
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Error404-uv/commitron
|
|
8
|
+
Project-URL: Repository, https://github.com/Error404-uv/commitron
|
|
9
|
+
Project-URL: Issues, https://github.com/Error404-uv/commitron/issues
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: rich<15,>=13.7
|
|
25
|
+
Provides-Extra: test
|
|
26
|
+
Requires-Dist: pytest<10,>=8; extra == "test"
|
|
27
|
+
Requires-Dist: coverage<8,>=7; extra == "test"
|
|
28
|
+
Requires-Dist: ruff<1,>=0.6; extra == "test"
|
|
29
|
+
Provides-Extra: secure-store
|
|
30
|
+
Requires-Dist: keyring<27,>=25; extra == "secure-store"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
<div align="center">
|
|
34
|
+
|
|
35
|
+
# ⚡ Commitron
|
|
36
|
+
|
|
37
|
+
### A safer, multi-provider AI Git assistant for your terminal
|
|
38
|
+
|
|
39
|
+
[](https://www.python.org/)
|
|
40
|
+
[](LICENSE)
|
|
41
|
+
[](https://github.com/Error404-uv/commitron/actions)
|
|
42
|
+
[](https://pypi.org/project/commitron/)
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
Commitron assists with everyday Git workflows and uses an AI provider you choose to draft commit messages or explain changes. It works from staged or unstaged diffs; it can stage only paths you explicitly select with `commitron stage`, and it never silently stages files. It does not push, pull, reset, stash, or rewrite history.
|
|
47
|
+
|
|
48
|
+
## What's new in 1.0.0rc4
|
|
49
|
+
|
|
50
|
+
- Extend AI provider support: **Gemini, OpenAI, Ollama** plus new built-ins **Anthropic, Groq, DeepSeek, OpenRouter**. All are configurable via `commitron config set provider <name>`; their API keys are read from env vars or the OS keychain (`commitron auth set <name>`). Ollama needs no API key.
|
|
51
|
+
- Make the provider registry extensible: new providers can be added via `register_provider(name, provider_class, key_env, default_model, default_url)` without editing core validation logic.
|
|
52
|
+
- Add automatic retry on transient AI errors (HTTP 429 rate limits, 5xx server errors, timeouts). Retries use exponential backoff; configurable via `COMMITRON_RETRY_COUNT` (default 3) and `COMMITRON_RETRY_DELAY` (default 1.0s).
|
|
53
|
+
- Add `--verbose` / `-v` to print provider, model, and request size when generating messages (now on `commit`, `explain`, `branch suggest`, `split`, `history --analyze`, `git-help`). In verbose mode, retries also print "attempt N/M" progress.
|
|
54
|
+
- Add `commitron doctor` to diagnose the environment: Python version, Git availability, repository detection, config validity, credential status, and provider network reachability — with a pass/fail summary.
|
|
55
|
+
- Add `commitron config path` to print the configuration file location.
|
|
56
|
+
- Retry count now defaults to 1 for local providers (Ollama on localhost) and 3 for remote providers; override with `COMMITRON_RETRY_COUNT`.
|
|
57
|
+
- Clarify `auth set`: Gemini, OpenAI, Anthropic, Groq, DeepSeek, and OpenRouter keys can be stored; Ollama needs no key.
|
|
58
|
+
- Document cross-platform support (Windows, macOS, and all mainstream Linux distros) and universal `py3-none-any` wheel.
|
|
59
|
+
|
|
60
|
+
## What's new in 1.0.0rc2
|
|
61
|
+
|
|
62
|
+
- Replaced the old root `smart_commit.py` implementation with a compatibility shim to the maintained CLI; the legacy `git add .` behavior is no longer present in that entry point.
|
|
63
|
+
- Validate Git branch names before creating or switching branches.
|
|
64
|
+
- Harden custom API URL validation and block provider HTTP redirects to avoid forwarding credentials unexpectedly.
|
|
65
|
+
- Limit provider responses to 2 MB and handle mixed text/non-text OpenAI response blocks safely.
|
|
66
|
+
- Reject malformed project configuration files before overwriting them.
|
|
67
|
+
- This is still a release candidate, not a stable 1.0 release. Hosted CI, live AI-provider, and native OS keychain verification are still outstanding.
|
|
68
|
+
|
|
69
|
+
## What's new in 1.0.0rc1
|
|
70
|
+
|
|
71
|
+
- Release-candidate build with reproducible coverage reporting and an 80% CI coverage threshold.
|
|
72
|
+
- CI runs Ruff, pytest, coverage enforcement, and package builds across the configured Windows, Linux, and macOS matrix.
|
|
73
|
+
- Interactive commands exit cleanly if terminal input closes unexpectedly.
|
|
74
|
+
|
|
75
|
+
## What's new in 0.9.0
|
|
76
|
+
|
|
77
|
+
- Added `commitron stage` for interactive whole-file staging of explicitly selected changed paths, including untracked files.
|
|
78
|
+
- Added optional OS credential-manager support through `commitron[secure-store]` and `commitron auth`; environment variables take precedence and credentials are not stored in JSON.
|
|
79
|
+
- Refuse known plaintext/fail/null keyring backends.
|
|
80
|
+
- Fixed root-level pytest discovery for the `src/` layout.
|
|
81
|
+
|
|
82
|
+
## What's new in 0.8.0
|
|
83
|
+
|
|
84
|
+
- The interactive `commitron menu` now includes a real AI-profile manager: list, save, apply, and delete profiles without leaving the menu.
|
|
85
|
+
- Replacing an existing profile through the menu requires confirmation.
|
|
86
|
+
- Added automated tests for interactive profile-management flows, overwrite confirmation, empty-profile handling, and malformed configuration handling.
|
|
87
|
+
- Configuration updates reject malformed existing setting types rather than silently dropping them.
|
|
88
|
+
|
|
89
|
+
## What's new in 0.7.0
|
|
90
|
+
|
|
91
|
+
- `commitron menu` opens a guided terminal menu for status, diff review, smart commit, change explanation, history, settings, and profile management. Menu actions call the same command handlers and retain their safety confirmations.
|
|
92
|
+
- `commitron config wizard` interactively configures provider, model, and custom endpoint.
|
|
93
|
+
- Named provider profiles can be saved, listed, applied, and deleted with `commitron config profile`. Profiles contain no API keys; credentials are read from environment variables or the optional OS credential manager.
|
|
94
|
+
|
|
95
|
+
## What's new in 0.6.0
|
|
96
|
+
|
|
97
|
+
- Added `commitron git-help --error "..."` to explain a pasted Git error and suggest safe diagnostic steps. The error and optional context are sent to the configured AI provider only after explicit confirmation; the assistant is instructed not to recommend destructive commands as routine fixes and does not execute commands.
|
|
98
|
+
- Added `commitron history --analyze` to summarize recent commit subjects and bodies, identify recurring work areas, and distinguish observations from cautious inferences. Commit metadata is sent only after explicit confirmation.
|
|
99
|
+
- Added structured Git history retrieval with bounded limits and tests for metadata parsing, prompt-injection handling, input limits, and confirmation gates.
|
|
100
|
+
|
|
101
|
+
## What's new in 0.5.0
|
|
102
|
+
|
|
103
|
+
- `commitron branch suggest --description "..."` asks the configured AI provider for a branch name, checks it with Git's branch-name validator, and refuses names that already exist. It only prints a suggestion; it never creates a branch.
|
|
104
|
+
- `commitron split` analyzes staged tracked-file changes and suggests file-level logical commit groups with a message and rationale for each group. Every staged changed path must appear exactly once in a valid response. It never stages, unstages, or commits files.
|
|
105
|
+
- `commitron convention set "..."` saves repository-specific commit-message guidance in `.commitron.json`; `show` displays it and `clear` removes it. Commit-message generation uses this guidance when present.
|
|
106
|
+
- Added tests for AI branch-name validation, complete logical-group coverage, project conventions, and non-mutating CLI behavior.
|
|
107
|
+
|
|
108
|
+
## What's new in 0.4.1
|
|
109
|
+
|
|
110
|
+
- Validate AI-generated commit messages for the selected style, uniqueness, single-line format, 72-character subject length, and response count.
|
|
111
|
+
- Separate Gemini, OpenAI, and Ollama implementations behind one provider adapter contract.
|
|
112
|
+
- Process large diffs in ordered, lossless chunks instead of silently truncating them; refuse oversized diffs before sending any content.
|
|
113
|
+
- Expand heuristic credential warnings for GitHub, GitLab, Slack, Stripe, npm, AWS, Google, private keys, and JWT-like values.
|
|
114
|
+
- Render repository-controlled text and AI output as literal terminal text to prevent Rich markup interpretation.
|
|
115
|
+
- The original CI matrix at that milestone targeted Python 3.11–3.13; the current workflow is documented under Requirements and Development.
|
|
116
|
+
|
|
117
|
+
## What's new in 0.4.0
|
|
118
|
+
|
|
119
|
+
- Provider adapters for **Google Gemini**, **OpenAI Chat Completions**, and **Ollama** local models.
|
|
120
|
+
- `commitron explain` for a concise explanation of staged or unstaged tracked-file changes.
|
|
121
|
+
- `commitron config` for per-user provider/model/base URL settings.
|
|
122
|
+
- API keys can be read from environment variables or the optional OS credential manager; they are never written to config or profile files.
|
|
123
|
+
- HTTPS is required for remote custom endpoints; plain HTTP is accepted only for local endpoints.
|
|
124
|
+
- `files` and richer `diff` commands for reviewing staged or unstaged tracked-file changes.
|
|
125
|
+
- Secret-pattern checks before sending diffs to an AI provider.
|
|
126
|
+
|
|
127
|
+
## Requirements
|
|
128
|
+
|
|
129
|
+
- Python 3.11 or newer (CI targets 3.11–3.15)
|
|
130
|
+
- Git available on `PATH`
|
|
131
|
+
- An API key for Gemini or OpenAI, or a running local Ollama server
|
|
132
|
+
|
|
133
|
+
Commitron works out of the box on Windows 10/11, macOS (Intel + Apple Silicon), and all mainstream Linux distributions — Ubuntu, Debian, Fedora, Arch, Kali, Parrot OS, Mint, etc. Because the wheel is `py3-none-any` (pure Python), there is no per-platform build; the same installed package runs on every OS.
|
|
134
|
+
|
|
135
|
+
## Install
|
|
136
|
+
|
|
137
|
+
Commitron ships a universal wheel (`py3-none-any`) — the same package works on Windows, Linux (Ubuntu, Debian, Fedora, Arch, Kali, Parrot, etc.), and macOS:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Any Linux/macOS
|
|
141
|
+
python3 -m pip install commitron
|
|
142
|
+
|
|
143
|
+
# Windows PowerShell
|
|
144
|
+
python -m pip install commitron
|
|
145
|
+
|
|
146
|
+
# Windows Command Prompt
|
|
147
|
+
python -m pip install commitron
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Need it for a project? Install from source:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
git clone https://github.com/Error404-uv/commitron.git
|
|
154
|
+
cd commitron
|
|
155
|
+
pip install -e .
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For development and tests:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
python -m pip install -e ".[test]"
|
|
162
|
+
pytest
|
|
163
|
+
ruff check src tests
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The legacy source-checkout command `python smart_commit.py` remains available as a compatibility shim and invokes the maintained `commitron` CLI. It no longer contains a separate implementation.
|
|
167
|
+
|
|
168
|
+
## AI providers
|
|
169
|
+
|
|
170
|
+
Commitron works with any AI provider you choose. Built-in providers (all configurable via `commitron config set provider <name>`):
|
|
171
|
+
|
|
172
|
+
- **Gemini** (Google) — env `GEMINI_API_KEY`, free tier (default; `gemini-2.5-flash`)
|
|
173
|
+
- **OpenAI** — env `OPENAI_API_KEY`, paid (`gpt-4.1-mini`)
|
|
174
|
+
- **Ollama** — no API key, local models (`ollama pull qwen2.5-coder:7b`)
|
|
175
|
+
- **Anthropic** — env `ANTHROPIC_API_KEY`, Claude 3 Haiku
|
|
176
|
+
- **Groq** — env `GROQ_API_KEY`, free tier, fast open-weight models
|
|
177
|
+
- **DeepSeek** — env `DEEPSEEK_API_KEY`, free tier, DeepSeek-Coder
|
|
178
|
+
- **OpenRouter** — env `OPENROUTER_API_KEY`, gateway to many models
|
|
179
|
+
|
|
180
|
+
Any of these can be set via environment variable, saved in the OS keychain (`commitron auth set <provider>`), or configured interactively with `commitron config wizard`. Ollama needs no API key.
|
|
181
|
+
|
|
182
|
+
## Choose an AI provider
|
|
183
|
+
|
|
184
|
+
The default provider remains Gemini for compatibility:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
commitron config set provider gemini
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Gemini** — set `GEMINI_API_KEY` in your environment. Default model: `gemini-2.5-flash`.
|
|
191
|
+
|
|
192
|
+
**OpenAI** — set `OPENAI_API_KEY` in your environment, then:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
commitron config set provider openai
|
|
196
|
+
commitron config set model gpt-4.1-mini
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Ollama** — start Ollama locally, pull a model, then configure it:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
ollama pull qwen2.5-coder:7b
|
|
203
|
+
commitron config set provider ollama
|
|
204
|
+
commitron config set model qwen2.5-coder:7b
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
View or interactively configure the effective settings:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
commitron config show
|
|
211
|
+
commitron config wizard
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Store API credentials in the operating-system credential manager (optional):
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
python -m pip install "commitron[secure-store]"
|
|
218
|
+
commitron auth set gemini
|
|
219
|
+
commitron auth set openai
|
|
220
|
+
commitron auth status
|
|
221
|
+
commitron auth delete openai
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The optional keyring integration uses an available OS-backed credential backend and refuses known plaintext/fallback backends. Environment variables (`GEMINI_API_KEY`, `OPENAI_API_KEY`) take precedence. If a secure OS backend is unavailable, use environment variables instead. Credentials are never written to Commitron's JSON configuration or profile files.
|
|
225
|
+
|
|
226
|
+
Save and switch between named provider configurations (API keys are never included):
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
commitron config profile save work
|
|
230
|
+
commitron config profile save local
|
|
231
|
+
commitron config profile list
|
|
232
|
+
commitron config profile use local
|
|
233
|
+
commitron config profile delete work
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Open the interactive terminal menu:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
commitron menu
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Settings are stored in a per-user `config.json` location: `%APPDATA%\\commitron` on Windows, `~/Library/Application Support/commitron` on macOS, or `$XDG_CONFIG_HOME/commitron` (default `~/.config/commitron`) on Linux. Environment variables override saved settings:
|
|
243
|
+
|
|
244
|
+
- `COMMITRON_PROVIDER`
|
|
245
|
+
- `COMMITRON_MODEL`
|
|
246
|
+
- `COMMITRON_BASE_URL`
|
|
247
|
+
- `GEMINI_API_KEY` / `OPENAI_API_KEY`
|
|
248
|
+
|
|
249
|
+
Provider-specific model overrides are also supported through `COMMITRON_GEMINI_MODEL`, `COMMITRON_OPENAI_MODEL`, and `COMMITRON_OLLAMA_MODEL`.
|
|
250
|
+
|
|
251
|
+
Set the relevant key in the current terminal session:
|
|
252
|
+
|
|
253
|
+
```powershell
|
|
254
|
+
# Windows PowerShell
|
|
255
|
+
$env:GEMINI_API_KEY = "your-key"
|
|
256
|
+
$env:OPENAI_API_KEY = "your-key"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```bat
|
|
260
|
+
:: Windows Command Prompt
|
|
261
|
+
set GEMINI_API_KEY=your-key
|
|
262
|
+
set OPENAI_API_KEY=your-key
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# macOS / Linux
|
|
267
|
+
export GEMINI_API_KEY="your-key"
|
|
268
|
+
export OPENAI_API_KEY="your-key"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
For OpenAI-compatible gateways, set `base_url` to the API root (for example `https://your-host.example/v1`). Do not put credentials in the URL. Remote HTTP endpoints are rejected to avoid sending API credentials over an unencrypted connection.
|
|
272
|
+
|
|
273
|
+
## Git workflows
|
|
274
|
+
|
|
275
|
+
Run commands inside a Git repository:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
commitron status
|
|
279
|
+
commitron stage # interactively select exact paths to stage
|
|
280
|
+
commitron files # staged tracked files
|
|
281
|
+
commitron files --unstaged # unstaged tracked files
|
|
282
|
+
commitron diff # staged diff
|
|
283
|
+
commitron diff --unstaged # unstaged diff
|
|
284
|
+
commitron diff --stat # staged summary
|
|
285
|
+
commitron history --limit 15
|
|
286
|
+
commitron history --analyze --limit 20
|
|
287
|
+
commitron branch
|
|
288
|
+
commitron branch create feature/my-change
|
|
289
|
+
commitron branch switch main
|
|
290
|
+
commitron branch suggest --description "Add OAuth login"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
The AI branch suggestion sends the task description and current branch names to your configured AI provider after an explicit confirmation. Possible credential patterns trigger an additional warning. The suggested name is checked against Git's ref-format rules and existing branches; no branch is created automatically. Review the suggestion before creating it.
|
|
294
|
+
|
|
295
|
+
Suggest logical file-level commits from the current staged diff:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
commitron split
|
|
299
|
+
commitron split --style gitmoji
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
`split` requires at least two staged tracked files. It groups whole files, not individual hunks within one file. Treat the output as a review aid: the grouping is AI-generated and may be wrong. Commitron does not change the Git index or create commits.
|
|
303
|
+
|
|
304
|
+
Set repository-specific commit-message guidance:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
commitron convention set "Use feat(scope): summary; scopes are lowercase; include a ticket ID when one is present."
|
|
308
|
+
commitron convention show
|
|
309
|
+
commitron convention clear
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
This writes `.commitron.json` at the Git repository root. It contains guidance only, not API credentials. You can commit it to share conventions with teammates, or add it to `.gitignore` for local-only preferences. Keep the text focused on formatting rules; it is passed to the configured AI provider as prompt guidance.
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
Stage only the files you intend to include, then draft a commit message. You can use `commitron stage` to select exact changed paths interactively, or use Git directly:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
git add path/to/file.py
|
|
319
|
+
commitron commit --dry-run
|
|
320
|
+
commitron commit
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Other options:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
commitron commit --style gitmoji --count 5
|
|
327
|
+
commitron commit --style plain
|
|
328
|
+
commitron commit --yes
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
`--yes` selects the first generated suggestion and skips the final commit confirmation. It does not skip the secret warning. `--dry-run` never creates a commit. Commitron never runs `git add .` automatically.
|
|
332
|
+
|
|
333
|
+
Explain a pasted Git error using the selected provider:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
commitron git-help --error "fatal: not a git repository (or any of the parent directories): .git"
|
|
337
|
+
commitron git-help --error "fatal: refusing to merge unrelated histories" --context "running git pull"
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Commitron asks before sending the error and optional context. It provides explanations and diagnostic suggestions only; it does not run suggested commands. Review AI advice before acting, especially if it involves changing repository state.
|
|
341
|
+
|
|
342
|
+
Analyze recent commit history:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
commitron history --analyze --limit 20
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
This sends recent commit hashes, dates, subjects and bodies to the configured AI provider after confirmation. Commit messages can contain sensitive information; review your history and any heuristic secret warnings before approving. The analysis is a summary of commit metadata, not a code-level audit and not proof that a feature is correct or complete.
|
|
349
|
+
|
|
350
|
+
Explain changes using the selected provider:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
commitron explain # staged changes
|
|
354
|
+
commitron explain --unstaged # unstaged tracked-file changes
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## Privacy and safety
|
|
358
|
+
|
|
359
|
+
- Commitron sends the selected diff to the configured AI provider when you run `commit`, `explain`, or `split`. `branch suggest` sends the task description and current branch names only after an explicit confirmation. Review all content first; code, project convention text, task details, and accidentally staged secrets may be disclosed to that provider.
|
|
360
|
+
- The local secret detector checks a small set of patterns only. It can miss secrets and produce false positives; it is not a complete secret scanner.
|
|
361
|
+
- API credentials are rejected if they contain control characters or exceed 4,096 characters before being stored or sent in provider headers. This is input hardening, not a substitute for keeping keys private.
|
|
362
|
+
- Large diffs are split into ordered chunks and summarized before final generation. All chunks are included; Commitron refuses diffs beyond its safe chunk limit rather than silently omitting content. Multi-chunk analysis uses multiple AI requests and may consume more quota.
|
|
363
|
+
- `--allow-secrets` disables the heuristic warning for diff and repository convention content in `commit` and `split`. Use it only after reviewing that content and deciding disclosure is acceptable.
|
|
364
|
+
- API keys can be read from environment variables or an optional OS credential manager; they are never stored in Commitron's config or profile files.
|
|
365
|
+
- Ollama runs locally by default, but a custom endpoint may send code elsewhere. Verify the endpoint you configure.
|
|
366
|
+
- `files` and `diff` list tracked changes; `commitron stage` includes untracked files in its interactive selection. The staging command selects whole files, not individual hunks.
|
|
367
|
+
- `history --analyze` sends recent commit metadata only after explicit confirmation. `git-help` sends the supplied error and context only after explicit confirmation. Neither command executes Git operations.
|
|
368
|
+
- Branch creation and switching are explicit commands. AI branch suggestions do not create branches.
|
|
369
|
+
- Logical commit grouping is file-level and advisory only; it cannot separate unrelated hunks inside one file and never changes the Git index.
|
|
370
|
+
- Repository-specific convention text in `.commitron.json` is included in AI prompts. Review it before sharing the repository or sending diffs to a provider.
|
|
371
|
+
- Commitron does not push, pull, reset, stash, or rewrite history.
|
|
372
|
+
|
|
373
|
+
## Troubleshooting
|
|
374
|
+
|
|
375
|
+
- **Not a Git repository:** change into your repository directory. `commitron config show` works outside a repository.
|
|
376
|
+
- **No staged changes:** run `git status`, then use `commitron stage` to select intended whole files, or stage a path directly with `git add <path>`.
|
|
377
|
+
- **Missing API key:** set the provider's environment variable in the same terminal session.
|
|
378
|
+
- **Ollama connection refused:** ensure the Ollama service is running and the configured model is available.
|
|
379
|
+
- **API error:** check key validity, network access, model availability, provider quota, and configured base URL.
|
|
380
|
+
|
|
381
|
+
## Development
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
python -m pip install -e ".[test]"
|
|
385
|
+
pytest
|
|
386
|
+
ruff check src tests
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
CI is configured to run the test suite on Windows, macOS, and Linux with Python 3.11, 3.12, 3.13, 3.14, and 3.15. Provider network calls are mocked/not required by the unit test suite; test a provider separately with your own key or local model.
|
|
390
|
+
|
|
391
|
+
## License
|
|
392
|
+
|
|
393
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
commitron/__init__.py,sha256=vJfgjkpA-ASpaxxOrgbH9zRUn6Ccw0ral9TwNUyUtD8,25
|
|
2
|
+
commitron/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
|
|
3
|
+
commitron/ai.py,sha256=06mmyZgt7XnAVRJyQASYUTNsNfznASFgHRWrkeFRcH0,20897
|
|
4
|
+
commitron/cli.py,sha256=L2qSOMKpwjswFsJcSbtUMpIKMuarcONmLArSYv-kwZQ,35749
|
|
5
|
+
commitron/config.py,sha256=HBi9j8Pp1GvTMgfpuZL0aiq56B0Z9FYsJLiZzsP7FU0,11891
|
|
6
|
+
commitron/credentials.py,sha256=jWhBQ12RpS6LtPn-057goZrVlu7wnhklTWs2Rf0nqGM,4755
|
|
7
|
+
commitron/git_ops.py,sha256=hh9V6R-fEYDToj0ZiplQ6Q330jDN_WGKUpn-vJ4GEos,5750
|
|
8
|
+
commitron/providers.py,sha256=yxW5hGGRknnhLG56H6ZZHahpsM8wv6PuLRiZ0GYZV7A,13631
|
|
9
|
+
commitron/safety.py,sha256=a-FajLKnpua4KeDg6iUkt50BZEzruxgeGWFy6J4XCzI,1431
|
|
10
|
+
commitron-1.0.0rc4.dist-info/licenses/LICENSE,sha256=Bch8C9oibBBkvnCXFV1S5Z7Y2ZGesJvdVeNI2IMibAM,1068
|
|
11
|
+
commitron-1.0.0rc4.dist-info/METADATA,sha256=Uq-99yFxXWCWz-s5n3ITSa-0sLd4Q0pesYywVVTi2tk,21608
|
|
12
|
+
commitron-1.0.0rc4.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
13
|
+
commitron-1.0.0rc4.dist-info/entry_points.txt,sha256=4kB_RnPskjSxV8mDBpKm6xSYypCu8SCTXQ6s3S042eI,83
|
|
14
|
+
commitron-1.0.0rc4.dist-info/top_level.txt,sha256=zPtoYlnCcMiUE4w2uzw0ei5xINNoaNXWav2i3t8PAvQ,10
|
|
15
|
+
commitron-1.0.0rc4.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Error404-uv
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
commitron
|