git-cai-cli 0.7.4__tar.gz → 0.8.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 (82) hide show
  1. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.pylintrc +3 -2
  2. git_cai_cli-0.8.0/.markdownlintignore +2 -0
  3. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/PKG-INFO +40 -7
  4. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/README.md +39 -6
  5. git_cai_cli-0.8.0/docs/git-cai.txt +198 -0
  6. git_cai_cli-0.8.0/docs/man/git-cai.1 +421 -0
  7. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/pyproject.toml +3 -0
  8. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/_version.py +3 -3
  9. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/cli/cli.py +22 -0
  10. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/cli/helptext.py +1 -0
  11. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/config.py +115 -5
  12. git_cai_cli-0.8.0/src/git_cai_cli/core/llm.py +764 -0
  13. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/options.py +41 -0
  14. git_cai_cli-0.8.0/src/git_cai_cli/core/squash.py +230 -0
  15. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/validate.py +71 -13
  16. git_cai_cli-0.8.0/src/git_cai_cli/defaults/__init__.py +0 -0
  17. git_cai_cli-0.8.0/src/git_cai_cli/defaults/commit_prompt.md +6 -0
  18. git_cai_cli-0.8.0/src/git_cai_cli/defaults/squash_prompt.md +9 -0
  19. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/main.py +13 -9
  20. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli.egg-info/PKG-INFO +40 -7
  21. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli.egg-info/SOURCES.txt +6 -0
  22. git_cai_cli-0.8.0/tests/conftest.py +9 -0
  23. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_cli.py +20 -0
  24. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_config.py +51 -0
  25. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_llm.py +129 -36
  26. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_options.py +10 -0
  27. git_cai_cli-0.8.0/tests/unit/test_prompt_loading.py +646 -0
  28. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_validate.py +25 -1
  29. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/uv.lock +235 -220
  30. git_cai_cli-0.7.4/docs/git-cai.txt +0 -90
  31. git_cai_cli-0.7.4/docs/man/git-cai.1 +0 -143
  32. git_cai_cli-0.7.4/src/git_cai_cli/core/llm.py +0 -383
  33. git_cai_cli-0.7.4/src/git_cai_cli/core/squash.py +0 -207
  34. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.caiignore +0 -0
  35. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.gitattributes +0 -0
  36. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/cd/.SRCINFO +0 -0
  37. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/cd/PKGBUILD +0 -0
  38. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/ci/_version.py +0 -0
  39. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/ci/cai_config.ci.yml +0 -0
  40. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/ci/tokens.ci.yml +0 -0
  41. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/workflows/python-tests.yml +0 -0
  42. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/workflows/release.yml +0 -0
  43. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.github/workflows/release_aur.yml +0 -0
  44. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.gitignore +0 -0
  45. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.bandit.yml +0 -0
  46. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.checkov.yml +0 -0
  47. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.flake8 +0 -0
  48. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.ls-lint.yml +0 -0
  49. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.markdown-link-check.json +0 -0
  50. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.markdownlint.json +0 -0
  51. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.proselintrc +0 -0
  52. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/.yamllint.yml +0 -0
  53. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/check_git_branch_name.sh +0 -0
  54. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/lychee.toml +0 -0
  55. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.linters/pyrightconfig.json +0 -0
  56. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.mega-linter.yml +0 -0
  57. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.semgrepignore +0 -0
  58. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/.trivyignore +0 -0
  59. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/LICENSE +0 -0
  60. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/Makefile +0 -0
  61. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/setup.cfg +0 -0
  62. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/__init__.py +0 -0
  63. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/cli/__init__.py +0 -0
  64. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/cli/modes.py +0 -0
  65. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/__init__.py +0 -0
  66. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/editors.py +0 -0
  67. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/gitutils.py +0 -0
  68. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli/core/languages.py +0 -0
  69. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli.egg-info/dependency_links.txt +0 -0
  70. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli.egg-info/entry_points.txt +0 -0
  71. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli.egg-info/requires.txt +0 -0
  72. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/src/git_cai_cli.egg-info/top_level.txt +0 -0
  73. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/integration/test_cli_integration.py +0 -0
  74. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/integration/test_config_integration.py +0 -0
  75. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/integration/test_gitutils_integration.py +0 -0
  76. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/integration/test_modes_integration.py +0 -0
  77. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/integration/test_options_integration.py +0 -0
  78. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/integration/test_squash_integration.py +0 -0
  79. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_gitutils.py +0 -0
  80. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_helptext.py +0 -0
  81. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_modes.py +0 -0
  82. {git_cai_cli-0.7.4 → git_cai_cli-0.8.0}/tests/unit/test_squash.py +0 -0
@@ -66,7 +66,7 @@ check-protected-access-in-special-methods=no
66
66
  # Don’t warn about protected attr access in dunder methods
67
67
 
68
68
  [DESIGN]
69
- max-args=10 # Max arguments per function
69
+ max-args=15 # Max arguments per function
70
70
  max-attributes=7 # Max attributes per class
71
71
  max-branches=20 # Max branches per function
72
72
  max-locals=30 # Max locals per function
@@ -77,7 +77,7 @@ min-public-methods=1 # Min public methods per class
77
77
  max-nested-blocks=15 # Max nesting depth
78
78
  max-bool-expr=15 # Max boolean subexpressions in a condition
79
79
  max-parents=7 # Max base classes per class
80
- max-positional-arguments=10 # Max positional arguments per function
80
+ max-positional-arguments=15 # Max positional arguments per function
81
81
 
82
82
  [EXCEPTIONS]
83
83
  overgeneral-exceptions=builtins.BaseException,builtins.Exception
@@ -94,6 +94,7 @@ disable=logging-too-many-args,
94
94
  import-error,
95
95
  wrong-import-order,
96
96
  import-outside-toplevel,
97
+ duplicate-code,
97
98
  # Disable noisy/meta warnings
98
99
 
99
100
 
@@ -0,0 +1,2 @@
1
+ commit_prompt.md
2
+ squash_prompt.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-cai-cli
3
- Version: 0.7.4
3
+ Version: 0.8.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
@@ -48,6 +48,7 @@ Currently supported providers:
48
48
  - xAI
49
49
  - Mistral
50
50
  - DeepSeek
51
+ - Ollama (local)
51
52
 
52
53
  ---
53
54
 
@@ -55,7 +56,9 @@ Currently supported providers:
55
56
 
56
57
  - Python 3.10 or higher
57
58
  - [pipx](https://pypi.org/project/pipx/)
58
- - An API key for at least one of the following providers:
59
+ - Either:
60
+ - Ollama installed and running locally, or
61
+ - An API key for at least one of the following providers:
59
62
  - OpenAI
60
63
  - Gemini (free tier available)
61
64
  - Anthropic
@@ -72,7 +75,7 @@ Currently supported providers:
72
75
  - Generates meaningful, context-aware commit messages using an LLM
73
76
  - Seamless integration with Git
74
77
  - Supports multiple LLM providers and models
75
- - Global configuration with **per-repository overrides**
78
+ - Global configuration with per-repository overrides
76
79
  - Repository-specific language, style, and model selection
77
80
  - Optional commit squashing with automatic summary generation
78
81
 
@@ -129,7 +132,7 @@ The syntax is identical to `.gitignore`.
129
132
 
130
133
  ## Configuration
131
134
 
132
- On first execution, cai automatically creates two configuration files:
135
+ On first execution, cai automatically creates the base configuration in your home directory.
133
136
 
134
137
  - Global configuration:
135
138
  ~/.config/cai/cai_config.yml
@@ -137,13 +140,40 @@ On first execution, cai automatically creates two configuration files:
137
140
  - API tokens:
138
141
  ~/.config/cai/tokens.yml
139
142
 
143
+ It also creates two Markdown prompt files:
144
+
145
+ - Default commit prompt:
146
+ ~/.config/cai/commit_prompt.md
147
+ - Default squash prompt:
148
+ ~/.config/cai/squash_prompt.md
149
+
140
150
  Don't be scared the first run will show an error. It only misses a token.
141
151
  Add your provider API keys to `tokens.yml`. Once configured, cai will reuse them automatically.
142
152
  Set your preferred LLM in `cai_config.yml` (Groq by default).
143
153
 
154
+ If you want to use Ollama, set `default: ollama` and configure the `ollama:` block (model/temperature). Ollama is automatically started when used.
155
+
156
+ ### Custom prompts (Markdown)
157
+
158
+ The generated commit message is guided by prompt files.
159
+
160
+ - By default, `cai_config.yml` points to the auto-created prompt files in `~/.config/cai/`.
161
+ - To use your own prompts in a repository, generate templates at the root of the repository:
162
+
163
+ ```sh
164
+ git cai -p
165
+ ```
166
+
167
+ This creates:
168
+
169
+ - `commit_prompt.md`
170
+ - `squash_prompt.md`
171
+
172
+ Then set `prompt_file` and/or `squash_prompt_file` in your `cai_config.yml` (also repo) to point to those files.
173
+
144
174
  ### Repository-specific configuration
145
175
 
146
- Each repository can be configured **independently**.
176
+ Each repository can be configured independently.
147
177
 
148
178
  If a `cai_config.yml` file exists in the root of a repository, cai will use it instead of the global configuration.
149
179
  This allows different projects to use different providers, models, languages, and styles.
@@ -178,6 +208,8 @@ git cai -g
178
208
  - `style` – tone or style of the commit message
179
209
  - `emoji` – enable or disable emojis
180
210
  - `load_tokens_from` – path to the file where API tokens are stored
211
+ - `prompt_file` - path to the file where the prompt for the commit is stored
212
+ - `squash_prompt_file` - path to the file where the prompt for the squash is stored
181
213
 
182
214
  ---
183
215
 
@@ -189,8 +221,9 @@ In addition to `git cai`, the following options are available:
189
221
  - `-a`, `--all` – stage all tracked modified and deleted files
190
222
  - `-c`, `--crazy` – Trust the LLM and commit without checking
191
223
  - `-d`, `--debug` – enable debug logging
192
- - `-g`, `--generate-config` – generate the default `git_config.yml` in the current directory
193
- - `-l`, `--list` – list available languages and styles
224
+ - `-g`, `--generate-config` – generate the default `cai_config.yml` in the current directory
225
+ - `-l`, `--list` – list available languages, styles, and supported editors
226
+ - `-p`, `--generate-prompts` – generate default `commit_prompt.md` and `squash_prompt.md` in the current directory (for customization)
194
227
  - `-s`, `--squash` – squash commits on the current branch and summarize them
195
228
  - `-u`, `--update` – check for updates
196
229
  - `-v`, `--version` – show the installed version
@@ -19,6 +19,7 @@ Currently supported providers:
19
19
  - xAI
20
20
  - Mistral
21
21
  - DeepSeek
22
+ - Ollama (local)
22
23
 
23
24
  ---
24
25
 
@@ -26,7 +27,9 @@ Currently supported providers:
26
27
 
27
28
  - Python 3.10 or higher
28
29
  - [pipx](https://pypi.org/project/pipx/)
29
- - An API key for at least one of the following providers:
30
+ - Either:
31
+ - Ollama installed and running locally, or
32
+ - An API key for at least one of the following providers:
30
33
  - OpenAI
31
34
  - Gemini (free tier available)
32
35
  - Anthropic
@@ -43,7 +46,7 @@ Currently supported providers:
43
46
  - Generates meaningful, context-aware commit messages using an LLM
44
47
  - Seamless integration with Git
45
48
  - Supports multiple LLM providers and models
46
- - Global configuration with **per-repository overrides**
49
+ - Global configuration with per-repository overrides
47
50
  - Repository-specific language, style, and model selection
48
51
  - Optional commit squashing with automatic summary generation
49
52
 
@@ -100,7 +103,7 @@ The syntax is identical to `.gitignore`.
100
103
 
101
104
  ## Configuration
102
105
 
103
- On first execution, cai automatically creates two configuration files:
106
+ On first execution, cai automatically creates the base configuration in your home directory.
104
107
 
105
108
  - Global configuration:
106
109
  ~/.config/cai/cai_config.yml
@@ -108,13 +111,40 @@ On first execution, cai automatically creates two configuration files:
108
111
  - API tokens:
109
112
  ~/.config/cai/tokens.yml
110
113
 
114
+ It also creates two Markdown prompt files:
115
+
116
+ - Default commit prompt:
117
+ ~/.config/cai/commit_prompt.md
118
+ - Default squash prompt:
119
+ ~/.config/cai/squash_prompt.md
120
+
111
121
  Don't be scared the first run will show an error. It only misses a token.
112
122
  Add your provider API keys to `tokens.yml`. Once configured, cai will reuse them automatically.
113
123
  Set your preferred LLM in `cai_config.yml` (Groq by default).
114
124
 
125
+ If you want to use Ollama, set `default: ollama` and configure the `ollama:` block (model/temperature). Ollama is automatically started when used.
126
+
127
+ ### Custom prompts (Markdown)
128
+
129
+ The generated commit message is guided by prompt files.
130
+
131
+ - By default, `cai_config.yml` points to the auto-created prompt files in `~/.config/cai/`.
132
+ - To use your own prompts in a repository, generate templates at the root of the repository:
133
+
134
+ ```sh
135
+ git cai -p
136
+ ```
137
+
138
+ This creates:
139
+
140
+ - `commit_prompt.md`
141
+ - `squash_prompt.md`
142
+
143
+ Then set `prompt_file` and/or `squash_prompt_file` in your `cai_config.yml` (also repo) to point to those files.
144
+
115
145
  ### Repository-specific configuration
116
146
 
117
- Each repository can be configured **independently**.
147
+ Each repository can be configured independently.
118
148
 
119
149
  If a `cai_config.yml` file exists in the root of a repository, cai will use it instead of the global configuration.
120
150
  This allows different projects to use different providers, models, languages, and styles.
@@ -149,6 +179,8 @@ git cai -g
149
179
  - `style` – tone or style of the commit message
150
180
  - `emoji` – enable or disable emojis
151
181
  - `load_tokens_from` – path to the file where API tokens are stored
182
+ - `prompt_file` - path to the file where the prompt for the commit is stored
183
+ - `squash_prompt_file` - path to the file where the prompt for the squash is stored
152
184
 
153
185
  ---
154
186
 
@@ -160,8 +192,9 @@ In addition to `git cai`, the following options are available:
160
192
  - `-a`, `--all` – stage all tracked modified and deleted files
161
193
  - `-c`, `--crazy` – Trust the LLM and commit without checking
162
194
  - `-d`, `--debug` – enable debug logging
163
- - `-g`, `--generate-config` – generate the default `git_config.yml` in the current directory
164
- - `-l`, `--list` – list available languages and styles
195
+ - `-g`, `--generate-config` – generate the default `cai_config.yml` in the current directory
196
+ - `-l`, `--list` – list available languages, styles, and supported editors
197
+ - `-p`, `--generate-prompts` – generate default `commit_prompt.md` and `squash_prompt.md` in the current directory (for customization)
165
198
  - `-s`, `--squash` – squash commits on the current branch and summarize them
166
199
  - `-u`, `--update` – check for updates
167
200
  - `-v`, `--version` – show the installed version
@@ -0,0 +1,198 @@
1
+ git-cai(1)
2
+ ==========
3
+ Thorsten Foltz
4
+ February 2026
5
+
6
+ NAME
7
+ ----
8
+ git-cai - AI-powered commit message generator
9
+
10
+ SYNOPSIS
11
+ --------
12
+ [verse]
13
+ `git cai` [-a | --all] [-c | --crazy] [-d | --debug] [-g | --generate-config]
14
+ [-l [editor|language|style] | --list [editor|language|style]]
15
+ [-p | --generate-prompts] [-s | --squash] [-u | --update] [-v | --version]
16
+
17
+
18
+ DESCRIPTION
19
+ -----------
20
+ git-cai is a Git extension that generates commit
21
+ messages from staged changes using AI.
22
+
23
+ The command is invoked as `git cai` and integrates into Git using the
24
+ standard Git extension mechanism.
25
+
26
+ git-cai behaves like `git commit`, but with the commit message pre-filled:
27
+
28
+ - It reads the staged diff (`git diff --cached`).
29
+ - It sends the diff to the configured LLM provider/model.
30
+ - It opens your configured Git editor so you can review/edit before committing.
31
+
32
+ SETUP
33
+ -----
34
+ First run / configuration:
35
+
36
+ - Run `git cai` once. If no config exists yet, git-cai creates:
37
+ `~/.config/cai/cai_config.yml` (global config) and ensures default prompt files exist:
38
+ `~/.config/cai/commit_prompt.md` and `~/.config/cai/squash_prompt.md`.
39
+ - Add at least one API key to `~/.config/cai/tokens.yml` (created as a template if missing).
40
+ The YAML keys are provider names (for example: `openai`, `anthropic`, `gemini`,
41
+ `groq`, `xai`, `mistral`, `deepseek`).
42
+ If you use `ollama` as provider, no token is required.
43
+ - In `~/.config/cai/cai_config.yml`, set `default:` to the provider you want and
44
+ adjust the provider block (model/temperature) as needed.
45
+
46
+ Repository-specific setup (optional):
47
+
48
+ - Put a `cai_config.yml` (or `cai_config.yaml`) into the repository root.
49
+ This repository config is authoritative and is not merged with the home config.
50
+ - Generate a starting point with `git cai -g` (creates `cai_config.yml` in the
51
+ current directory).
52
+
53
+ Custom prompts (optional):
54
+
55
+ - Generate prompt files in the current directory with `git cai -p`.
56
+ - Point `prompt_file` / `squash_prompt_file` in `cai_config.yml` to your custom files.
57
+
58
+ OPTIONS
59
+ -------
60
+ -h, --help::
61
+ Show this help message.
62
+
63
+ -a, --all::
64
+ Stage all modified and deleted files that are already tracked by Git
65
+ before generating the commit message.
66
+
67
+ -c, --crazy::
68
+ Automatically commit changes using an LLM-generated message without user confirmation.
69
+
70
+ -d, --debug::
71
+ Enable debug logging.
72
+
73
+ -g, --generate-config::
74
+ Generate default cai_config.yml in the current directory.
75
+
76
+ -l, --list::
77
+ List information. Provide one of `editor`, `language`, or `style` as the next argument.
78
+
79
+ -p, --generate-prompts::
80
+ Generate default commit_prompt.md and squash_prompt.md in the current directory.
81
+ Use these as a starting point for custom prompts.
82
+
83
+ -s, --squash::
84
+ Squash commits on the current branch and summarize them.
85
+
86
+ -u, --update::
87
+ Check for updates.
88
+
89
+ -v, --version::
90
+ Show the installed version.
91
+
92
+ LIST TYPES
93
+ ----------
94
+ The argument to `--list` must be one of the following:
95
+
96
+ editor::
97
+ List supported and tested editors as default git editor. Most likely more editors will work.
98
+
99
+ language::
100
+ List supported languages.
101
+
102
+ style::
103
+ Show available commit message styles.
104
+
105
+ CONFIGURATION
106
+ -------------
107
+ Configuration precedence:
108
+
109
+ 1. Repository config: `<repo-root>/cai_config.yml` or `<repo-root>/cai_config.yaml`
110
+ 2. Home config: `~/.config/cai/cai_config.yml`
111
+ 3. Built-in defaults (written to the home config file on first run)
112
+
113
+ Authentication tokens are loaded from:
114
+
115
+ ----
116
+ $HOME/.config/cai/tokens.yml
117
+ ----
118
+
119
+ Config is loaded by default from:
120
+
121
+ ----
122
+ $HOME/.config/cai/cai_config.yml
123
+ ----
124
+
125
+ cai_config.yml (or cai_config.yaml) can be loaded from the root of a repository.
126
+ If present, it replaces the home config for that repository.
127
+
128
+ Tokens can be loaded from everywhere defined within "load_tokens_from"
129
+ in cai_config.yml
130
+
131
+ FILES
132
+ -----
133
+ `~/.config/cai/cai_config.yml`::
134
+ Global configuration (created automatically if missing).
135
+
136
+ `~/.config/cai/tokens.yml`::
137
+ Provider API keys (created as a template if missing).
138
+
139
+ `~/.config/cai/commit_prompt.md` and `~/.config/cai/squash_prompt.md`::
140
+ Default prompt files (created automatically if missing/empty). You can point
141
+ `prompt_file` and `squash_prompt_file` to other locations.
142
+
143
+ `<repo-root>/.caiignore`::
144
+ Optional ignore file. Patterns are appended as exclusions when git-cai runs
145
+ `git diff --cached`.
146
+
147
+ EDITOR
148
+ ------
149
+ git-cai uses the same editor resolution as Git (via `git var GIT_EDITOR` and the
150
+ usual `GIT_EDITOR`/`VISUAL`/`EDITOR` environment variables).
151
+
152
+ In the default commit-message flow, git-cai opens an editor with the generated
153
+ message in a temporary file:
154
+
155
+ - Save and exit to continue with the commit.
156
+ - Close without saving to abort.
157
+
158
+ If you use a GUI editor, the template starts with a line `# DELETE THIS LINE...`.
159
+ Delete it to accept the commit.
160
+
161
+ EXAMPLES
162
+ --------
163
+ Generate a commit message from staged changes:
164
+
165
+ ----
166
+ git add -A
167
+ git cai
168
+ ----
169
+
170
+ Stage tracked changes (like `git commit -a`) and generate a message:
171
+
172
+ ----
173
+ git cai -a
174
+ ----
175
+
176
+ Commit immediately without opening the editor:
177
+
178
+ ----
179
+ git cai -c
180
+ ----
181
+
182
+ Squash all commits on the current branch into one (rewrites history):
183
+
184
+ ----
185
+ git cai -s
186
+ ----
187
+
188
+ Show supported styles/languages/editors:
189
+
190
+ ----
191
+ git cai -l style
192
+ git cai -l language
193
+ git cai -l editor
194
+ ----
195
+
196
+ SEE ALSO
197
+ --------
198
+ git(1)