git-cai-cli 0.17.4__tar.gz → 0.18.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.17.4 → git_cai_cli-0.18.0}/PKG-INFO +42 -3
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/README.md +41 -2
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/cai_config.yml +1 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/docs/git-cai.txt +105 -24
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/docs/man/git-cai.1 +235 -26
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/_version.py +3 -3
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/cli.py +7 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/helptext.py +2 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/changelog.py +7 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/completion.py +5 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/config.py +72 -8
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/doctor.py +15 -2
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/explain.py +7 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/generation.py +6 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/init.py +21 -8
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/llm.py +51 -6
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/options.py +3 -7
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/pr.py +7 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/release.py +7 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/split.py +7 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/squash.py +8 -2
- git_cai_cli-0.18.0/src/git_cai_cli/core/subscription.py +270 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/validate.py +6 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/main.py +12 -1
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/PKG-INFO +42 -3
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/SOURCES.txt +2 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/scm_file_list.json +2 -0
- git_cai_cli-0.18.0/src/git_cai_cli.egg-info/scm_version.json +8 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_init.py +2 -2
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_main.py +1 -0
- git_cai_cli-0.18.0/tests/unit/test_subscription.py +657 -0
- git_cai_cli-0.17.4/src/git_cai_cli.egg-info/scm_version.json +0 -8
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.caiignore +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.gitattributes +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/cd/.SRCINFO +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/cd/PKGBUILD +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/ci/_version.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/ci/cai_config.ci.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/ci/tokens.ci.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/workflows/python-tests.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/workflows/release.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.github/workflows/release_aur.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.gitignore +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.bandit.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.checkov.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.flake8 +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.ls-lint.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.markdownlint.json +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.proselintrc.json +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.pylintrc +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/.yamllint.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/check_git_branch_name.sh +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/lychee.toml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.linters/pyrightconfig.json +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.markdownlintignore +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.mega-linter.yml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.semgrepignore +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/.trivyignore +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/CLAUDE.md +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/LICENSE +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/Makefile +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/pyproject.toml +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/setup.cfg +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/__init__.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/__init__.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/modes.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/__init__.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/gitutils.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/languages.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/prompts_fallback.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/secrets.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/spinner.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli/core/stats.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/dependency_links.txt +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/entry_points.txt +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/requires.txt +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/top_level.txt +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/conftest.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_cli_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_config_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_gitutils_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_modes_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_options_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_pr_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/integration/test_squash_integration.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_amend.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_branch_context.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_changelog.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_classification.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_cli.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_completion.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_config.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_conventional.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_custom_provider.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_doctor.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_explain.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_generation.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_gitutils.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_helptext.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_llm.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_modes.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_options.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_pr.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_print.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_prompt_loading.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_release.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_secrets.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_set_config.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_signoff.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_spinner.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_split.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_squash.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_stats.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/tests/unit/test_validate.py +0 -0
- {git_cai_cli-0.17.4 → git_cai_cli-0.18.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-cai-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.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
|
|
@@ -49,8 +49,11 @@ Currently supported providers:
|
|
|
49
49
|
- Mistral
|
|
50
50
|
- DeepSeek
|
|
51
51
|
- Ollama (local)
|
|
52
|
+
- GitHub Copilot (subscription only)
|
|
52
53
|
- Any OpenAI compatible API (OpenRouter, Together, Cerebras, LM Studio, vLLM, llama.cpp, LiteLLM, ...) via `base_url`
|
|
53
54
|
|
|
55
|
+
Anthropic and OpenAI can also run on a Claude or ChatGPT subscription instead of an API key.
|
|
56
|
+
|
|
54
57
|
---
|
|
55
58
|
|
|
56
59
|
## Prerequisites
|
|
@@ -60,6 +63,7 @@ Currently supported providers:
|
|
|
60
63
|
- Either:
|
|
61
64
|
- Ollama installed and running locally, or
|
|
62
65
|
- A local OpenAI compatible server such as LM Studio or vLLM, or
|
|
66
|
+
- A Claude, ChatGPT or GitHub Copilot subscription with the command line tool of the vendor installed and logged in, or
|
|
63
67
|
- An API key for at least one of the following providers:
|
|
64
68
|
- OpenAI
|
|
65
69
|
- Gemini (free tier available)
|
|
@@ -77,6 +81,7 @@ Currently supported providers:
|
|
|
77
81
|
- Generates meaningful, context-aware commit messages using an LLM
|
|
78
82
|
- Seamless integration with Git
|
|
79
83
|
- Supports multiple LLM providers and models, plus any OpenAI compatible endpoint
|
|
84
|
+
- Claude, ChatGPT or GitHub Copilot subscription instead of an API key (`--subscription`)
|
|
80
85
|
- Global configuration with per-repository overrides
|
|
81
86
|
- Interactive `--init` wizard for first-time setup (provider, token, language, style)
|
|
82
87
|
- Repository-specific language, style, and model selection
|
|
@@ -160,7 +165,8 @@ git cai --init # or: git cai -I
|
|
|
160
165
|
```
|
|
161
166
|
|
|
162
167
|
It asks for a default provider, language, style, and emoji preference,
|
|
163
|
-
|
|
168
|
+
and for Claude and OpenAI whether to use a subscription. It then collects
|
|
169
|
+
the API key if one is needed (input is hidden while you type). The wizard
|
|
164
170
|
writes `~/.config/cai/cai_config.yml` and, for providers that need one,
|
|
165
171
|
`~/.config/cai/tokens.yml` with mode `0600`. Existing entries for other
|
|
166
172
|
providers in `tokens.yml` are preserved. `--init` only writes home-scope
|
|
@@ -186,7 +192,7 @@ It also creates three Markdown prompt files:
|
|
|
186
192
|
Don't be scared the first run will show an error. It only misses a token.
|
|
187
193
|
Add your provider API keys to `tokens.yml`. Once configured, cai will reuse them automatically.
|
|
188
194
|
Optional for each repository a file containing tokens can be set.
|
|
189
|
-
Set your preferred LLM in `cai_config.yml` (
|
|
195
|
+
Set your preferred LLM in `cai_config.yml` (Anthropic by default).
|
|
190
196
|
|
|
191
197
|
If you want to use Ollama, install it, set `default: ollama` and configure the `ollama:` block (model/temperature). Ollama is automatically started when used.
|
|
192
198
|
|
|
@@ -211,6 +217,36 @@ With `requires_token: false` no key is needed. `/chat/completions` is appended t
|
|
|
211
217
|
`base_url` unless it is already there. The name works with `-P` / `--provider`
|
|
212
218
|
and shows up in `git cai -l provider` and shell completion.
|
|
213
219
|
|
|
220
|
+
### Subscription instead of an API key
|
|
221
|
+
|
|
222
|
+
A Claude, OpenAI (ChatGPT) or GitHub Copilot subscription can be used instead
|
|
223
|
+
of an API token. cai then calls the official command line tool of the vendor,
|
|
224
|
+
which must be installed and logged in:
|
|
225
|
+
|
|
226
|
+
| Provider | Command | Log in with |
|
|
227
|
+
|-------------|-----------|---------------------|
|
|
228
|
+
| `anthropic` | `claude` | `claude auth login` |
|
|
229
|
+
| `openai` | `codex` | `codex login` |
|
|
230
|
+
| `copilot` | `copilot` | `copilot login` |
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
git cai -H subscription=true # enable persistently in the home config
|
|
234
|
+
git cai -U # use the subscription for this run
|
|
235
|
+
git cai -U -P openai # with another provider
|
|
236
|
+
git cai -P copilot # Copilot always uses the subscription
|
|
237
|
+
git cai -K # use the API for this run despite subscription: true
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`copilot` has no API, so it always uses the subscription and `-K` is an error
|
|
241
|
+
for it. Providers without a subscription ignore `subscription: true`, but `-U`
|
|
242
|
+
with them is an error. If the command is not installed, cai stops and explains
|
|
243
|
+
how to install it; it never switches to the API or to another provider on its
|
|
244
|
+
own. API credentials in the environment (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
|
|
245
|
+
`CODEX_API_KEY`, `COPILOT_PROVIDER_*`) are hidden from the command, so the API
|
|
246
|
+
account is not billed. `temperature`, `base_url` and `max_output_tokens` do not
|
|
247
|
+
apply, the secret scan stays active, and every request counts against the usage
|
|
248
|
+
limits of the subscription.
|
|
249
|
+
|
|
214
250
|
### Custom prompts (Markdown)
|
|
215
251
|
|
|
216
252
|
The generated commit message is guided by prompt files.
|
|
@@ -263,6 +299,7 @@ git cai -g
|
|
|
263
299
|
### Available configuration options
|
|
264
300
|
|
|
265
301
|
- `default` – default LLM provider
|
|
302
|
+
- `subscription` – use the Claude, OpenAI or Copilot subscription through the command line tool of the vendor instead of the API; default `false`. Ignored by providers without a subscription
|
|
266
303
|
- `model` – model to use for the selected provider
|
|
267
304
|
(note: not all models may be compatible)
|
|
268
305
|
- `temperature` – controls how creative the generated messages are
|
|
@@ -315,6 +352,7 @@ In addition to `git cai`, the following options are available:
|
|
|
315
352
|
- `-h`, `--help` – show help and available commands
|
|
316
353
|
- `-I`, `--init` – interactive setup wizard (writes home config and tokens.yml)
|
|
317
354
|
- `-i`, `--install-completion` – install shell completion for bash, zsh, or fish. Rerun after upgrading to get custom provider completion
|
|
355
|
+
- `-K`, `--no-subscription` – use the API for this invocation even when the config has `subscription: true` (error for `copilot`)
|
|
318
356
|
- `-k`, `--check` – run configuration diagnostics offline (config source, provider, token, prompts, editor, style)
|
|
319
357
|
- `-l`, `--list` – list available information. Valid types: `config`, `editor`, `language`, `model`, `path`, `provider`, `style`
|
|
320
358
|
- `-m`, `--model` – override the model for this invocation (requires `-P`)
|
|
@@ -337,6 +375,7 @@ In addition to `git cai`, the following options are available:
|
|
|
337
375
|
- `-e`, `--emoji` / `--no-emoji` – override emoji usage for this invocation (use `--no-emoji` to disable when config enables it)
|
|
338
376
|
- `-T`, `--timeout` `SECONDS` – HTTP timeout for this invocation (overrides config)
|
|
339
377
|
- `-t`, `--time` – measure and log commit message generation time
|
|
378
|
+
- `-U`, `--subscription` – use the Claude, OpenAI or Copilot subscription for this invocation instead of the API (no token needed)
|
|
340
379
|
- `-u`, `--update` – check for updates
|
|
341
380
|
- `-v`, `--version` – show the installed version
|
|
342
381
|
- `-x`, `--context` – provide extra context for the LLM (e.g. ticket number, reason for change)
|
|
@@ -20,8 +20,11 @@ Currently supported providers:
|
|
|
20
20
|
- Mistral
|
|
21
21
|
- DeepSeek
|
|
22
22
|
- Ollama (local)
|
|
23
|
+
- GitHub Copilot (subscription only)
|
|
23
24
|
- Any OpenAI compatible API (OpenRouter, Together, Cerebras, LM Studio, vLLM, llama.cpp, LiteLLM, ...) via `base_url`
|
|
24
25
|
|
|
26
|
+
Anthropic and OpenAI can also run on a Claude or ChatGPT subscription instead of an API key.
|
|
27
|
+
|
|
25
28
|
---
|
|
26
29
|
|
|
27
30
|
## Prerequisites
|
|
@@ -31,6 +34,7 @@ Currently supported providers:
|
|
|
31
34
|
- Either:
|
|
32
35
|
- Ollama installed and running locally, or
|
|
33
36
|
- A local OpenAI compatible server such as LM Studio or vLLM, or
|
|
37
|
+
- A Claude, ChatGPT or GitHub Copilot subscription with the command line tool of the vendor installed and logged in, or
|
|
34
38
|
- An API key for at least one of the following providers:
|
|
35
39
|
- OpenAI
|
|
36
40
|
- Gemini (free tier available)
|
|
@@ -48,6 +52,7 @@ Currently supported providers:
|
|
|
48
52
|
- Generates meaningful, context-aware commit messages using an LLM
|
|
49
53
|
- Seamless integration with Git
|
|
50
54
|
- Supports multiple LLM providers and models, plus any OpenAI compatible endpoint
|
|
55
|
+
- Claude, ChatGPT or GitHub Copilot subscription instead of an API key (`--subscription`)
|
|
51
56
|
- Global configuration with per-repository overrides
|
|
52
57
|
- Interactive `--init` wizard for first-time setup (provider, token, language, style)
|
|
53
58
|
- Repository-specific language, style, and model selection
|
|
@@ -131,7 +136,8 @@ git cai --init # or: git cai -I
|
|
|
131
136
|
```
|
|
132
137
|
|
|
133
138
|
It asks for a default provider, language, style, and emoji preference,
|
|
134
|
-
|
|
139
|
+
and for Claude and OpenAI whether to use a subscription. It then collects
|
|
140
|
+
the API key if one is needed (input is hidden while you type). The wizard
|
|
135
141
|
writes `~/.config/cai/cai_config.yml` and, for providers that need one,
|
|
136
142
|
`~/.config/cai/tokens.yml` with mode `0600`. Existing entries for other
|
|
137
143
|
providers in `tokens.yml` are preserved. `--init` only writes home-scope
|
|
@@ -157,7 +163,7 @@ It also creates three Markdown prompt files:
|
|
|
157
163
|
Don't be scared the first run will show an error. It only misses a token.
|
|
158
164
|
Add your provider API keys to `tokens.yml`. Once configured, cai will reuse them automatically.
|
|
159
165
|
Optional for each repository a file containing tokens can be set.
|
|
160
|
-
Set your preferred LLM in `cai_config.yml` (
|
|
166
|
+
Set your preferred LLM in `cai_config.yml` (Anthropic by default).
|
|
161
167
|
|
|
162
168
|
If you want to use Ollama, install it, set `default: ollama` and configure the `ollama:` block (model/temperature). Ollama is automatically started when used.
|
|
163
169
|
|
|
@@ -182,6 +188,36 @@ With `requires_token: false` no key is needed. `/chat/completions` is appended t
|
|
|
182
188
|
`base_url` unless it is already there. The name works with `-P` / `--provider`
|
|
183
189
|
and shows up in `git cai -l provider` and shell completion.
|
|
184
190
|
|
|
191
|
+
### Subscription instead of an API key
|
|
192
|
+
|
|
193
|
+
A Claude, OpenAI (ChatGPT) or GitHub Copilot subscription can be used instead
|
|
194
|
+
of an API token. cai then calls the official command line tool of the vendor,
|
|
195
|
+
which must be installed and logged in:
|
|
196
|
+
|
|
197
|
+
| Provider | Command | Log in with |
|
|
198
|
+
|-------------|-----------|---------------------|
|
|
199
|
+
| `anthropic` | `claude` | `claude auth login` |
|
|
200
|
+
| `openai` | `codex` | `codex login` |
|
|
201
|
+
| `copilot` | `copilot` | `copilot login` |
|
|
202
|
+
|
|
203
|
+
```sh
|
|
204
|
+
git cai -H subscription=true # enable persistently in the home config
|
|
205
|
+
git cai -U # use the subscription for this run
|
|
206
|
+
git cai -U -P openai # with another provider
|
|
207
|
+
git cai -P copilot # Copilot always uses the subscription
|
|
208
|
+
git cai -K # use the API for this run despite subscription: true
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
`copilot` has no API, so it always uses the subscription and `-K` is an error
|
|
212
|
+
for it. Providers without a subscription ignore `subscription: true`, but `-U`
|
|
213
|
+
with them is an error. If the command is not installed, cai stops and explains
|
|
214
|
+
how to install it; it never switches to the API or to another provider on its
|
|
215
|
+
own. API credentials in the environment (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
|
|
216
|
+
`CODEX_API_KEY`, `COPILOT_PROVIDER_*`) are hidden from the command, so the API
|
|
217
|
+
account is not billed. `temperature`, `base_url` and `max_output_tokens` do not
|
|
218
|
+
apply, the secret scan stays active, and every request counts against the usage
|
|
219
|
+
limits of the subscription.
|
|
220
|
+
|
|
185
221
|
### Custom prompts (Markdown)
|
|
186
222
|
|
|
187
223
|
The generated commit message is guided by prompt files.
|
|
@@ -234,6 +270,7 @@ git cai -g
|
|
|
234
270
|
### Available configuration options
|
|
235
271
|
|
|
236
272
|
- `default` – default LLM provider
|
|
273
|
+
- `subscription` – use the Claude, OpenAI or Copilot subscription through the command line tool of the vendor instead of the API; default `false`. Ignored by providers without a subscription
|
|
237
274
|
- `model` – model to use for the selected provider
|
|
238
275
|
(note: not all models may be compatible)
|
|
239
276
|
- `temperature` – controls how creative the generated messages are
|
|
@@ -286,6 +323,7 @@ In addition to `git cai`, the following options are available:
|
|
|
286
323
|
- `-h`, `--help` – show help and available commands
|
|
287
324
|
- `-I`, `--init` – interactive setup wizard (writes home config and tokens.yml)
|
|
288
325
|
- `-i`, `--install-completion` – install shell completion for bash, zsh, or fish. Rerun after upgrading to get custom provider completion
|
|
326
|
+
- `-K`, `--no-subscription` – use the API for this invocation even when the config has `subscription: true` (error for `copilot`)
|
|
289
327
|
- `-k`, `--check` – run configuration diagnostics offline (config source, provider, token, prompts, editor, style)
|
|
290
328
|
- `-l`, `--list` – list available information. Valid types: `config`, `editor`, `language`, `model`, `path`, `provider`, `style`
|
|
291
329
|
- `-m`, `--model` – override the model for this invocation (requires `-P`)
|
|
@@ -308,6 +346,7 @@ In addition to `git cai`, the following options are available:
|
|
|
308
346
|
- `-e`, `--emoji` / `--no-emoji` – override emoji usage for this invocation (use `--no-emoji` to disable when config enables it)
|
|
309
347
|
- `-T`, `--timeout` `SECONDS` – HTTP timeout for this invocation (overrides config)
|
|
310
348
|
- `-t`, `--time` – measure and log commit message generation time
|
|
349
|
+
- `-U`, `--subscription` – use the Claude, OpenAI or Copilot subscription for this invocation instead of the API (no token needed)
|
|
311
350
|
- `-u`, `--update` – check for updates
|
|
312
351
|
- `-v`, `--version` – show the installed version
|
|
313
352
|
- `-x`, `--context` – provide extra context for the LLM (e.g. ticket number, reason for change)
|
|
@@ -35,6 +35,7 @@ SYNOPSIS
|
|
|
35
35
|
[-S KEY=VALUE | --set KEY=VALUE]
|
|
36
36
|
[-s [N|HASH] | --squash [N|HASH]]
|
|
37
37
|
[-T SECONDS | --timeout SECONDS] [-t | --time]
|
|
38
|
+
[-U | --subscription | -K | --no-subscription]
|
|
38
39
|
[-u | --update] [-v | --version] [-w | --split]
|
|
39
40
|
[-x CONTEXT | --context CONTEXT] [-y STYLE | --style STYLE]
|
|
40
41
|
[-z | --stats] [--since YYYY-MM-DD] [--json] [--reset-stats]
|
|
@@ -59,8 +60,9 @@ SETUP
|
|
|
59
60
|
Guided setup (recommended):
|
|
60
61
|
|
|
61
62
|
- Run `git cai --init` (or `-I`). The interactive wizard asks for a
|
|
62
|
-
default provider, language, style, and emoji preference,
|
|
63
|
-
|
|
63
|
+
default provider, language, style, and emoji preference, and for Claude
|
|
64
|
+
and OpenAI whether to use a subscription. It then collects the API key
|
|
65
|
+
(hidden input) if one is needed. It writes
|
|
64
66
|
`~/.config/cai/cai_config.yml` and, for providers that need one,
|
|
65
67
|
`~/.config/cai/tokens.yml` with mode `0600`. Existing token entries
|
|
66
68
|
for other providers are preserved.
|
|
@@ -73,8 +75,8 @@ First run / configuration (manual):
|
|
|
73
75
|
- Add at least one API key to `~/.config/cai/tokens.yml` (created as a template if missing).
|
|
74
76
|
The YAML keys are provider names (for example: `openai`, `anthropic`, `gemini`,
|
|
75
77
|
`groq`, `xai`, `mistral`, `deepseek`).
|
|
76
|
-
If you use `ollama` as provider, no token is
|
|
77
|
-
their own name as key (see below).
|
|
78
|
+
If you use `ollama` as provider or a subscription (see below), no token is
|
|
79
|
+
required. Custom providers use their own name as key (see below).
|
|
78
80
|
- In `~/.config/cai/cai_config.yml`, set `default:` to the provider you want and
|
|
79
81
|
adjust the provider block (model/temperature) as needed.
|
|
80
82
|
|
|
@@ -90,6 +92,35 @@ Custom prompts (optional):
|
|
|
90
92
|
- Generate prompt files in the current directory with `git cai -p`.
|
|
91
93
|
- Point `prompt_file` / `squash_prompt_file` in `cai_config.yml` to your custom files.
|
|
92
94
|
|
|
95
|
+
Subscription instead of API (optional):
|
|
96
|
+
|
|
97
|
+
- A Claude, OpenAI (ChatGPT) or GitHub Copilot subscription can be used instead
|
|
98
|
+
of an API token. git-cai then calls the official command line tool of the
|
|
99
|
+
vendor, which must be installed and logged in:
|
|
100
|
+
|
|
101
|
+
Provider Command Log in with
|
|
102
|
+
anthropic claude claude auth login
|
|
103
|
+
openai codex codex login
|
|
104
|
+
copilot copilot copilot login
|
|
105
|
+
|
|
106
|
+
- Set `subscription: true` in `cai_config.yml`, or pass `--subscription` (`-U`)
|
|
107
|
+
for a single run. The default is `false`, which uses the API.
|
|
108
|
+
- `copilot` has no API, so it always uses the subscription. All other providers
|
|
109
|
+
ignore the setting and keep using their API.
|
|
110
|
+
- The model comes from the provider block, as with the API. With
|
|
111
|
+
`copilot.model: auto`, the default, Copilot picks the model.
|
|
112
|
+
- If the command is not installed, git-cai stops and explains how to install it.
|
|
113
|
+
It never switches to the API or to another provider on its own.
|
|
114
|
+
- API credentials in the environment (such as `ANTHROPIC_API_KEY`,
|
|
115
|
+
`OPENAI_API_KEY`, `CODEX_API_KEY`, and `COPILOT_PROVIDER_*`) are hidden from
|
|
116
|
+
the command, because it would bill the API account instead.
|
|
117
|
+
- The command runs in an empty directory. `claude` and `copilot` run without
|
|
118
|
+
tools. `codex` keeps a few built in ones, but runs in its read only sandbox and
|
|
119
|
+
without shell, web search, plugins, and connected ChatGPT apps.
|
|
120
|
+
- `temperature`, `base_url`, and `max_output_tokens` do not apply. The secret
|
|
121
|
+
scan stays active, since the diff leaves the machine.
|
|
122
|
+
- Every request counts against the usage limits of the subscription.
|
|
123
|
+
|
|
93
124
|
Custom OpenAI compatible providers (optional):
|
|
94
125
|
|
|
95
126
|
- Any service speaking the OpenAI `/chat/completions` API (OpenRouter, Together,
|
|
@@ -374,8 +405,9 @@ providers that require one) `~/.config/cai/tokens.yml` with mode
|
|
|
374
405
|
`0600`.
|
|
375
406
|
+
|
|
376
407
|
The wizard asks for a default provider, language, commit-message
|
|
377
|
-
style, whether to use emoji,
|
|
378
|
-
|
|
408
|
+
style, whether to use emoji, whether to use a subscription (`anthropic` and
|
|
409
|
+
`openai`), and the API key if the choice needs one. Input for the API key is
|
|
410
|
+
hidden while you type.
|
|
379
411
|
+
|
|
380
412
|
If `~/.config/cai/cai_config.yml` already exists, the wizard prompts
|
|
381
413
|
before overwriting it. Existing entries in `tokens.yml` for other
|
|
@@ -403,12 +435,28 @@ file for the completions to take effect.
|
|
|
403
435
|
git cai -i
|
|
404
436
|
----
|
|
405
437
|
|
|
438
|
+
-K, --no-subscription::
|
|
439
|
+
Use the API for this invocation even when the persisted config has
|
|
440
|
+
`subscription: true`. The provider then needs its API token as usual. This is
|
|
441
|
+
an error for `copilot`, which has no API. See `--subscription` (`-U`). To
|
|
442
|
+
disable the subscription permanently:
|
|
443
|
+
+
|
|
444
|
+
----
|
|
445
|
+
git cai -H subscription=false
|
|
446
|
+
----
|
|
447
|
+
+
|
|
448
|
+
----
|
|
449
|
+
git cai -K
|
|
450
|
+
git cai -K -P anthropic
|
|
451
|
+
----
|
|
452
|
+
|
|
406
453
|
-k, --check::
|
|
407
454
|
Run configuration diagnostics and exit. The check is offline by default: it
|
|
408
455
|
reports which config is authoritative (repository, home, or built-in), validates
|
|
409
456
|
the config keys, confirms the default provider has a model (and shows its
|
|
410
457
|
`base_url` if set) and a usable token (skipped for `ollama` and providers with
|
|
411
|
-
`requires_token: false
|
|
458
|
+
`requires_token: false`; with a subscription it checks that the command is
|
|
459
|
+
installed instead), that the commit/squash/full-files/PR prompts resolve, and that the
|
|
412
460
|
configured editor is on `PATH`. Exits non-zero if any check fails. Add `--ping`
|
|
413
461
|
to also probe the active provider with a tiny live request.
|
|
414
462
|
+
|
|
@@ -521,7 +569,7 @@ git cai -s --signoff
|
|
|
521
569
|
-P, --provider PROVIDER::
|
|
522
570
|
Override the LLM provider for this invocation. The model and temperature
|
|
523
571
|
from the configuration for that provider are used unless `--model` is also
|
|
524
|
-
specified. Available providers: `anthropic`, `deepseek`, `gemini`, `groq`,
|
|
572
|
+
specified. Available providers: `anthropic`, `copilot`, `deepseek`, `gemini`, `groq`,
|
|
525
573
|
`mistral`, `ollama`, `openai`, `xai`, plus any custom OpenAI compatible
|
|
526
574
|
provider defined in the active config (see SETUP). Shell completion offers
|
|
527
575
|
both.
|
|
@@ -694,9 +742,9 @@ git cai -s a1b2c3d
|
|
|
694
742
|
----
|
|
695
743
|
|
|
696
744
|
-T, --timeout SECONDS::
|
|
697
|
-
Override the
|
|
698
|
-
is 30 seconds for remote providers, 60 seconds for Gemini (Flash
|
|
699
|
-
for up to 30 seconds) and 300 seconds for Ollama (since local generation can be
|
|
745
|
+
Override the timeout for the LLM call in this invocation. The default
|
|
746
|
+
is 30 seconds for remote providers, 60 seconds for Copilot and for Gemini (Flash
|
|
747
|
+
Lite can queue for up to 30 seconds) and 300 seconds for Ollama (since local generation can be
|
|
700
748
|
significantly slower). The override applies uniformly to whichever provider is
|
|
701
749
|
selected for this run, including those with their own `<provider>.timeout`.
|
|
702
750
|
+
|
|
@@ -708,8 +756,9 @@ git cai -H timeout=60
|
|
|
708
756
|
git cai -S timeout=45
|
|
709
757
|
----
|
|
710
758
|
+
|
|
711
|
-
Ollama and
|
|
712
|
-
|
|
759
|
+
Ollama, Gemini and Copilot keep their own timeouts under `ollama.timeout`
|
|
760
|
+
(default 300), `gemini.timeout` and `copilot.timeout` (default 60). Override them
|
|
761
|
+
separately:
|
|
713
762
|
+
|
|
714
763
|
----
|
|
715
764
|
git cai -H ollama.timeout=600
|
|
@@ -733,6 +782,23 @@ Can also be enabled permanently via `measure_time: true` in
|
|
|
733
782
|
git cai -t
|
|
734
783
|
----
|
|
735
784
|
|
|
785
|
+
-U, --subscription::
|
|
786
|
+
Use the Claude (`anthropic`), OpenAI (`openai`) or GitHub Copilot (`copilot`)
|
|
787
|
+
subscription for this invocation instead of the API. The request goes through
|
|
788
|
+
the command line tool of the vendor, so no API token is needed. A provider
|
|
789
|
+
without a subscription is an error. See SETUP and `--no-subscription` (`-K`).
|
|
790
|
+
To enable it permanently:
|
|
791
|
+
+
|
|
792
|
+
----
|
|
793
|
+
git cai -H subscription=true
|
|
794
|
+
----
|
|
795
|
+
+
|
|
796
|
+
----
|
|
797
|
+
git cai -U
|
|
798
|
+
git cai -U -P openai
|
|
799
|
+
git cai -P copilot
|
|
800
|
+
----
|
|
801
|
+
|
|
736
802
|
-u, --update::
|
|
737
803
|
Check PyPI for a newer version of git-cai-cli. If an update is available,
|
|
738
804
|
the new version number and the install command are printed.
|
|
@@ -885,13 +951,14 @@ Example output:
|
|
|
885
951
|
----
|
|
886
952
|
Active configuration:
|
|
887
953
|
|
|
888
|
-
default:
|
|
954
|
+
default: anthropic
|
|
955
|
+
subscription: false
|
|
889
956
|
language: en
|
|
890
957
|
style: professional
|
|
891
958
|
emoji: true
|
|
892
|
-
|
|
893
|
-
model:
|
|
894
|
-
|
|
959
|
+
anthropic:
|
|
960
|
+
model: claude-haiku-5-5
|
|
961
|
+
max_output_tokens: 32768
|
|
895
962
|
...
|
|
896
963
|
----
|
|
897
964
|
|
|
@@ -941,6 +1008,7 @@ Example output:
|
|
|
941
1008
|
Default models:
|
|
942
1009
|
|
|
943
1010
|
anthropic → claude-haiku-5-5
|
|
1011
|
+
copilot → auto
|
|
944
1012
|
deepseek → deepseek-flash
|
|
945
1013
|
gemini → gemini-3.5-flash-lite
|
|
946
1014
|
groq → openai/gpt-oss-20b
|
|
@@ -991,8 +1059,8 @@ Configuration file paths:
|
|
|
991
1059
|
|
|
992
1060
|
provider::
|
|
993
1061
|
List all supported LLM providers. Each provider is shown with its default
|
|
994
|
-
model and whether an API token
|
|
995
|
-
token (`ollama`, and custom providers with `requires_token: false`) are
|
|
1062
|
+
model and whether it needs an API token or can use a subscription. Providers
|
|
1063
|
+
that do not require a token (`ollama`, `copilot`, and custom providers with `requires_token: false`) are
|
|
996
1064
|
marked accordingly. Custom OpenAI compatible providers from the active config
|
|
997
1065
|
follow in a separate section with their `base_url`.
|
|
998
1066
|
+
|
|
@@ -1005,13 +1073,14 @@ Example output:
|
|
|
1005
1073
|
----
|
|
1006
1074
|
Supported providers:
|
|
1007
1075
|
|
|
1008
|
-
anthropic model: claude-haiku-5-5 (token
|
|
1076
|
+
anthropic model: claude-haiku-5-5 (token or subscription)
|
|
1077
|
+
copilot model: auto (subscription, no token required)
|
|
1009
1078
|
deepseek model: deepseek-flash (token required)
|
|
1010
1079
|
gemini model: gemini-3.5-flash-lite (token required)
|
|
1011
1080
|
groq model: openai/gpt-oss-20b (token required)
|
|
1012
1081
|
mistral model: codestral-2508 (token required)
|
|
1013
1082
|
ollama model: gemma4:e2b (no token required)
|
|
1014
|
-
openai model: gpt-6-luna (token
|
|
1083
|
+
openai model: gpt-6-luna (token or subscription)
|
|
1015
1084
|
xai model: grok-4.3 (token required)
|
|
1016
1085
|
|
|
1017
1086
|
Custom providers (OpenAI compatible, from config):
|
|
@@ -1063,7 +1132,10 @@ in cai_config.yml
|
|
|
1063
1132
|
|
|
1064
1133
|
Available configuration keys:
|
|
1065
1134
|
|
|
1066
|
-
- `default` -- default LLM provider name
|
|
1135
|
+
- `default` -- default LLM provider name (default `anthropic`)
|
|
1136
|
+
- `subscription` -- use the Claude, OpenAI or Copilot subscription through the
|
|
1137
|
+
command line tool of the vendor instead of the API (`true`/`false`, default
|
|
1138
|
+
`false`). Ignored by providers without a subscription. See SETUP.
|
|
1067
1139
|
- `language` -- language for commit messages (e.g., `en`, `de`, `fr`)
|
|
1068
1140
|
- `style` -- tone of the commit message (`professional`, `neutral`, `friendly`,
|
|
1069
1141
|
`funny`, `excited`, `sarcastic`, `apologetic`, `academic`)
|
|
@@ -1095,7 +1167,7 @@ Available configuration keys:
|
|
|
1095
1167
|
- `squash_prompt_file` -- path to the squash prompt Markdown file
|
|
1096
1168
|
- `token_logging` -- log token usage after each LLM call (`true`/`false`)
|
|
1097
1169
|
- `measure_time` -- log generation time (`true`/`false`)
|
|
1098
|
-
- `timeout` --
|
|
1170
|
+
- `timeout` -- timeout in seconds for remote LLM calls (default `30`)
|
|
1099
1171
|
- `full_files` -- send full working-tree contents of staged files alongside
|
|
1100
1172
|
the diff (`true`/`false`, default `false`)
|
|
1101
1173
|
- `max_diff_bytes` -- maximum size (in UTF-8 bytes) of the diff/commit-log
|
|
@@ -1145,7 +1217,8 @@ Available configuration keys:
|
|
|
1145
1217
|
`anthropic` the default is `32768` (`max_tokens` is still read as a legacy
|
|
1146
1218
|
alias). For OpenAI compatible providers it is only sent when set.
|
|
1147
1219
|
- `<provider>.timeout` -- HTTP timeout in seconds for one provider,
|
|
1148
|
-
overriding the global `timeout` (`ollama` defaults to `300`, `gemini`
|
|
1220
|
+
overriding the global `timeout` (`ollama` defaults to `300`, `gemini` and
|
|
1221
|
+
`copilot` to `60`).
|
|
1149
1222
|
The `--timeout` flag overrides both.
|
|
1150
1223
|
- `stats` -- opt in to local-only usage analytics (`true`/`false`,
|
|
1151
1224
|
default `false`). When enabled, every generation appends one row to
|
|
@@ -1304,6 +1377,14 @@ Override the provider for a single invocation:
|
|
|
1304
1377
|
git cai -P anthropic
|
|
1305
1378
|
----
|
|
1306
1379
|
|
|
1380
|
+
Use a subscription instead of the API:
|
|
1381
|
+
|
|
1382
|
+
----
|
|
1383
|
+
git cai -U
|
|
1384
|
+
git cai -U -P openai
|
|
1385
|
+
git cai -P copilot
|
|
1386
|
+
----
|
|
1387
|
+
|
|
1307
1388
|
Use a custom OpenAI compatible provider defined in the config:
|
|
1308
1389
|
|
|
1309
1390
|
----
|