git-cai-cli 0.13.5__tar.gz → 0.14.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.
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.proselintrc +1 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.pylintrc +4 -4
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/PKG-INFO +62 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/README.md +61 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/docs/git-cai.txt +136 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/docs/man/git-cai.1 +203 -3
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/_version.py +3 -3
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/cli/cli.py +47 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/cli/helptext.py +3 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/cli/modes.py +33 -9
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/completion.py +66 -11
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/config.py +50 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/gitutils.py +87 -0
- git_cai_cli-0.14.1/src/git_cai_cli/core/init.py +206 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/llm.py +8 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/options.py +4 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/pr.py +22 -3
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/squash.py +54 -5
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/validate.py +2 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/main.py +46 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli.egg-info/PKG-INFO +62 -1
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli.egg-info/SOURCES.txt +4 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_modes_integration.py +2 -2
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_completion.py +60 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_config.py +151 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_gitutils.py +48 -0
- git_cai_cli-0.14.1/tests/unit/test_init.py +199 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_llm.py +16 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_modes.py +14 -14
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_pr.py +35 -0
- git_cai_cli-0.14.1/tests/unit/test_print.py +80 -0
- git_cai_cli-0.14.1/tests/unit/test_signoff.py +134 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_squash.py +27 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.caiignore +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.gitattributes +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/cd/.SRCINFO +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/cd/PKGBUILD +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/ci/_version.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/ci/cai_config.ci.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/ci/tokens.ci.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/workflows/python-tests.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/workflows/release.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.github/workflows/release_aur.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.gitignore +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.bandit.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.checkov.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.flake8 +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.ls-lint.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.markdown-link-check.json +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.markdownlint.json +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/.yamllint.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/check_git_branch_name.sh +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/lychee.toml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.linters/pyrightconfig.json +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.markdownlintignore +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.mega-linter.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.semgrepignore +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/.trivyignore +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/CLAUDE.md +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/LICENSE +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/Makefile +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/cai_config.yml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/pyproject.toml +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/setup.cfg +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/__init__.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/cli/__init__.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/__init__.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/editors.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/languages.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/prompts_fallback.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/spinner.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli/core/stats.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli.egg-info/dependency_links.txt +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli.egg-info/entry_points.txt +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli.egg-info/requires.txt +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/src/git_cai_cli.egg-info/top_level.txt +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/conftest.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_cli_integration.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_config_integration.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_gitutils_integration.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_options_integration.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_pr_integration.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/integration/test_squash_integration.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_amend.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_branch_context.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_cli.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_conventional.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_helptext.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_main.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_options.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_prompt_loading.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_set_config.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_spinner.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_stats.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/tests/unit/test_validate.py +0 -0
- {git_cai_cli-0.13.5 → git_cai_cli-0.14.1}/uv.lock +0 -0
|
@@ -66,18 +66,18 @@ check-protected-access-in-special-methods=no
|
|
|
66
66
|
# Don’t warn about protected attr access in dunder methods
|
|
67
67
|
|
|
68
68
|
[DESIGN]
|
|
69
|
-
max-args=
|
|
69
|
+
max-args=25 # Max arguments per function
|
|
70
70
|
max-attributes=12 # Max attributes per class
|
|
71
71
|
max-branches=30 # Max branches per function
|
|
72
|
-
max-locals=
|
|
72
|
+
max-locals=70 # Max locals per function
|
|
73
73
|
max-returns=10 # Max return statements per function
|
|
74
|
-
max-statements=
|
|
74
|
+
max-statements=120 # Max total statements per function
|
|
75
75
|
max-public-methods=20 # Max public methods per class
|
|
76
76
|
min-public-methods=1 # Min public methods per class
|
|
77
77
|
max-nested-blocks=15 # Max nesting depth
|
|
78
78
|
max-bool-expr=15 # Max boolean subexpressions in a condition
|
|
79
79
|
max-parents=7 # Max base classes per class
|
|
80
|
-
max-positional-arguments=
|
|
80
|
+
max-positional-arguments=25 # Max positional arguments per function
|
|
81
81
|
|
|
82
82
|
[EXCEPTIONS]
|
|
83
83
|
overgeneral-exceptions=builtins.BaseException,builtins.Exception
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-cai-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.1
|
|
4
4
|
Summary: Use LLM to create git commit messages
|
|
5
5
|
Author-email: Thorsten Foltz <thorsten.foltz@live.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -77,9 +77,12 @@ Currently supported providers:
|
|
|
77
77
|
- Seamless integration with Git
|
|
78
78
|
- Supports multiple LLM providers and models
|
|
79
79
|
- Global configuration with per-repository overrides
|
|
80
|
+
- Interactive `--init` wizard for first-time setup (provider, token, language, style)
|
|
80
81
|
- Repository-specific language, style, and model selection
|
|
81
82
|
- Amend the last commit message with a regenerated one
|
|
82
83
|
- Conventional Commits format support
|
|
84
|
+
- `Signed-off-by:` (DCO) trailer support via `--signoff`
|
|
85
|
+
- `--print` mode that emits the generated message to stdout for scripting
|
|
83
86
|
- Change configuration from the command line
|
|
84
87
|
- Optional commit squashing with automatic summary generation (all, last N, or up to a specific commit)
|
|
85
88
|
- Pull Request description generator (`--PR`) that summarizes the commits between the current branch and its base
|
|
@@ -87,6 +90,8 @@ Currently supported providers:
|
|
|
87
90
|
- Token usage logging for API calls
|
|
88
91
|
- Branch name as LLM context
|
|
89
92
|
- Extra context for the LLM
|
|
93
|
+
- Per-invocation overrides for temperature, style, language, and emoji
|
|
94
|
+
- Optional large-diff guard (`max_diff_bytes`) that truncates oversized diffs before sending
|
|
90
95
|
- Generation time measurement
|
|
91
96
|
- Local-only usage analytics (per-provider commits, tokens, latency) with opt-in SQLite storage
|
|
92
97
|
- Shell completion for bash, zsh, and fish
|
|
@@ -144,6 +149,19 @@ The syntax is identical to `.gitignore`.
|
|
|
144
149
|
|
|
145
150
|
## Configuration
|
|
146
151
|
|
|
152
|
+
The fastest way to get started is the interactive wizard:
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
git cai --init # or: git cai -I
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
It asks for a default provider, language, style, and emoji preference,
|
|
159
|
+
then collects the API key (input is hidden while you type). The wizard
|
|
160
|
+
writes `~/.config/cai/cai_config.yml` and, for providers that need one,
|
|
161
|
+
`~/.config/cai/tokens.yml` with mode `0600`. Existing entries for other
|
|
162
|
+
providers in `tokens.yml` are preserved. `--init` only writes home-scope
|
|
163
|
+
files — use `-g` / `--generate-config` to bootstrap a repo-level config.
|
|
164
|
+
|
|
147
165
|
On first execution, cai automatically creates the base configuration in your home directory.
|
|
148
166
|
|
|
149
167
|
- Global configuration:
|
|
@@ -231,6 +249,7 @@ git cai -g
|
|
|
231
249
|
- `squash_prompt_file` - path to the file where the prompt for the squash is stored
|
|
232
250
|
- `full_files_prompt_file` - path to the prompt used when `-F` / `--full-files` attaches full file contents
|
|
233
251
|
- `full_files` – attach always the full working-tree contents of affected files alongside the diff
|
|
252
|
+
- `max_diff_bytes` – maximum size (in UTF-8 bytes) of the diff/commit-log sent to the LLM; oversized input is truncated with a marker. `0` (default) means no limit
|
|
234
253
|
- `timeout` – HTTP timeout for LLM calls in seconds
|
|
235
254
|
- `branch_context` – include current branch name as LLM context
|
|
236
255
|
- `conventional` – use Conventional Commits format
|
|
@@ -241,6 +260,7 @@ git cai -g
|
|
|
241
260
|
- `pr_prompt_file` – optional path to a custom Markdown prompt for `--PR` (falls back to `~/.config/cai/pr_prompt.md`, then a built-in default)
|
|
242
261
|
- `stats` – opt in to local-only usage analytics (per-run row in a SQLite DB at `~/.local/share/git-cai/stats.db`); default `false`.
|
|
243
262
|
No diff content, commit messages, or file paths are stored — only metadata (provider, model, kind, repo name, token counts, latency, settings)
|
|
263
|
+
- `signoff` – append a `Signed-off-by:` trailer (built from git `user.name` / `user.email`) to every commit message; default `false`
|
|
244
264
|
|
|
245
265
|
---
|
|
246
266
|
|
|
@@ -254,16 +274,20 @@ In addition to `git cai`, the following options are available:
|
|
|
254
274
|
- `-C`, `--conventional` – use Conventional Commits format (`type(scope): description`)
|
|
255
275
|
- `-c`, `--crazy` – Trust the LLM and commit without checking
|
|
256
276
|
- `-d`, `--debug` – enable debug logging
|
|
277
|
+
- `-e`, `--temperature` `TEMPERATURE` – override the active provider's sampling temperature for this invocation (provider-scoped, like `-m`)
|
|
257
278
|
- `-F`, `--full-files` – attach the full contents of affected files alongside the diff (uses `full_files_prompt.md`)
|
|
258
279
|
- `-f`, `--files` `PATH` – limit the diff (and full-file content, if enabled) to PATH; repeat for multiple files
|
|
259
280
|
- `-g`, `--generate-config` – generate the default `cai_config.yml` in the current directory
|
|
260
281
|
- `-H`, `--set-home` – set a config value in home config (`key=value`), always targets `~/.config/cai/`
|
|
261
282
|
- `-h`, `--help` – show help and available commands
|
|
283
|
+
- `-I`, `--init` – interactive setup wizard (writes home config and tokens.yml)
|
|
262
284
|
- `-i`, `--install-completion` – install shell completion for bash, zsh, or fish
|
|
263
285
|
- `-l`, `--list` – list available information. Valid types: `config`, `editor`, `language`, `model`, `path`, `provider`, `style`
|
|
264
286
|
- `-m`, `--model` – override the model for this invocation (requires `-P`)
|
|
287
|
+
- `-o`, `--signoff` / `--no-signoff` – append a `Signed-off-by:` trailer (uses git `user.name` / `user.email`); applies to commit, amend, and squash modes
|
|
265
288
|
- `-P`, `--provider` – override the LLM provider for this invocation
|
|
266
289
|
- `-p`, `--generate-prompts` – generate default `commit_prompt.md` and `squash_prompt.md` in the current directory (for customization)
|
|
290
|
+
- `--print` – print the generated commit message to stdout and exit without committing (commit/amend modes only; mutually exclusive with `-c`)
|
|
267
291
|
- `-q`, `--sql true|false` – override stats writing for this run (wins over the persisted `stats` config)
|
|
268
292
|
- `-z`, `--stats` – show local-only usage analytics (commits/squashes/PRs per provider, tokens, average latency)
|
|
269
293
|
- `--since YYYY-MM-DD` – filter `--stats` to events on or after this date
|
|
@@ -273,6 +297,9 @@ In addition to `git cai`, the following options are available:
|
|
|
273
297
|
- `--base` `BRANCH` – explicit base branch for `--PR` (overrides auto-detection: `origin/HEAD` → `main` → `master`)
|
|
274
298
|
- `-S`, `--set` – set a config value (`key=value`) in repo config (requires existing repo config)
|
|
275
299
|
- `-s`, `--squash` `[N|HASH]` – squash commits on the current branch and summarize them. Without argument: squash all since branch checkout. With a number: squash the last N commits. With a commit hash: squash up to and including that commit
|
|
300
|
+
- `--style` `STYLE` – override the commit message style for this invocation (e.g. `funny`, `neutral`, `none`); validated against the supported styles
|
|
301
|
+
- `--language` `CODE` – override the commit message language for this invocation (e.g. `de`, `fr`, `none`); validated against supported codes
|
|
302
|
+
- `--emoji` / `--no-emoji` – override emoji usage for this invocation (use `--no-emoji` to disable when config enables it)
|
|
276
303
|
- `-T`, `--timeout` `SECONDS` – HTTP timeout for this invocation (overrides config)
|
|
277
304
|
- `-t`, `--time` – measure and log commit message generation time
|
|
278
305
|
- `-u`, `--update` – check for updates
|
|
@@ -383,6 +410,40 @@ git cai --stats --reset-stats # wipe all rows
|
|
|
383
410
|
|
|
384
411
|
Rows are split by `kind` (`commit`, `amend`, `squash`, `pr`) and capture provider, model, repo name, token counts, real LLM latency, and a snapshot of the active settings (language, style, emoji, temperature, prompt file).
|
|
385
412
|
|
|
413
|
+
### DCO sign-off
|
|
414
|
+
|
|
415
|
+
Projects that require Developer Certificate of Origin sign-off (Linux
|
|
416
|
+
kernel, many CNCF projects) can have cai append the trailer
|
|
417
|
+
automatically:
|
|
418
|
+
|
|
419
|
+
```sh
|
|
420
|
+
git cai --signoff # one-off
|
|
421
|
+
git cai -o -A # short flag, with amend
|
|
422
|
+
git cai -S signoff=true # enable persistently in the repo config
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
The trailer is built from your git `user.name` and `user.email`. When
|
|
426
|
+
the message already ends in a trailer block (e.g. an existing
|
|
427
|
+
`Co-authored-by:` or another `Signed-off-by:` line), the new sign-off
|
|
428
|
+
is appended to that block without an extra blank line. Re-running with
|
|
429
|
+
`--signoff` on a message that already carries the same trailer is a
|
|
430
|
+
no-op.
|
|
431
|
+
|
|
432
|
+
### Print-only output (no commit)
|
|
433
|
+
|
|
434
|
+
`--print` generates the commit message and writes it to stdout instead
|
|
435
|
+
of opening the editor or committing. Useful for scripting:
|
|
436
|
+
|
|
437
|
+
```sh
|
|
438
|
+
MSG=$(git cai --print)
|
|
439
|
+
git cai --print --conventional --signoff
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Diagnostic output (spinner, `--time`, `--debug`) goes to stderr, so the
|
|
443
|
+
command substitution above captures only the message. Limited to commit
|
|
444
|
+
and amend modes. Mutually exclusive with `-c` / `--crazy` (which
|
|
445
|
+
commits immediately).
|
|
446
|
+
|
|
386
447
|
### Changing configuration from the CLI
|
|
387
448
|
|
|
388
449
|
Instead of editing YAML files manually, use `--set` or `--set-home` to update config values.
|
|
@@ -47,9 +47,12 @@ Currently supported providers:
|
|
|
47
47
|
- Seamless integration with Git
|
|
48
48
|
- Supports multiple LLM providers and models
|
|
49
49
|
- Global configuration with per-repository overrides
|
|
50
|
+
- Interactive `--init` wizard for first-time setup (provider, token, language, style)
|
|
50
51
|
- Repository-specific language, style, and model selection
|
|
51
52
|
- Amend the last commit message with a regenerated one
|
|
52
53
|
- Conventional Commits format support
|
|
54
|
+
- `Signed-off-by:` (DCO) trailer support via `--signoff`
|
|
55
|
+
- `--print` mode that emits the generated message to stdout for scripting
|
|
53
56
|
- Change configuration from the command line
|
|
54
57
|
- Optional commit squashing with automatic summary generation (all, last N, or up to a specific commit)
|
|
55
58
|
- Pull Request description generator (`--PR`) that summarizes the commits between the current branch and its base
|
|
@@ -57,6 +60,8 @@ Currently supported providers:
|
|
|
57
60
|
- Token usage logging for API calls
|
|
58
61
|
- Branch name as LLM context
|
|
59
62
|
- Extra context for the LLM
|
|
63
|
+
- Per-invocation overrides for temperature, style, language, and emoji
|
|
64
|
+
- Optional large-diff guard (`max_diff_bytes`) that truncates oversized diffs before sending
|
|
60
65
|
- Generation time measurement
|
|
61
66
|
- Local-only usage analytics (per-provider commits, tokens, latency) with opt-in SQLite storage
|
|
62
67
|
- Shell completion for bash, zsh, and fish
|
|
@@ -114,6 +119,19 @@ The syntax is identical to `.gitignore`.
|
|
|
114
119
|
|
|
115
120
|
## Configuration
|
|
116
121
|
|
|
122
|
+
The fastest way to get started is the interactive wizard:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
git cai --init # or: git cai -I
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
It asks for a default provider, language, style, and emoji preference,
|
|
129
|
+
then collects the API key (input is hidden while you type). The wizard
|
|
130
|
+
writes `~/.config/cai/cai_config.yml` and, for providers that need one,
|
|
131
|
+
`~/.config/cai/tokens.yml` with mode `0600`. Existing entries for other
|
|
132
|
+
providers in `tokens.yml` are preserved. `--init` only writes home-scope
|
|
133
|
+
files — use `-g` / `--generate-config` to bootstrap a repo-level config.
|
|
134
|
+
|
|
117
135
|
On first execution, cai automatically creates the base configuration in your home directory.
|
|
118
136
|
|
|
119
137
|
- Global configuration:
|
|
@@ -201,6 +219,7 @@ git cai -g
|
|
|
201
219
|
- `squash_prompt_file` - path to the file where the prompt for the squash is stored
|
|
202
220
|
- `full_files_prompt_file` - path to the prompt used when `-F` / `--full-files` attaches full file contents
|
|
203
221
|
- `full_files` – attach always the full working-tree contents of affected files alongside the diff
|
|
222
|
+
- `max_diff_bytes` – maximum size (in UTF-8 bytes) of the diff/commit-log sent to the LLM; oversized input is truncated with a marker. `0` (default) means no limit
|
|
204
223
|
- `timeout` – HTTP timeout for LLM calls in seconds
|
|
205
224
|
- `branch_context` – include current branch name as LLM context
|
|
206
225
|
- `conventional` – use Conventional Commits format
|
|
@@ -211,6 +230,7 @@ git cai -g
|
|
|
211
230
|
- `pr_prompt_file` – optional path to a custom Markdown prompt for `--PR` (falls back to `~/.config/cai/pr_prompt.md`, then a built-in default)
|
|
212
231
|
- `stats` – opt in to local-only usage analytics (per-run row in a SQLite DB at `~/.local/share/git-cai/stats.db`); default `false`.
|
|
213
232
|
No diff content, commit messages, or file paths are stored — only metadata (provider, model, kind, repo name, token counts, latency, settings)
|
|
233
|
+
- `signoff` – append a `Signed-off-by:` trailer (built from git `user.name` / `user.email`) to every commit message; default `false`
|
|
214
234
|
|
|
215
235
|
---
|
|
216
236
|
|
|
@@ -224,16 +244,20 @@ In addition to `git cai`, the following options are available:
|
|
|
224
244
|
- `-C`, `--conventional` – use Conventional Commits format (`type(scope): description`)
|
|
225
245
|
- `-c`, `--crazy` – Trust the LLM and commit without checking
|
|
226
246
|
- `-d`, `--debug` – enable debug logging
|
|
247
|
+
- `-e`, `--temperature` `TEMPERATURE` – override the active provider's sampling temperature for this invocation (provider-scoped, like `-m`)
|
|
227
248
|
- `-F`, `--full-files` – attach the full contents of affected files alongside the diff (uses `full_files_prompt.md`)
|
|
228
249
|
- `-f`, `--files` `PATH` – limit the diff (and full-file content, if enabled) to PATH; repeat for multiple files
|
|
229
250
|
- `-g`, `--generate-config` – generate the default `cai_config.yml` in the current directory
|
|
230
251
|
- `-H`, `--set-home` – set a config value in home config (`key=value`), always targets `~/.config/cai/`
|
|
231
252
|
- `-h`, `--help` – show help and available commands
|
|
253
|
+
- `-I`, `--init` – interactive setup wizard (writes home config and tokens.yml)
|
|
232
254
|
- `-i`, `--install-completion` – install shell completion for bash, zsh, or fish
|
|
233
255
|
- `-l`, `--list` – list available information. Valid types: `config`, `editor`, `language`, `model`, `path`, `provider`, `style`
|
|
234
256
|
- `-m`, `--model` – override the model for this invocation (requires `-P`)
|
|
257
|
+
- `-o`, `--signoff` / `--no-signoff` – append a `Signed-off-by:` trailer (uses git `user.name` / `user.email`); applies to commit, amend, and squash modes
|
|
235
258
|
- `-P`, `--provider` – override the LLM provider for this invocation
|
|
236
259
|
- `-p`, `--generate-prompts` – generate default `commit_prompt.md` and `squash_prompt.md` in the current directory (for customization)
|
|
260
|
+
- `--print` – print the generated commit message to stdout and exit without committing (commit/amend modes only; mutually exclusive with `-c`)
|
|
237
261
|
- `-q`, `--sql true|false` – override stats writing for this run (wins over the persisted `stats` config)
|
|
238
262
|
- `-z`, `--stats` – show local-only usage analytics (commits/squashes/PRs per provider, tokens, average latency)
|
|
239
263
|
- `--since YYYY-MM-DD` – filter `--stats` to events on or after this date
|
|
@@ -243,6 +267,9 @@ In addition to `git cai`, the following options are available:
|
|
|
243
267
|
- `--base` `BRANCH` – explicit base branch for `--PR` (overrides auto-detection: `origin/HEAD` → `main` → `master`)
|
|
244
268
|
- `-S`, `--set` – set a config value (`key=value`) in repo config (requires existing repo config)
|
|
245
269
|
- `-s`, `--squash` `[N|HASH]` – squash commits on the current branch and summarize them. Without argument: squash all since branch checkout. With a number: squash the last N commits. With a commit hash: squash up to and including that commit
|
|
270
|
+
- `--style` `STYLE` – override the commit message style for this invocation (e.g. `funny`, `neutral`, `none`); validated against the supported styles
|
|
271
|
+
- `--language` `CODE` – override the commit message language for this invocation (e.g. `de`, `fr`, `none`); validated against supported codes
|
|
272
|
+
- `--emoji` / `--no-emoji` – override emoji usage for this invocation (use `--no-emoji` to disable when config enables it)
|
|
246
273
|
- `-T`, `--timeout` `SECONDS` – HTTP timeout for this invocation (overrides config)
|
|
247
274
|
- `-t`, `--time` – measure and log commit message generation time
|
|
248
275
|
- `-u`, `--update` – check for updates
|
|
@@ -353,6 +380,40 @@ git cai --stats --reset-stats # wipe all rows
|
|
|
353
380
|
|
|
354
381
|
Rows are split by `kind` (`commit`, `amend`, `squash`, `pr`) and capture provider, model, repo name, token counts, real LLM latency, and a snapshot of the active settings (language, style, emoji, temperature, prompt file).
|
|
355
382
|
|
|
383
|
+
### DCO sign-off
|
|
384
|
+
|
|
385
|
+
Projects that require Developer Certificate of Origin sign-off (Linux
|
|
386
|
+
kernel, many CNCF projects) can have cai append the trailer
|
|
387
|
+
automatically:
|
|
388
|
+
|
|
389
|
+
```sh
|
|
390
|
+
git cai --signoff # one-off
|
|
391
|
+
git cai -o -A # short flag, with amend
|
|
392
|
+
git cai -S signoff=true # enable persistently in the repo config
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
The trailer is built from your git `user.name` and `user.email`. When
|
|
396
|
+
the message already ends in a trailer block (e.g. an existing
|
|
397
|
+
`Co-authored-by:` or another `Signed-off-by:` line), the new sign-off
|
|
398
|
+
is appended to that block without an extra blank line. Re-running with
|
|
399
|
+
`--signoff` on a message that already carries the same trailer is a
|
|
400
|
+
no-op.
|
|
401
|
+
|
|
402
|
+
### Print-only output (no commit)
|
|
403
|
+
|
|
404
|
+
`--print` generates the commit message and writes it to stdout instead
|
|
405
|
+
of opening the editor or committing. Useful for scripting:
|
|
406
|
+
|
|
407
|
+
```sh
|
|
408
|
+
MSG=$(git cai --print)
|
|
409
|
+
git cai --print --conventional --signoff
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Diagnostic output (spinner, `--time`, `--debug`) goes to stderr, so the
|
|
413
|
+
command substitution above captures only the message. Limited to commit
|
|
414
|
+
and amend modes. Mutually exclusive with `-c` / `--crazy` (which
|
|
415
|
+
commits immediately).
|
|
416
|
+
|
|
356
417
|
### Changing configuration from the CLI
|
|
357
418
|
|
|
358
419
|
Instead of editing YAML files manually, use `--set` or `--set-home` to update config values.
|
|
@@ -12,18 +12,23 @@ SYNOPSIS
|
|
|
12
12
|
[verse]
|
|
13
13
|
`git cai` [-A | --amend] [-a | --all] [-C | --conventional]
|
|
14
14
|
[-b | --branch] [-c | --crazy] [-d | --debug]
|
|
15
|
+
[-e TEMPERATURE | --temperature TEMPERATURE]
|
|
15
16
|
[-F | --full-files | --no-full-files] [-f PATH | --files PATH]
|
|
16
17
|
[-g | --generate-config]
|
|
17
18
|
[-H KEY=VALUE | --set-home KEY=VALUE] [-h | --help]
|
|
19
|
+
[-I | --init]
|
|
18
20
|
[-i | --install-completion]
|
|
19
21
|
[-l [config|editor|language|model|path|provider|style] |
|
|
20
22
|
--list [config|editor|language|model|path|provider|style]]
|
|
21
23
|
[-m MODEL | --model MODEL]
|
|
24
|
+
[-o | --signoff | --no-signoff]
|
|
22
25
|
[-P PROVIDER | --provider PROVIDER] [-p | --generate-prompts]
|
|
26
|
+
[--print]
|
|
23
27
|
[-r | --PR] [--base BRANCH]
|
|
24
28
|
[-S KEY=VALUE | --set KEY=VALUE]
|
|
25
29
|
[-s [N|HASH] | --squash [N|HASH]]
|
|
26
30
|
[-q true|false | --sql true|false]
|
|
31
|
+
[--style STYLE] [--language CODE] [--emoji | --no-emoji]
|
|
27
32
|
[-T SECONDS | --timeout SECONDS]
|
|
28
33
|
[-t | --time] [-u | --update] [-v | --version]
|
|
29
34
|
[-x CONTEXT | --context CONTEXT]
|
|
@@ -46,7 +51,16 @@ git-cai behaves like `git commit`, but with the commit message pre-filled:
|
|
|
46
51
|
|
|
47
52
|
SETUP
|
|
48
53
|
-----
|
|
49
|
-
|
|
54
|
+
Guided setup (recommended):
|
|
55
|
+
|
|
56
|
+
- Run `git cai --init` (or `-I`). The interactive wizard asks for a
|
|
57
|
+
default provider, language, style, and emoji preference, then
|
|
58
|
+
collects the API key (hidden input). It writes
|
|
59
|
+
`~/.config/cai/cai_config.yml` and, for providers that need one,
|
|
60
|
+
`~/.config/cai/tokens.yml` with mode `0600`. Existing token entries
|
|
61
|
+
for other providers are preserved.
|
|
62
|
+
|
|
63
|
+
First run / configuration (manual):
|
|
50
64
|
|
|
51
65
|
- Run `git cai` once. If no config exists yet, git-cai creates:
|
|
52
66
|
`~/.config/cai/cai_config.yml` (global config) and ensures default prompt files exist:
|
|
@@ -169,6 +183,17 @@ Cannot be combined with `--help` or `--version`.
|
|
|
169
183
|
git cai -d
|
|
170
184
|
----
|
|
171
185
|
|
|
186
|
+
-e, --temperature TEMPERATURE::
|
|
187
|
+
Override the sampling temperature of the active provider for this invocation
|
|
188
|
+
only. Higher values produce more varied wording; lower values are more
|
|
189
|
+
deterministic. The override is provider-scoped, mirroring `--model`, and does
|
|
190
|
+
not change the persisted `cai_config.yml`.
|
|
191
|
+
+
|
|
192
|
+
----
|
|
193
|
+
git cai -e 0.7
|
|
194
|
+
git cai -P anthropic -e 0.2
|
|
195
|
+
----
|
|
196
|
+
|
|
172
197
|
-F, --full-files::
|
|
173
198
|
Send the full working-tree contents of every staged file alongside the diff.
|
|
174
199
|
By default, git-cai sends only the staged diff to the LLM. With `-F`, the
|
|
@@ -248,6 +273,28 @@ git cai -H groq.model=llama-3.3-70b
|
|
|
248
273
|
Show a summary of available flags and usage information. When a manual page
|
|
249
274
|
is installed, the full manual is opened instead.
|
|
250
275
|
|
|
276
|
+
-I, --init::
|
|
277
|
+
Run the interactive setup wizard. Bootstraps the home-scope
|
|
278
|
+
configuration only: writes `~/.config/cai/cai_config.yml` and (for
|
|
279
|
+
providers that require one) `~/.config/cai/tokens.yml` with mode
|
|
280
|
+
`0600`.
|
|
281
|
+
+
|
|
282
|
+
The wizard asks for a default provider, language, commit-message
|
|
283
|
+
style, whether to use emoji, and — for providers other than `ollama`
|
|
284
|
+
— the API key. Input for the API key is hidden while you type.
|
|
285
|
+
+
|
|
286
|
+
If `~/.config/cai/cai_config.yml` already exists, the wizard prompts
|
|
287
|
+
before overwriting it. Existing entries in `tokens.yml` for other
|
|
288
|
+
providers are preserved; only the chosen provider's key is updated.
|
|
289
|
+
+
|
|
290
|
+
For repository-level configuration use `-g`/`--generate-config`
|
|
291
|
+
instead — `--init` only writes home-scope files.
|
|
292
|
+
+
|
|
293
|
+
----
|
|
294
|
+
git cai --init
|
|
295
|
+
git cai -I
|
|
296
|
+
----
|
|
297
|
+
|
|
251
298
|
-i, --install-completion::
|
|
252
299
|
Install shell completion for `git cai`. Supports bash, zsh, and fish.
|
|
253
300
|
Completions cover all flags and provider names for `--provider`.
|
|
@@ -286,6 +333,33 @@ git cai -P anthropic -m claude-haiku-4-5
|
|
|
286
333
|
git cai -P ollama -m mistral
|
|
287
334
|
----
|
|
288
335
|
|
|
336
|
+
-o, --signoff / --no-signoff::
|
|
337
|
+
Append a `Signed-off-by:` trailer to the generated commit message
|
|
338
|
+
using your configured git `user.name` and `user.email`. Applies in
|
|
339
|
+
COMMIT, AMEND, and SQUASH modes.
|
|
340
|
+
+
|
|
341
|
+
If the message body already ends in a trailer block (e.g. an existing
|
|
342
|
+
`Co-authored-by:` or `Signed-off-by:` line) the new sign-off is added
|
|
343
|
+
to that block without an extra blank line. A duplicate trailer for the
|
|
344
|
+
same identity is detected and skipped, so re-running with
|
|
345
|
+
`--signoff` on a message that already carries one is a no-op.
|
|
346
|
+
+
|
|
347
|
+
Use `--no-signoff` to explicitly disable for the current run when the
|
|
348
|
+
persisted config has `signoff: true`. To enable permanently:
|
|
349
|
+
+
|
|
350
|
+
----
|
|
351
|
+
git cai -S signoff=true
|
|
352
|
+
----
|
|
353
|
+
+
|
|
354
|
+
Errors out if either git `user.name` or `user.email` is empty.
|
|
355
|
+
+
|
|
356
|
+
----
|
|
357
|
+
git cai --signoff
|
|
358
|
+
git cai -o -c
|
|
359
|
+
git cai -A --signoff
|
|
360
|
+
git cai -s --signoff
|
|
361
|
+
----
|
|
362
|
+
|
|
289
363
|
-P, --provider PROVIDER::
|
|
290
364
|
Override the LLM provider for this invocation. The model and temperature
|
|
291
365
|
from the configuration for that provider are used unless `--model` is also
|
|
@@ -310,6 +384,27 @@ overwrites.
|
|
|
310
384
|
git cai -p
|
|
311
385
|
----
|
|
312
386
|
|
|
387
|
+
--print::
|
|
388
|
+
Generate the commit message, print it to stdout, and exit without
|
|
389
|
+
opening the editor and without committing. Useful for scripting:
|
|
390
|
+
+
|
|
391
|
+
----
|
|
392
|
+
MSG=$(git cai --print)
|
|
393
|
+
----
|
|
394
|
+
+
|
|
395
|
+
Composes with `--conventional`, `--signoff`, `--branch`, `--context`,
|
|
396
|
+
`--provider`, `--model`, and the other modifiers — the printed output
|
|
397
|
+
reflects every modifier as if you were committing.
|
|
398
|
+
+
|
|
399
|
+
Limited to COMMIT and AMEND modes. Mutually exclusive with `--crazy`
|
|
400
|
+
(the two flags are contradictory: `--crazy` commits immediately,
|
|
401
|
+
`--print` does not commit at all).
|
|
402
|
+
+
|
|
403
|
+
Diagnostic output (the spinner, `--time` measurements, `--debug` logs)
|
|
404
|
+
goes to stderr, so command substitution captures only the message.
|
|
405
|
+
Stats recording is unaffected — generations made with `--print` are
|
|
406
|
+
still recorded when stats are enabled.
|
|
407
|
+
|
|
313
408
|
-q, --sql VALUE::
|
|
314
409
|
Per-invocation override for `stats.enabled`. VALUE is `true` or `false`
|
|
315
410
|
(also accepts `yes/no`, `on/off`, `1/0`). Wins over the persisted config
|
|
@@ -406,6 +501,42 @@ git cai -s 3
|
|
|
406
501
|
git cai -s a1b2c3d
|
|
407
502
|
----
|
|
408
503
|
|
|
504
|
+
--style STYLE::
|
|
505
|
+
Override the commit message tone style for this invocation only (e.g.
|
|
506
|
+
`professional`, `neutral`, `friendly`, `funny`, `excited`, `sarcastic`,
|
|
507
|
+
`apologetic`, `academic`, or `none` to let the model choose). Run
|
|
508
|
+
`git cai -l style` to see all styles with examples. An invalid value is
|
|
509
|
+
rejected with an error. To change the style permanently, set `style:` in
|
|
510
|
+
`cai_config.yml`.
|
|
511
|
+
+
|
|
512
|
+
----
|
|
513
|
+
git cai --style funny
|
|
514
|
+
git cai --style none
|
|
515
|
+
----
|
|
516
|
+
|
|
517
|
+
--language CODE::
|
|
518
|
+
Override the commit message language for this invocation only, using a
|
|
519
|
+
supported language code (e.g. `de`, `fr`, `es`), or `none` to omit the
|
|
520
|
+
language instruction. Run `git cai -l language` to list supported codes. An
|
|
521
|
+
unsupported code is rejected with an error. To change it permanently, set
|
|
522
|
+
`language:` in `cai_config.yml`.
|
|
523
|
+
+
|
|
524
|
+
----
|
|
525
|
+
git cai --language de
|
|
526
|
+
git cai --language none
|
|
527
|
+
----
|
|
528
|
+
|
|
529
|
+
--emoji / --no-emoji::
|
|
530
|
+
Override emoji usage for this invocation only. `--emoji` instructs the model
|
|
531
|
+
to use relevant emojis; `--no-emoji` disables them even when the persisted
|
|
532
|
+
config enables emoji. To change the default permanently, set `emoji:` in
|
|
533
|
+
`cai_config.yml`.
|
|
534
|
+
+
|
|
535
|
+
----
|
|
536
|
+
git cai --no-emoji
|
|
537
|
+
git cai --emoji
|
|
538
|
+
----
|
|
539
|
+
|
|
409
540
|
-T, --timeout SECONDS::
|
|
410
541
|
Override the HTTP timeout for the LLM call in this invocation. The default
|
|
411
542
|
is 30 seconds for remote providers and 300 seconds for Ollama (since local
|
|
@@ -742,6 +873,10 @@ Available configuration keys:
|
|
|
742
873
|
- `timeout` -- HTTP timeout in seconds for remote LLM calls (default `30`)
|
|
743
874
|
- `full_files` -- send full working-tree contents of staged files alongside
|
|
744
875
|
the diff (`true`/`false`, default `false`)
|
|
876
|
+
- `max_diff_bytes` -- maximum size (in UTF-8 bytes) of the diff/commit-log
|
|
877
|
+
sent to the LLM. When the input exceeds this, it is truncated and a marker
|
|
878
|
+
line is appended so the model knows it was cut. `0` (the default) means no
|
|
879
|
+
limit. Useful to avoid context-window errors on very large staged changes.
|
|
745
880
|
- `pr_to_file` -- when running `--PR`, write the generated PR description
|
|
746
881
|
to a Markdown file in the repository root instead of printing it to
|
|
747
882
|
stdout (`true`/`false`, default `false`)
|