git-cai-cli 0.8.1__tar.gz → 0.10.0__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.8.1 → git_cai_cli-0.10.0}/.gitignore +1 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.proselintrc +1 -1
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.pylintrc +2 -2
- git_cai_cli-0.10.0/CLAUDE.md +62 -0
- {git_cai_cli-0.8.1/src/git_cai_cli.egg-info → git_cai_cli-0.10.0}/PKG-INFO +69 -2
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/README.md +68 -1
- git_cai_cli-0.10.0/docs/git-cai.txt +477 -0
- git_cai_cli-0.10.0/docs/man/git-cai.1 +949 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/pyproject.toml +3 -0
- git_cai_cli-0.10.0/src/git_cai_cli/_version.py +24 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/cli/cli.py +81 -3
- git_cai_cli-0.10.0/src/git_cai_cli/cli/helptext.py +49 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/cli/modes.py +24 -4
- git_cai_cli-0.10.0/src/git_cai_cli/core/completion.py +195 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/config.py +171 -7
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/gitutils.py +30 -8
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/llm.py +138 -30
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/options.py +23 -14
- git_cai_cli-0.10.0/src/git_cai_cli/core/prompts_fallback.py +26 -0
- git_cai_cli-0.10.0/src/git_cai_cli/core/spinner.py +53 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/squash.py +36 -4
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/validate.py +3 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/main.py +56 -14
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0/src/git_cai_cli.egg-info}/PKG-INFO +69 -2
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli.egg-info/SOURCES.txt +10 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/integration/test_modes_integration.py +21 -5
- git_cai_cli-0.10.0/tests/unit/test_amend.py +112 -0
- git_cai_cli-0.10.0/tests/unit/test_cli.py +180 -0
- git_cai_cli-0.10.0/tests/unit/test_completion.py +229 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_config.py +67 -0
- git_cai_cli-0.10.0/tests/unit/test_conventional.py +74 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_llm.py +209 -0
- git_cai_cli-0.10.0/tests/unit/test_main.py +113 -0
- git_cai_cli-0.10.0/tests/unit/test_modes.py +245 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_prompt_loading.py +19 -17
- git_cai_cli-0.10.0/tests/unit/test_set_config.py +176 -0
- git_cai_cli-0.10.0/tests/unit/test_spinner.py +91 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_validate.py +79 -0
- git_cai_cli-0.8.1/docs/git-cai.txt +0 -198
- git_cai_cli-0.8.1/docs/man/git-cai.1 +0 -421
- git_cai_cli-0.8.1/src/git_cai_cli/_version.py +0 -34
- git_cai_cli-0.8.1/src/git_cai_cli/cli/helptext.py +0 -41
- git_cai_cli-0.8.1/tests/unit/test_cli.py +0 -54
- git_cai_cli-0.8.1/tests/unit/test_modes.py +0 -122
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.caiignore +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.gitattributes +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/cd/.SRCINFO +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/cd/PKGBUILD +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/ci/_version.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/ci/cai_config.ci.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/ci/tokens.ci.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/workflows/python-tests.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/workflows/release.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.github/workflows/release_aur.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.bandit.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.checkov.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.flake8 +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.ls-lint.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.markdown-link-check.json +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.markdownlint.json +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/.yamllint.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/check_git_branch_name.sh +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/lychee.toml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.linters/pyrightconfig.json +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.markdownlintignore +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.mega-linter.yml +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.semgrepignore +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/.trivyignore +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/LICENSE +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/Makefile +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/setup.cfg +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/__init__.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/cli/__init__.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/__init__.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/editors.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/core/languages.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/defaults/__init__.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/defaults/commit_prompt.md +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli/defaults/squash_prompt.md +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli.egg-info/dependency_links.txt +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli.egg-info/entry_points.txt +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli.egg-info/requires.txt +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/src/git_cai_cli.egg-info/top_level.txt +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/conftest.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/integration/test_cli_integration.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/integration/test_config_integration.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/integration/test_gitutils_integration.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/integration/test_options_integration.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/integration/test_squash_integration.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_gitutils.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_helptext.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_options.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/tests/unit/test_squash.py +0 -0
- {git_cai_cli-0.8.1 → git_cai_cli-0.10.0}/uv.lock +0 -0
|
@@ -68,8 +68,8 @@ check-protected-access-in-special-methods=no
|
|
|
68
68
|
[DESIGN]
|
|
69
69
|
max-args=15 # Max arguments per function
|
|
70
70
|
max-attributes=7 # Max attributes per class
|
|
71
|
-
max-branches=
|
|
72
|
-
max-locals=
|
|
71
|
+
max-branches=30 # Max branches per function
|
|
72
|
+
max-locals=50 # Max locals per function
|
|
73
73
|
max-returns=10 # Max return statements per function
|
|
74
74
|
max-statements=100 # Max total statements per function
|
|
75
75
|
max-public-methods=20 # Max public methods per class
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project
|
|
6
|
+
|
|
7
|
+
**git-cai** — A Python CLI tool that uses LLMs to generate git commit messages. Installed as `git-cai` (invoked as `git cai`). Supports 8 LLM providers: OpenAI, Anthropic, Gemini, Groq, xAI, Mistral, DeepSeek, and Ollama (local).
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
make test # Run all tests (uv run pytest)
|
|
13
|
+
make lint # Branch name check + MegaLinter
|
|
14
|
+
make lint-fix # Auto-fix lint issues
|
|
15
|
+
make clean # Clean uv cache and .venv
|
|
16
|
+
|
|
17
|
+
# Single test file
|
|
18
|
+
uv run pytest tests/unit/test_llm.py -v
|
|
19
|
+
|
|
20
|
+
# Single test function
|
|
21
|
+
uv run pytest tests/unit/test_llm.py::test_function_name -v
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Architecture
|
|
25
|
+
|
|
26
|
+
Entry point: `src/git_cai_cli/cli/cli.py` (Typer app) → `main.py` (dispatcher)
|
|
27
|
+
|
|
28
|
+
### Modes (cli/modes.py)
|
|
29
|
+
|
|
30
|
+
- **COMMIT** (default): git diff → LLM → user edits → commit
|
|
31
|
+
- **LIST**: show supported languages/styles/editors
|
|
32
|
+
- **SQUASH**: squash branch commits with generated summary
|
|
33
|
+
- **UPDATE**: check PyPI for updates
|
|
34
|
+
|
|
35
|
+
### Core Modules (core/)
|
|
36
|
+
|
|
37
|
+
- **config.py** — Config loading with precedence: repo `cai_config.yml` > home `~/.config/cai/cai_config.yml` > bundled defaults
|
|
38
|
+
- **llm.py** — `CommitMessageGenerator` class with `_dispatch_generate()` routing to provider-specific methods (`generate_openai()`, `generate_anthropic()`, etc.)
|
|
39
|
+
- **gitutils.py** — Git operations (find root, diff with `.caiignore` support, commit)
|
|
40
|
+
- **validate.py** — Config and LLM call validation
|
|
41
|
+
- **squash.py** — Squash commit workflow (stage → generate summary → editor → reset + commit)
|
|
42
|
+
- **options.py** — `CliManager` orchestrating CLI operations
|
|
43
|
+
|
|
44
|
+
### Prompt Fallback Chain
|
|
45
|
+
|
|
46
|
+
File (repo-level) → File (user home) → Bundled package (`defaults/*.md`) → Hardcoded string (`prompts_fallback.py`)
|
|
47
|
+
|
|
48
|
+
### Tokens
|
|
49
|
+
|
|
50
|
+
API tokens loaded from `~/.config/cai/tokens.yml`. Ollama is in `TOKENLESS_PROVIDERS` (no key needed).
|
|
51
|
+
|
|
52
|
+
## Testing
|
|
53
|
+
|
|
54
|
+
- Unit tests in `tests/unit/`, integration tests in `tests/integration/`
|
|
55
|
+
- Uses `requests-mock` for HTTP mocking
|
|
56
|
+
- CI tests against Python 3.10–3.14
|
|
57
|
+
|
|
58
|
+
## Build & Versioning
|
|
59
|
+
|
|
60
|
+
- Package manager: **uv**
|
|
61
|
+
- Version: auto-generated from git tags via `setuptools-scm` → `src/git_cai_cli/_version.py`
|
|
62
|
+
- Do not edit `_version.py` manually
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-cai-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
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
|
|
@@ -75,9 +75,16 @@ Currently supported providers:
|
|
|
75
75
|
- Generates meaningful, context-aware commit messages using an LLM
|
|
76
76
|
- Seamless integration with Git
|
|
77
77
|
- Supports multiple LLM providers and models
|
|
78
|
+
- Override provider and model per invocation (`-P`, `-m`)
|
|
78
79
|
- Global configuration with per-repository overrides
|
|
79
80
|
- Repository-specific language, style, and model selection
|
|
81
|
+
- Amend the last commit message with a regenerated one (`-A`)
|
|
82
|
+
- Conventional Commits format support (`-C`)
|
|
83
|
+
- Change configuration from the command line (`-S`, `-H`)
|
|
80
84
|
- Optional commit squashing with automatic summary generation
|
|
85
|
+
- Token usage logging for API calls
|
|
86
|
+
- Generation time measurement (`-t`)
|
|
87
|
+
- Shell completion for bash, zsh, and fish (`-i`)
|
|
81
88
|
|
|
82
89
|
---
|
|
83
90
|
|
|
@@ -210,6 +217,9 @@ git cai -g
|
|
|
210
217
|
- `load_tokens_from` – path to the file where API tokens are stored
|
|
211
218
|
- `prompt_file` - path to the file where the prompt for the commit is stored
|
|
212
219
|
- `squash_prompt_file` - path to the file where the prompt for the squash is stored
|
|
220
|
+
- `conventional` – use Conventional Commits format (default: `false`)
|
|
221
|
+
- `token_logging` – log token usage after each LLM call (default: `true` for new installs)
|
|
222
|
+
- `measure_time` – log generation time (default: `false`)
|
|
213
223
|
|
|
214
224
|
---
|
|
215
225
|
|
|
@@ -217,17 +227,74 @@ git cai -g
|
|
|
217
227
|
|
|
218
228
|
In addition to `git cai`, the following options are available:
|
|
219
229
|
|
|
220
|
-
- `-
|
|
230
|
+
- `-A`, `--amend` – regenerate and amend the last commit message
|
|
221
231
|
- `-a`, `--all` – stage all tracked modified and deleted files
|
|
232
|
+
- `-C`, `--conventional` – use Conventional Commits format (`type(scope): description`)
|
|
222
233
|
- `-c`, `--crazy` – Trust the LLM and commit without checking
|
|
223
234
|
- `-d`, `--debug` – enable debug logging
|
|
224
235
|
- `-g`, `--generate-config` – generate the default `cai_config.yml` in the current directory
|
|
236
|
+
- `-h`, `--help` – show help and available commands
|
|
237
|
+
- `-i`, `--install-completion` – install shell completion for bash, zsh, or fish
|
|
225
238
|
- `-l`, `--list` – list available languages, styles, and supported editors
|
|
239
|
+
- `-m`, `--model` – override the model for this invocation (requires `-P`)
|
|
226
240
|
- `-p`, `--generate-prompts` – generate default `commit_prompt.md` and `squash_prompt.md` in the current directory (for customization)
|
|
241
|
+
- `-P`, `--provider` – override the LLM provider for this invocation
|
|
242
|
+
- `-S`, `--set` – set a config value (`key=value`) in repo config (requires existing repo config)
|
|
243
|
+
- `-H`, `--set-home` – set a config value in home config (`key=value`), always targets `~/.config/cai/`
|
|
227
244
|
- `-s`, `--squash` – squash commits on the current branch and summarize them
|
|
245
|
+
- `-t`, `--time` – measure and log commit message generation time
|
|
228
246
|
- `-u`, `--update` – check for updates
|
|
229
247
|
- `-v`, `--version` – show the installed version
|
|
230
248
|
|
|
249
|
+
### Amend
|
|
250
|
+
|
|
251
|
+
To regenerate the last commit message and amend it:
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
git cai -A
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
This reads the diff from the most recent commit, sends it to the LLM, and opens the editor for review.
|
|
258
|
+
Use with `-c` to amend immediately without the editor: `git cai -A -c`.
|
|
259
|
+
|
|
260
|
+
### Conventional Commits
|
|
261
|
+
|
|
262
|
+
To generate commit messages in [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
263
|
+
|
|
264
|
+
```sh
|
|
265
|
+
git cai -C
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
This enforces the `type(scope): description` structure. Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`. Use `!` after the type/scope for breaking changes.
|
|
269
|
+
|
|
270
|
+
To enable it permanently:
|
|
271
|
+
|
|
272
|
+
```sh
|
|
273
|
+
git cai -S conventional=true
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Changing configuration from the CLI
|
|
277
|
+
|
|
278
|
+
Instead of editing YAML files manually, use `--set` or `--set-home` to update config values.
|
|
279
|
+
|
|
280
|
+
`--set` (`-S`) targets the **repo config** (requires an existing `cai_config.yml` in the repo root):
|
|
281
|
+
|
|
282
|
+
```sh
|
|
283
|
+
git cai -S default=anthropic # change the default provider
|
|
284
|
+
git cai -S emoji=false # disable emojis
|
|
285
|
+
git cai -S groq.model=llama-3.3-70b # nested key (dot notation)
|
|
286
|
+
git cai -S openai.temperature=0.7 # set temperature as float
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
If no repo config exists, an error is shown. Use `git cai -g` to create one first.
|
|
290
|
+
|
|
291
|
+
`--set-home` (`-H`) always targets the **home (default) config** (`~/.config/cai/`):
|
|
292
|
+
|
|
293
|
+
```sh
|
|
294
|
+
git cai -H language=de
|
|
295
|
+
git cai -H emoji=false
|
|
296
|
+
```
|
|
297
|
+
|
|
231
298
|
---
|
|
232
299
|
|
|
233
300
|
## License
|
|
@@ -46,9 +46,16 @@ Currently supported providers:
|
|
|
46
46
|
- Generates meaningful, context-aware commit messages using an LLM
|
|
47
47
|
- Seamless integration with Git
|
|
48
48
|
- Supports multiple LLM providers and models
|
|
49
|
+
- Override provider and model per invocation (`-P`, `-m`)
|
|
49
50
|
- Global configuration with per-repository overrides
|
|
50
51
|
- Repository-specific language, style, and model selection
|
|
52
|
+
- Amend the last commit message with a regenerated one (`-A`)
|
|
53
|
+
- Conventional Commits format support (`-C`)
|
|
54
|
+
- Change configuration from the command line (`-S`, `-H`)
|
|
51
55
|
- Optional commit squashing with automatic summary generation
|
|
56
|
+
- Token usage logging for API calls
|
|
57
|
+
- Generation time measurement (`-t`)
|
|
58
|
+
- Shell completion for bash, zsh, and fish (`-i`)
|
|
52
59
|
|
|
53
60
|
---
|
|
54
61
|
|
|
@@ -181,6 +188,9 @@ git cai -g
|
|
|
181
188
|
- `load_tokens_from` – path to the file where API tokens are stored
|
|
182
189
|
- `prompt_file` - path to the file where the prompt for the commit is stored
|
|
183
190
|
- `squash_prompt_file` - path to the file where the prompt for the squash is stored
|
|
191
|
+
- `conventional` – use Conventional Commits format (default: `false`)
|
|
192
|
+
- `token_logging` – log token usage after each LLM call (default: `true` for new installs)
|
|
193
|
+
- `measure_time` – log generation time (default: `false`)
|
|
184
194
|
|
|
185
195
|
---
|
|
186
196
|
|
|
@@ -188,17 +198,74 @@ git cai -g
|
|
|
188
198
|
|
|
189
199
|
In addition to `git cai`, the following options are available:
|
|
190
200
|
|
|
191
|
-
- `-
|
|
201
|
+
- `-A`, `--amend` – regenerate and amend the last commit message
|
|
192
202
|
- `-a`, `--all` – stage all tracked modified and deleted files
|
|
203
|
+
- `-C`, `--conventional` – use Conventional Commits format (`type(scope): description`)
|
|
193
204
|
- `-c`, `--crazy` – Trust the LLM and commit without checking
|
|
194
205
|
- `-d`, `--debug` – enable debug logging
|
|
195
206
|
- `-g`, `--generate-config` – generate the default `cai_config.yml` in the current directory
|
|
207
|
+
- `-h`, `--help` – show help and available commands
|
|
208
|
+
- `-i`, `--install-completion` – install shell completion for bash, zsh, or fish
|
|
196
209
|
- `-l`, `--list` – list available languages, styles, and supported editors
|
|
210
|
+
- `-m`, `--model` – override the model for this invocation (requires `-P`)
|
|
197
211
|
- `-p`, `--generate-prompts` – generate default `commit_prompt.md` and `squash_prompt.md` in the current directory (for customization)
|
|
212
|
+
- `-P`, `--provider` – override the LLM provider for this invocation
|
|
213
|
+
- `-S`, `--set` – set a config value (`key=value`) in repo config (requires existing repo config)
|
|
214
|
+
- `-H`, `--set-home` – set a config value in home config (`key=value`), always targets `~/.config/cai/`
|
|
198
215
|
- `-s`, `--squash` – squash commits on the current branch and summarize them
|
|
216
|
+
- `-t`, `--time` – measure and log commit message generation time
|
|
199
217
|
- `-u`, `--update` – check for updates
|
|
200
218
|
- `-v`, `--version` – show the installed version
|
|
201
219
|
|
|
220
|
+
### Amend
|
|
221
|
+
|
|
222
|
+
To regenerate the last commit message and amend it:
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
git cai -A
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
This reads the diff from the most recent commit, sends it to the LLM, and opens the editor for review.
|
|
229
|
+
Use with `-c` to amend immediately without the editor: `git cai -A -c`.
|
|
230
|
+
|
|
231
|
+
### Conventional Commits
|
|
232
|
+
|
|
233
|
+
To generate commit messages in [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
234
|
+
|
|
235
|
+
```sh
|
|
236
|
+
git cai -C
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
This enforces the `type(scope): description` structure. Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`. Use `!` after the type/scope for breaking changes.
|
|
240
|
+
|
|
241
|
+
To enable it permanently:
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
git cai -S conventional=true
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Changing configuration from the CLI
|
|
248
|
+
|
|
249
|
+
Instead of editing YAML files manually, use `--set` or `--set-home` to update config values.
|
|
250
|
+
|
|
251
|
+
`--set` (`-S`) targets the **repo config** (requires an existing `cai_config.yml` in the repo root):
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
git cai -S default=anthropic # change the default provider
|
|
255
|
+
git cai -S emoji=false # disable emojis
|
|
256
|
+
git cai -S groq.model=llama-3.3-70b # nested key (dot notation)
|
|
257
|
+
git cai -S openai.temperature=0.7 # set temperature as float
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
If no repo config exists, an error is shown. Use `git cai -g` to create one first.
|
|
261
|
+
|
|
262
|
+
`--set-home` (`-H`) always targets the **home (default) config** (`~/.config/cai/`):
|
|
263
|
+
|
|
264
|
+
```sh
|
|
265
|
+
git cai -H language=de
|
|
266
|
+
git cai -H emoji=false
|
|
267
|
+
```
|
|
268
|
+
|
|
202
269
|
---
|
|
203
270
|
|
|
204
271
|
## License
|