git-cai-cli 0.17.3__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.
Files changed (115) hide show
  1. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/PKG-INFO +42 -3
  2. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/README.md +41 -2
  3. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/cai_config.yml +1 -0
  4. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/docs/git-cai.txt +110 -27
  5. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/docs/man/git-cai.1 +240 -29
  6. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/_version.py +3 -3
  7. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/cli.py +7 -0
  8. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/helptext.py +2 -0
  9. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/changelog.py +7 -1
  10. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/completion.py +5 -0
  11. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/config.py +72 -8
  12. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/doctor.py +15 -2
  13. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/explain.py +7 -1
  14. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/generation.py +6 -1
  15. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/gitutils.py +39 -10
  16. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/init.py +21 -8
  17. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/llm.py +111 -11
  18. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/options.py +3 -7
  19. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/pr.py +7 -1
  20. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/release.py +7 -1
  21. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/split.py +7 -1
  22. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/squash.py +8 -2
  23. git_cai_cli-0.18.0/src/git_cai_cli/core/subscription.py +270 -0
  24. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/validate.py +6 -0
  25. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/main.py +12 -1
  26. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/PKG-INFO +42 -3
  27. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/SOURCES.txt +2 -0
  28. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/scm_file_list.json +2 -0
  29. git_cai_cli-0.18.0/src/git_cai_cli.egg-info/scm_version.json +8 -0
  30. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_gitutils.py +50 -0
  31. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_init.py +2 -2
  32. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_llm.py +192 -0
  33. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_main.py +1 -0
  34. git_cai_cli-0.18.0/tests/unit/test_subscription.py +657 -0
  35. git_cai_cli-0.17.3/src/git_cai_cli.egg-info/scm_version.json +0 -8
  36. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.caiignore +0 -0
  37. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.gitattributes +0 -0
  38. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/cd/.SRCINFO +0 -0
  39. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/cd/PKGBUILD +0 -0
  40. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/ci/_version.py +0 -0
  41. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/ci/cai_config.ci.yml +0 -0
  42. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/ci/tokens.ci.yml +0 -0
  43. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/workflows/python-tests.yml +0 -0
  44. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/workflows/release.yml +0 -0
  45. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.github/workflows/release_aur.yml +0 -0
  46. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.gitignore +0 -0
  47. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.bandit.yml +0 -0
  48. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.checkov.yml +0 -0
  49. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.flake8 +0 -0
  50. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.ls-lint.yml +0 -0
  51. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.markdownlint.json +0 -0
  52. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.proselintrc.json +0 -0
  53. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.pylintrc +0 -0
  54. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/.yamllint.yml +0 -0
  55. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/check_git_branch_name.sh +0 -0
  56. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/lychee.toml +0 -0
  57. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.linters/pyrightconfig.json +0 -0
  58. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.markdownlintignore +0 -0
  59. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.mega-linter.yml +0 -0
  60. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.semgrepignore +0 -0
  61. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/.trivyignore +0 -0
  62. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/CLAUDE.md +0 -0
  63. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/LICENSE +0 -0
  64. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/Makefile +0 -0
  65. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/pyproject.toml +0 -0
  66. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/setup.cfg +0 -0
  67. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/__init__.py +0 -0
  68. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/__init__.py +0 -0
  69. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/cli/modes.py +0 -0
  70. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/__init__.py +0 -0
  71. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/languages.py +0 -0
  72. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/prompts_fallback.py +0 -0
  73. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/secrets.py +0 -0
  74. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/spinner.py +0 -0
  75. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli/core/stats.py +0 -0
  76. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/dependency_links.txt +0 -0
  77. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/entry_points.txt +0 -0
  78. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/requires.txt +0 -0
  79. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/src/git_cai_cli.egg-info/top_level.txt +0 -0
  80. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/conftest.py +0 -0
  81. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_cli_integration.py +0 -0
  82. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_config_integration.py +0 -0
  83. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_gitutils_integration.py +0 -0
  84. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_modes_integration.py +0 -0
  85. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_options_integration.py +0 -0
  86. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_pr_integration.py +0 -0
  87. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/integration/test_squash_integration.py +0 -0
  88. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_amend.py +0 -0
  89. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_branch_context.py +0 -0
  90. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_changelog.py +0 -0
  91. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_classification.py +0 -0
  92. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_cli.py +0 -0
  93. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_completion.py +0 -0
  94. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_config.py +0 -0
  95. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_conventional.py +0 -0
  96. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_custom_provider.py +0 -0
  97. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_doctor.py +0 -0
  98. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_explain.py +0 -0
  99. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_generation.py +0 -0
  100. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_helptext.py +0 -0
  101. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_modes.py +0 -0
  102. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_options.py +0 -0
  103. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_pr.py +0 -0
  104. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_print.py +0 -0
  105. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_prompt_loading.py +0 -0
  106. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_release.py +0 -0
  107. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_secrets.py +0 -0
  108. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_set_config.py +0 -0
  109. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_signoff.py +0 -0
  110. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_spinner.py +0 -0
  111. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_split.py +0 -0
  112. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_squash.py +0 -0
  113. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_stats.py +0 -0
  114. {git_cai_cli-0.17.3 → git_cai_cli-0.18.0}/tests/unit/test_validate.py +0 -0
  115. {git_cai_cli-0.17.3 → 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.17.3
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
- then collects the API key (input is hidden while you type). The wizard
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` (Groq by default).
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
- then collects the API key (input is hidden while you type). The wizard
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` (Groq by default).
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)
@@ -17,6 +17,7 @@ pr_file_name: PR_DESCRIPTION.md
17
17
  pr_prompt_file: "/home/thorsten/.config/cai/pr_prompt.md"
18
18
  stats: true
19
19
  signoff: true
20
+ subscription: true
20
21
  anthropic:
21
22
  model: claude-haiku-5-5
22
23
  max_tokens: 32768
@@ -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, then
63
- collects the API key (hidden input). It writes
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 required. Custom providers use
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, and — for providers other than `ollama`
378
- — the API key. Input for the API key is hidden while you type.
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`), that the commit/squash/full-files/PR prompts resolve, and that the
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 HTTP timeout for the LLM call in this invocation. The default
698
- is 30 seconds for remote providers, 60 seconds for Gemini (Flash Lite can queue
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 Gemini keep their own timeouts under `ollama.timeout` (default 300)
712
- and `gemini.timeout` (default 60). Override them separately:
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: groq
954
+ default: anthropic
955
+ subscription: false
889
956
  language: en
890
957
  style: professional
891
958
  emoji: true
892
- groq:
893
- model: openai/gpt-oss-20b
894
- temperature: 0
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 is required. Providers that do not require a
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 required)
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 required)
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,13 +1167,15 @@ 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` -- HTTP timeout in seconds for remote LLM calls (default `30`)
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
1102
- sent to the LLM. When the input exceeds this, it is truncated and a marker
1103
- line is appended so the model knows it was cut. `0` (the default) means no
1104
- limit. Useful to avoid context-window errors on very large staged changes.
1174
+ sent to the LLM. When the input exceeds this, the largest files are shortened
1175
+ first so every file stays represented, and marker lines tell the model what
1176
+ was cut. `0` (the default) means no limit. You rarely need this for very
1177
+ large staged changes: when a provider rejects the input as too large, git-cai
1178
+ shortens it the same way, warns, and retries up to two times.
1105
1179
  - `pr_to_file` -- when running `--PR`, write the generated PR description
1106
1180
  to a Markdown file in the repository root instead of printing it to
1107
1181
  stdout (`true`/`false`, default `false`)
@@ -1143,7 +1217,8 @@ Available configuration keys:
1143
1217
  `anthropic` the default is `32768` (`max_tokens` is still read as a legacy
1144
1218
  alias). For OpenAI compatible providers it is only sent when set.
1145
1219
  - `<provider>.timeout` -- HTTP timeout in seconds for one provider,
1146
- overriding the global `timeout` (`ollama` defaults to `300`, `gemini` to `60`).
1220
+ overriding the global `timeout` (`ollama` defaults to `300`, `gemini` and
1221
+ `copilot` to `60`).
1147
1222
  The `--timeout` flag overrides both.
1148
1223
  - `stats` -- opt in to local-only usage analytics (`true`/`false`,
1149
1224
  default `false`). When enabled, every generation appends one row to
@@ -1302,6 +1377,14 @@ Override the provider for a single invocation:
1302
1377
  git cai -P anthropic
1303
1378
  ----
1304
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
+
1305
1388
  Use a custom OpenAI compatible provider defined in the config:
1306
1389
 
1307
1390
  ----