git-copilot-commit 0.6.0__tar.gz → 0.7.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_copilot_commit-0.7.0/.config/mise.toml +99 -0
- git_copilot_commit-0.7.0/.python-version +1 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/PKG-INFO +104 -35
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/README.md +102 -33
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/pyproject.toml +1 -1
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/cli.py +194 -130
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/git.py +123 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/llms/copilot.py +15 -1
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/llms/core.py +194 -16
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/llms/openai_api.py +67 -7
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/llms/providers.py +10 -9
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/tests/test_cli.py +437 -67
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/tests/test_git.py +43 -9
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/tests/test_llm_and_copilot.py +191 -2
- git_copilot_commit-0.7.0/tests/test_providers.py +303 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/uv.lock +54 -44
- git_copilot_commit-0.6.0/.justfile +0 -61
- git_copilot_commit-0.6.0/.python-version +0 -1
- git_copilot_commit-0.6.0/tests/test_providers.py +0 -178
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/.github/dependabot.yml +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/.github/workflows/ci.yml +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/.gitignore +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/LICENSE +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/__init__.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/llms/__init__.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/prompts/commit-message-generator-prompt.md +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/prompts/split-commit-planner-prompt.md +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/py.typed +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/settings.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/split_commits.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/src/git_copilot_commit/version.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/tests/conftest.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/tests/test_settings.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/tests/test_split_commits.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.7.0}/vhs/demo.vhs +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
[settings]
|
|
2
|
+
env_shell_expand = true
|
|
3
|
+
pipx.uvx = true
|
|
4
|
+
|
|
5
|
+
[tools]
|
|
6
|
+
uv = "latest"
|
|
7
|
+
python = "latest"
|
|
8
|
+
|
|
9
|
+
[tasks."git-copilot-commit:commit"]
|
|
10
|
+
description = "Pass all arguments directly to git-copilot-commit commit"
|
|
11
|
+
usage = """
|
|
12
|
+
arg "[args]" var=#true help="Arguments to pass to git-copilot-commit commit"
|
|
13
|
+
"""
|
|
14
|
+
run = """
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
|
|
17
|
+
args=()
|
|
18
|
+
if [ -n "${usage_args:-}" ]; then
|
|
19
|
+
eval "args=($usage_args)"
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
uv run git-copilot-commit commit "${args[@]}"
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
[tasks."git-copilot-commit:next-version"]
|
|
26
|
+
description = "Get the next version based on bump type"
|
|
27
|
+
usage = """
|
|
28
|
+
arg "[type]" help="Version bump type" default="patch" {
|
|
29
|
+
choices "major" "minor" "patch"
|
|
30
|
+
}
|
|
31
|
+
"""
|
|
32
|
+
run = """
|
|
33
|
+
set -euo pipefail
|
|
34
|
+
|
|
35
|
+
latest_tag=$(gh release list --limit 1 --json tagName --jq '.[0].tagName // "v0.0.0"')
|
|
36
|
+
version=${latest_tag#v}
|
|
37
|
+
IFS='.' read -r major minor patch <<< "$version"
|
|
38
|
+
|
|
39
|
+
case "${usage_type?}" in
|
|
40
|
+
major)
|
|
41
|
+
major=$((major + 1))
|
|
42
|
+
minor=0
|
|
43
|
+
patch=0
|
|
44
|
+
;;
|
|
45
|
+
minor)
|
|
46
|
+
minor=$((minor + 1))
|
|
47
|
+
patch=0
|
|
48
|
+
;;
|
|
49
|
+
patch)
|
|
50
|
+
patch=$((patch + 1))
|
|
51
|
+
;;
|
|
52
|
+
esac
|
|
53
|
+
|
|
54
|
+
printf 'v%s.%s.%s\n' "$major" "$minor" "$patch"
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
[tasks."git-copilot-commit:bump"]
|
|
58
|
+
description = "Create an empty version bump commit and tag"
|
|
59
|
+
usage = """
|
|
60
|
+
arg "[type]" help="Version bump type" default="patch" {
|
|
61
|
+
choices "major" "minor" "patch"
|
|
62
|
+
}
|
|
63
|
+
"""
|
|
64
|
+
run = """
|
|
65
|
+
set -euo pipefail
|
|
66
|
+
|
|
67
|
+
new_version=$(mise run git-copilot-commit:next-version "${usage_type?}")
|
|
68
|
+
echo "New version: $new_version"
|
|
69
|
+
|
|
70
|
+
git commit --allow-empty -m "chore(build): Bump version to $new_version"
|
|
71
|
+
git tag "$new_version"
|
|
72
|
+
|
|
73
|
+
echo "✓ Created commit and tag for $new_version"
|
|
74
|
+
echo " Run: 'mise run release $new_version'"
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
[tasks."git-copilot-commit:release"]
|
|
78
|
+
description = "Push a tag and create a GitHub release"
|
|
79
|
+
usage = """
|
|
80
|
+
arg "<version>" help="Version tag to push and release"
|
|
81
|
+
"""
|
|
82
|
+
run = """
|
|
83
|
+
set -euo pipefail
|
|
84
|
+
|
|
85
|
+
version="${usage_version?}"
|
|
86
|
+
|
|
87
|
+
echo "Pushing commit and tag for $version..."
|
|
88
|
+
git push
|
|
89
|
+
git push origin "$version"
|
|
90
|
+
|
|
91
|
+
echo "Creating GitHub release for $version..."
|
|
92
|
+
gh release create "$version" --title "$version" --generate-notes
|
|
93
|
+
|
|
94
|
+
echo "✓ Release $version created and pushed"
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
[tasks."git-copilot-commit:test"]
|
|
98
|
+
description = "Run tests with uv and pytest"
|
|
99
|
+
run = "uv run --with pytest pytest"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-copilot-commit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Automatically generate and commit changes using GitHub Copilot or OpenAI-compatible LLMs
|
|
5
5
|
Author-email: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com>
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Python: >=3.12
|
|
8
|
+
Requires-Dist: cyclopts>=4.11.0
|
|
8
9
|
Requires-Dist: httpx>=0.28.0
|
|
9
10
|
Requires-Dist: platformdirs>=4.0.0
|
|
10
11
|
Requires-Dist: rich>=14.0.0
|
|
11
12
|
Requires-Dist: truststore>=0.10.4
|
|
12
|
-
Requires-Dist: typer>=0.16.0
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
|
|
15
15
|
# `git-copilot-commit`
|
|
@@ -18,14 +18,16 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
[](https://pypi.org/project/git-copilot-commit/)
|
|
19
19
|
[](https://github.com/kdheepak/git-copilot-commit/blob/main/LICENSE)
|
|
20
20
|
|
|
21
|
-
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or
|
|
21
|
+
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or
|
|
22
|
+
any OpenAI-compatible LLM.
|
|
22
23
|
|
|
23
24
|

|
|
24
25
|
|
|
25
26
|
## Features
|
|
26
27
|
|
|
27
28
|
- Generates commit messages based on your staged changes
|
|
28
|
-
- Supports GitHub Copilot and OpenAI-compatible `/v1/
|
|
29
|
+
- Supports GitHub Copilot and OpenAI-compatible `/v1/chat/completions`, `/v1/responses`,
|
|
30
|
+
and `/v1/models` endpoints
|
|
29
31
|
- Supports multiple LLM models: GPT, Claude, Gemini, local models, and more
|
|
30
32
|
- Allows editing of generated messages before committing
|
|
31
33
|
- Follows the [Conventional Commits](https://www.conventionalcommits.org/) standard
|
|
@@ -51,8 +53,8 @@ You can run the latest version of tool directly every time by invoking this one
|
|
|
51
53
|
uvx git-copilot-commit --help
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
Alternatively, you can install the tool once into a global isolated environment
|
|
55
|
-
|
|
56
|
+
Alternatively, you can install the tool once into a global isolated environment and run
|
|
57
|
+
`git-copilot-commit` to invoke it:
|
|
56
58
|
|
|
57
59
|
```bash
|
|
58
60
|
# Install into global isolated environment
|
|
@@ -96,25 +98,28 @@ git-copilot-commit --help
|
|
|
96
98
|
|
|
97
99
|
### OpenAI-compatible provider
|
|
98
100
|
|
|
99
|
-
1.
|
|
101
|
+
1. List models by pointing the CLI at your server's `/models` endpoint.
|
|
100
102
|
|
|
101
103
|
```bash
|
|
102
104
|
uvx git-copilot-commit models \
|
|
103
105
|
--provider openai \
|
|
104
|
-
--base-url http://127.0.0.1:11434/v1
|
|
106
|
+
--base-url http://127.0.0.1:11434/v1/models
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
2. Generate and commit
|
|
109
|
+
2. Generate and commit by pointing the CLI at the generation endpoint you want to use.
|
|
108
110
|
|
|
109
111
|
```bash
|
|
110
112
|
uvx git-copilot-commit commit \
|
|
111
113
|
--provider openai \
|
|
112
|
-
--base-url http://127.0.0.1:11434/v1 \
|
|
114
|
+
--base-url http://127.0.0.1:11434/v1/chat/completions \
|
|
113
115
|
--model your-model-id
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
If your server requires an API key, also pass `--api-key ...` or set `OPENAI_API_KEY`.
|
|
117
119
|
|
|
120
|
+
OpenAI-compatible generation URLs must end with `/chat/completions` or `/responses`.
|
|
121
|
+
Model listing URLs must end with `/models`.
|
|
122
|
+
|
|
118
123
|
## Usage
|
|
119
124
|
|
|
120
125
|
### Commit changes
|
|
@@ -122,28 +127,39 @@ git-copilot-commit --help
|
|
|
122
127
|
```bash
|
|
123
128
|
$ uvx git-copilot-commit commit --help
|
|
124
129
|
|
|
125
|
-
Usage: git-copilot-commit commit [
|
|
130
|
+
Usage: git-copilot-commit commit [ARGS]
|
|
126
131
|
|
|
127
132
|
Generate commit message based on changes in the current git repository and commit them.
|
|
128
133
|
|
|
129
|
-
╭─
|
|
130
|
-
│ --all
|
|
131
|
-
│ --split
|
|
132
|
-
│
|
|
133
|
-
│
|
|
134
|
-
│ --
|
|
135
|
-
│ --
|
|
136
|
-
│
|
|
137
|
-
│ --
|
|
138
|
-
│
|
|
139
|
-
│
|
|
140
|
-
│
|
|
141
|
-
│
|
|
142
|
-
│
|
|
143
|
-
│
|
|
144
|
-
│
|
|
145
|
-
│ --
|
|
146
|
-
|
|
134
|
+
╭─ Parameters ─────────────────────────────────────────────────────────────────╮
|
|
135
|
+
│ ALL --all -a --no-all Stage all files before committing [default: False] │
|
|
136
|
+
│ SPLIT --split --no-split Split staged hunks into multiple commits │
|
|
137
|
+
│ automatically. Pass --split=N to express a │
|
|
138
|
+
│ preference for N commits. [default: False] │
|
|
139
|
+
│ MODEL --model -m Model to use for generating commit message │
|
|
140
|
+
│ YES --yes -y --no-yes Automatically accept the generated commit message │
|
|
141
|
+
│ [default: False] │
|
|
142
|
+
│ CONTEXT --context -c Optional user-provided context to guide commit │
|
|
143
|
+
│ message [default: ""] │
|
|
144
|
+
│ DISABLE-THINKING Disable or minimize reasoning/thinking tokens for │
|
|
145
|
+
│ --disable-thinking commit-message requests. [default: True] │
|
|
146
|
+
│ --enable-thinking │
|
|
147
|
+
│ MAX-TOKENS --max-tokens Maximum output tokens for LLM generation. │
|
|
148
|
+
│ [default: 1024] │
|
|
149
|
+
│ PROVIDER --provider LLM provider to use: copilot or openai. │
|
|
150
|
+
│ BASE-URL --base-url Endpoint URL for an OpenAI-compatible provider, │
|
|
151
|
+
│ for example │
|
|
152
|
+
│ http://127.0.0.1:11434/v1/chat/completions. │
|
|
153
|
+
│ API-KEY --api-key API key for an OpenAI-compatible provider. Omit │
|
|
154
|
+
│ when the server does not require one. │
|
|
155
|
+
│ CA-BUNDLE --ca-bundle Path to a custom CA bundle (PEM) │
|
|
156
|
+
│ INSECURE --insecure Disable SSL certificate verification. [default: │
|
|
157
|
+
│ --no-insecure False] │
|
|
158
|
+
│ NATIVE-TLS --native-tls Use the OS's native certificate store via │
|
|
159
|
+
│ --no-native-tls 'truststore' for httpx instead of the Python │
|
|
160
|
+
│ bundle. Ignored if --ca-bundle or --insecure is │
|
|
161
|
+
│ used. [default: True] │
|
|
162
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
147
163
|
```
|
|
148
164
|
|
|
149
165
|
## Examples
|
|
@@ -171,10 +187,53 @@ Use a local OpenAI-compatible server:
|
|
|
171
187
|
```bash
|
|
172
188
|
uvx git-copilot-commit commit \
|
|
173
189
|
--provider openai \
|
|
174
|
-
--base-url http://127.0.0.1:11434/v1 \
|
|
190
|
+
--base-url http://127.0.0.1:11434/v1/chat/completions \
|
|
191
|
+
--model your-model-id
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Example with `openai/gpt-oss-120b` and `Qwen/Qwen3.6-35B-A3B`:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
uvx git-copilot-commit commit \
|
|
198
|
+
--provider openai \
|
|
199
|
+
--base-url http://example.com:8001/v1/chat/completions \
|
|
200
|
+
--model openai/gpt-oss-120b
|
|
201
|
+
|
|
202
|
+
uvx git-copilot-commit commit \
|
|
203
|
+
--provider openai \
|
|
204
|
+
--base-url http://example.com:8002/v1/chat/completions \
|
|
205
|
+
--model Qwen/Qwen3.6-35B-A3B
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Use the Responses API endpoint:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
uvx git-copilot-commit commit \
|
|
212
|
+
--provider openai \
|
|
213
|
+
--base-url http://example.com:8002/v1/responses \
|
|
175
214
|
--model your-model-id
|
|
176
215
|
```
|
|
177
216
|
|
|
217
|
+
Increase the output token budget:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
uvx git-copilot-commit commit --max-tokens 4096
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Thinking/reasoning is disabled or minimized by default for commit-message requests. To let the
|
|
224
|
+
selected model use its default thinking behavior, pass:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
uvx git-copilot-commit commit --enable-thinking
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
TLS uses the operating system's native certificate store by default. To use Python's default
|
|
231
|
+
certificate bundle instead, pass:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
uvx git-copilot-commit commit --no-native-tls
|
|
235
|
+
```
|
|
236
|
+
|
|
178
237
|
Split staged hunks into separate commits:
|
|
179
238
|
|
|
180
239
|
```bash
|
|
@@ -222,8 +281,8 @@ Now you can run to review the message before committing:
|
|
|
222
281
|
git ai-commit
|
|
223
282
|
```
|
|
224
283
|
|
|
225
|
-
Alternatively, you can stage all files and auto accept the commit message and
|
|
226
|
-
|
|
284
|
+
Alternatively, you can stage all files and auto accept the commit message and specify which model
|
|
285
|
+
should be used to generate the commit in one CLI invocation.
|
|
227
286
|
|
|
228
287
|
```bash
|
|
229
288
|
git ai-commit --all --yes --model claude-3.5-sonnet
|
|
@@ -232,11 +291,21 @@ git ai-commit --all --yes --model claude-3.5-sonnet
|
|
|
232
291
|
You can also set provider defaults with environment variables:
|
|
233
292
|
|
|
234
293
|
```bash
|
|
235
|
-
export
|
|
294
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
295
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://127.0.0.1:11434/v1/chat/completions
|
|
296
|
+
export GIT_COPILOT_COMMIT_API_KEY=...
|
|
236
297
|
export OPENAI_API_KEY=...
|
|
237
298
|
git ai-commit --provider openai --model your-model-id
|
|
238
299
|
```
|
|
239
300
|
|
|
301
|
+
For example:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
305
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://example.com:8001/v1/chat/completions
|
|
306
|
+
git ai-commit --model openai/gpt-oss-120b
|
|
307
|
+
```
|
|
308
|
+
|
|
240
309
|
> [!TIP]
|
|
241
310
|
>
|
|
242
311
|
> Show more context in diffs by running the following command:
|
|
@@ -245,5 +314,5 @@ git ai-commit --provider openai --model your-model-id
|
|
|
245
314
|
> git config --global diff.context 3
|
|
246
315
|
> ```
|
|
247
316
|
>
|
|
248
|
-
> This may be useful because this tool sends the diffs with surrounding context
|
|
249
|
-
>
|
|
317
|
+
> This may be useful because this tool sends the diffs with surrounding context to the LLM for
|
|
318
|
+
> generating a commit message
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
[](https://pypi.org/project/git-copilot-commit/)
|
|
5
5
|
[](https://github.com/kdheepak/git-copilot-commit/blob/main/LICENSE)
|
|
6
6
|
|
|
7
|
-
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or
|
|
7
|
+
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or
|
|
8
|
+
any OpenAI-compatible LLM.
|
|
8
9
|
|
|
9
10
|

|
|
10
11
|
|
|
11
12
|
## Features
|
|
12
13
|
|
|
13
14
|
- Generates commit messages based on your staged changes
|
|
14
|
-
- Supports GitHub Copilot and OpenAI-compatible `/v1/
|
|
15
|
+
- Supports GitHub Copilot and OpenAI-compatible `/v1/chat/completions`, `/v1/responses`,
|
|
16
|
+
and `/v1/models` endpoints
|
|
15
17
|
- Supports multiple LLM models: GPT, Claude, Gemini, local models, and more
|
|
16
18
|
- Allows editing of generated messages before committing
|
|
17
19
|
- Follows the [Conventional Commits](https://www.conventionalcommits.org/) standard
|
|
@@ -37,8 +39,8 @@ You can run the latest version of tool directly every time by invoking this one
|
|
|
37
39
|
uvx git-copilot-commit --help
|
|
38
40
|
```
|
|
39
41
|
|
|
40
|
-
Alternatively, you can install the tool once into a global isolated environment
|
|
41
|
-
|
|
42
|
+
Alternatively, you can install the tool once into a global isolated environment and run
|
|
43
|
+
`git-copilot-commit` to invoke it:
|
|
42
44
|
|
|
43
45
|
```bash
|
|
44
46
|
# Install into global isolated environment
|
|
@@ -82,25 +84,28 @@ git-copilot-commit --help
|
|
|
82
84
|
|
|
83
85
|
### OpenAI-compatible provider
|
|
84
86
|
|
|
85
|
-
1.
|
|
87
|
+
1. List models by pointing the CLI at your server's `/models` endpoint.
|
|
86
88
|
|
|
87
89
|
```bash
|
|
88
90
|
uvx git-copilot-commit models \
|
|
89
91
|
--provider openai \
|
|
90
|
-
--base-url http://127.0.0.1:11434/v1
|
|
92
|
+
--base-url http://127.0.0.1:11434/v1/models
|
|
91
93
|
```
|
|
92
94
|
|
|
93
|
-
2. Generate and commit
|
|
95
|
+
2. Generate and commit by pointing the CLI at the generation endpoint you want to use.
|
|
94
96
|
|
|
95
97
|
```bash
|
|
96
98
|
uvx git-copilot-commit commit \
|
|
97
99
|
--provider openai \
|
|
98
|
-
--base-url http://127.0.0.1:11434/v1 \
|
|
100
|
+
--base-url http://127.0.0.1:11434/v1/chat/completions \
|
|
99
101
|
--model your-model-id
|
|
100
102
|
```
|
|
101
103
|
|
|
102
104
|
If your server requires an API key, also pass `--api-key ...` or set `OPENAI_API_KEY`.
|
|
103
105
|
|
|
106
|
+
OpenAI-compatible generation URLs must end with `/chat/completions` or `/responses`.
|
|
107
|
+
Model listing URLs must end with `/models`.
|
|
108
|
+
|
|
104
109
|
## Usage
|
|
105
110
|
|
|
106
111
|
### Commit changes
|
|
@@ -108,28 +113,39 @@ git-copilot-commit --help
|
|
|
108
113
|
```bash
|
|
109
114
|
$ uvx git-copilot-commit commit --help
|
|
110
115
|
|
|
111
|
-
Usage: git-copilot-commit commit [
|
|
116
|
+
Usage: git-copilot-commit commit [ARGS]
|
|
112
117
|
|
|
113
118
|
Generate commit message based on changes in the current git repository and commit them.
|
|
114
119
|
|
|
115
|
-
╭─
|
|
116
|
-
│ --all
|
|
117
|
-
│ --split
|
|
118
|
-
│
|
|
119
|
-
│
|
|
120
|
-
│ --
|
|
121
|
-
│ --
|
|
122
|
-
│
|
|
123
|
-
│ --
|
|
124
|
-
│
|
|
125
|
-
│
|
|
126
|
-
│
|
|
127
|
-
│
|
|
128
|
-
│
|
|
129
|
-
│
|
|
130
|
-
│
|
|
131
|
-
│ --
|
|
132
|
-
|
|
120
|
+
╭─ Parameters ─────────────────────────────────────────────────────────────────╮
|
|
121
|
+
│ ALL --all -a --no-all Stage all files before committing [default: False] │
|
|
122
|
+
│ SPLIT --split --no-split Split staged hunks into multiple commits │
|
|
123
|
+
│ automatically. Pass --split=N to express a │
|
|
124
|
+
│ preference for N commits. [default: False] │
|
|
125
|
+
│ MODEL --model -m Model to use for generating commit message │
|
|
126
|
+
│ YES --yes -y --no-yes Automatically accept the generated commit message │
|
|
127
|
+
│ [default: False] │
|
|
128
|
+
│ CONTEXT --context -c Optional user-provided context to guide commit │
|
|
129
|
+
│ message [default: ""] │
|
|
130
|
+
│ DISABLE-THINKING Disable or minimize reasoning/thinking tokens for │
|
|
131
|
+
│ --disable-thinking commit-message requests. [default: True] │
|
|
132
|
+
│ --enable-thinking │
|
|
133
|
+
│ MAX-TOKENS --max-tokens Maximum output tokens for LLM generation. │
|
|
134
|
+
│ [default: 1024] │
|
|
135
|
+
│ PROVIDER --provider LLM provider to use: copilot or openai. │
|
|
136
|
+
│ BASE-URL --base-url Endpoint URL for an OpenAI-compatible provider, │
|
|
137
|
+
│ for example │
|
|
138
|
+
│ http://127.0.0.1:11434/v1/chat/completions. │
|
|
139
|
+
│ API-KEY --api-key API key for an OpenAI-compatible provider. Omit │
|
|
140
|
+
│ when the server does not require one. │
|
|
141
|
+
│ CA-BUNDLE --ca-bundle Path to a custom CA bundle (PEM) │
|
|
142
|
+
│ INSECURE --insecure Disable SSL certificate verification. [default: │
|
|
143
|
+
│ --no-insecure False] │
|
|
144
|
+
│ NATIVE-TLS --native-tls Use the OS's native certificate store via │
|
|
145
|
+
│ --no-native-tls 'truststore' for httpx instead of the Python │
|
|
146
|
+
│ bundle. Ignored if --ca-bundle or --insecure is │
|
|
147
|
+
│ used. [default: True] │
|
|
148
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
133
149
|
```
|
|
134
150
|
|
|
135
151
|
## Examples
|
|
@@ -157,10 +173,53 @@ Use a local OpenAI-compatible server:
|
|
|
157
173
|
```bash
|
|
158
174
|
uvx git-copilot-commit commit \
|
|
159
175
|
--provider openai \
|
|
160
|
-
--base-url http://127.0.0.1:11434/v1 \
|
|
176
|
+
--base-url http://127.0.0.1:11434/v1/chat/completions \
|
|
177
|
+
--model your-model-id
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Example with `openai/gpt-oss-120b` and `Qwen/Qwen3.6-35B-A3B`:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
uvx git-copilot-commit commit \
|
|
184
|
+
--provider openai \
|
|
185
|
+
--base-url http://example.com:8001/v1/chat/completions \
|
|
186
|
+
--model openai/gpt-oss-120b
|
|
187
|
+
|
|
188
|
+
uvx git-copilot-commit commit \
|
|
189
|
+
--provider openai \
|
|
190
|
+
--base-url http://example.com:8002/v1/chat/completions \
|
|
191
|
+
--model Qwen/Qwen3.6-35B-A3B
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Use the Responses API endpoint:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
uvx git-copilot-commit commit \
|
|
198
|
+
--provider openai \
|
|
199
|
+
--base-url http://example.com:8002/v1/responses \
|
|
161
200
|
--model your-model-id
|
|
162
201
|
```
|
|
163
202
|
|
|
203
|
+
Increase the output token budget:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
uvx git-copilot-commit commit --max-tokens 4096
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Thinking/reasoning is disabled or minimized by default for commit-message requests. To let the
|
|
210
|
+
selected model use its default thinking behavior, pass:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
uvx git-copilot-commit commit --enable-thinking
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
TLS uses the operating system's native certificate store by default. To use Python's default
|
|
217
|
+
certificate bundle instead, pass:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
uvx git-copilot-commit commit --no-native-tls
|
|
221
|
+
```
|
|
222
|
+
|
|
164
223
|
Split staged hunks into separate commits:
|
|
165
224
|
|
|
166
225
|
```bash
|
|
@@ -208,8 +267,8 @@ Now you can run to review the message before committing:
|
|
|
208
267
|
git ai-commit
|
|
209
268
|
```
|
|
210
269
|
|
|
211
|
-
Alternatively, you can stage all files and auto accept the commit message and
|
|
212
|
-
|
|
270
|
+
Alternatively, you can stage all files and auto accept the commit message and specify which model
|
|
271
|
+
should be used to generate the commit in one CLI invocation.
|
|
213
272
|
|
|
214
273
|
```bash
|
|
215
274
|
git ai-commit --all --yes --model claude-3.5-sonnet
|
|
@@ -218,11 +277,21 @@ git ai-commit --all --yes --model claude-3.5-sonnet
|
|
|
218
277
|
You can also set provider defaults with environment variables:
|
|
219
278
|
|
|
220
279
|
```bash
|
|
221
|
-
export
|
|
280
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
281
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://127.0.0.1:11434/v1/chat/completions
|
|
282
|
+
export GIT_COPILOT_COMMIT_API_KEY=...
|
|
222
283
|
export OPENAI_API_KEY=...
|
|
223
284
|
git ai-commit --provider openai --model your-model-id
|
|
224
285
|
```
|
|
225
286
|
|
|
287
|
+
For example:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
291
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://example.com:8001/v1/chat/completions
|
|
292
|
+
git ai-commit --model openai/gpt-oss-120b
|
|
293
|
+
```
|
|
294
|
+
|
|
226
295
|
> [!TIP]
|
|
227
296
|
>
|
|
228
297
|
> Show more context in diffs by running the following command:
|
|
@@ -231,5 +300,5 @@ git ai-commit --provider openai --model your-model-id
|
|
|
231
300
|
> git config --global diff.context 3
|
|
232
301
|
> ```
|
|
233
302
|
>
|
|
234
|
-
> This may be useful because this tool sends the diffs with surrounding context
|
|
235
|
-
>
|
|
303
|
+
> This may be useful because this tool sends the diffs with surrounding context to the LLM for
|
|
304
|
+
> generating a commit message
|