git-copilot-commit 0.6.0__tar.gz → 0.6.1__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.6.1/.config/mise.toml +99 -0
- git_copilot_commit-0.6.1/.python-version +1 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/PKG-INFO +39 -5
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/README.md +37 -3
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/pyproject.toml +1 -1
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/cli.py +122 -124
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/git.py +123 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/test_cli.py +294 -63
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/test_git.py +43 -9
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/test_providers.py +2 -2
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/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 → git_copilot_commit-0.6.1}/.github/dependabot.yml +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/.github/workflows/ci.yml +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/.gitignore +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/LICENSE +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/__init__.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/llms/__init__.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/llms/copilot.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/llms/core.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/llms/openai_api.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/llms/providers.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/prompts/commit-message-generator-prompt.md +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/prompts/split-commit-planner-prompt.md +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/py.typed +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/settings.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/split_commits.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/src/git_copilot_commit/version.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/conftest.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/test_llm_and_copilot.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/test_settings.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/tests/test_split_commits.py +0 -0
- {git_copilot_commit-0.6.0 → git_copilot_commit-0.6.1}/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.6.
|
|
3
|
+
Version: 0.6.1
|
|
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`
|
|
@@ -96,7 +96,11 @@ git-copilot-commit --help
|
|
|
96
96
|
|
|
97
97
|
### OpenAI-compatible provider
|
|
98
98
|
|
|
99
|
-
1. Point the CLI at your server
|
|
99
|
+
1. Point the CLI at your server.
|
|
100
|
+
|
|
101
|
+
The base URL can be either the provider root such as `http://127.0.0.1:11434/v1`
|
|
102
|
+
or the full chat completions endpoint such as
|
|
103
|
+
`http://127.0.0.1:11434/v1/chat/completions`.
|
|
100
104
|
|
|
101
105
|
```bash
|
|
102
106
|
uvx git-copilot-commit models \
|
|
@@ -104,7 +108,7 @@ git-copilot-commit --help
|
|
|
104
108
|
--base-url http://127.0.0.1:11434/v1
|
|
105
109
|
```
|
|
106
110
|
|
|
107
|
-
2. Generate and commit
|
|
111
|
+
2. Generate and commit.
|
|
108
112
|
|
|
109
113
|
```bash
|
|
110
114
|
uvx git-copilot-commit commit \
|
|
@@ -115,6 +119,17 @@ git-copilot-commit --help
|
|
|
115
119
|
|
|
116
120
|
If your server requires an API key, also pass `--api-key ...` or set `OPENAI_API_KEY`.
|
|
117
121
|
|
|
122
|
+
3. Example: use a self-hosted GPT-OSS model:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
uvx git-copilot-commit commit \
|
|
126
|
+
--provider openai \
|
|
127
|
+
--base-url http://example.com:8001/v1/chat/completions \
|
|
128
|
+
--model openai/gpt-oss-120b
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Model ids with slashes such as `openai/gpt-oss-120b` are supported.
|
|
132
|
+
|
|
118
133
|
## Usage
|
|
119
134
|
|
|
120
135
|
### Commit changes
|
|
@@ -175,6 +190,15 @@ uvx git-copilot-commit commit \
|
|
|
175
190
|
--model your-model-id
|
|
176
191
|
```
|
|
177
192
|
|
|
193
|
+
Use a self-hosted GPT-OSS endpoint:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
uvx git-copilot-commit commit \
|
|
197
|
+
--provider openai \
|
|
198
|
+
--base-url http://example.com:8001/v1/chat/completions \
|
|
199
|
+
--model openai/gpt-oss-120b
|
|
200
|
+
```
|
|
201
|
+
|
|
178
202
|
Split staged hunks into separate commits:
|
|
179
203
|
|
|
180
204
|
```bash
|
|
@@ -232,11 +256,21 @@ git ai-commit --all --yes --model claude-3.5-sonnet
|
|
|
232
256
|
You can also set provider defaults with environment variables:
|
|
233
257
|
|
|
234
258
|
```bash
|
|
235
|
-
export
|
|
259
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
260
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://127.0.0.1:11434/v1
|
|
261
|
+
export GIT_COPILOT_COMMIT_API_KEY=...
|
|
236
262
|
export OPENAI_API_KEY=...
|
|
237
263
|
git ai-commit --provider openai --model your-model-id
|
|
238
264
|
```
|
|
239
265
|
|
|
266
|
+
For example:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
270
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://example.com:8001/v1
|
|
271
|
+
git ai-commit --model openai/gpt-oss-120b
|
|
272
|
+
```
|
|
273
|
+
|
|
240
274
|
> [!TIP]
|
|
241
275
|
>
|
|
242
276
|
> Show more context in diffs by running the following command:
|
|
@@ -82,7 +82,11 @@ git-copilot-commit --help
|
|
|
82
82
|
|
|
83
83
|
### OpenAI-compatible provider
|
|
84
84
|
|
|
85
|
-
1. Point the CLI at your server
|
|
85
|
+
1. Point the CLI at your server.
|
|
86
|
+
|
|
87
|
+
The base URL can be either the provider root such as `http://127.0.0.1:11434/v1`
|
|
88
|
+
or the full chat completions endpoint such as
|
|
89
|
+
`http://127.0.0.1:11434/v1/chat/completions`.
|
|
86
90
|
|
|
87
91
|
```bash
|
|
88
92
|
uvx git-copilot-commit models \
|
|
@@ -90,7 +94,7 @@ git-copilot-commit --help
|
|
|
90
94
|
--base-url http://127.0.0.1:11434/v1
|
|
91
95
|
```
|
|
92
96
|
|
|
93
|
-
2. Generate and commit
|
|
97
|
+
2. Generate and commit.
|
|
94
98
|
|
|
95
99
|
```bash
|
|
96
100
|
uvx git-copilot-commit commit \
|
|
@@ -101,6 +105,17 @@ git-copilot-commit --help
|
|
|
101
105
|
|
|
102
106
|
If your server requires an API key, also pass `--api-key ...` or set `OPENAI_API_KEY`.
|
|
103
107
|
|
|
108
|
+
3. Example: use a self-hosted GPT-OSS model:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
uvx git-copilot-commit commit \
|
|
112
|
+
--provider openai \
|
|
113
|
+
--base-url http://example.com:8001/v1/chat/completions \
|
|
114
|
+
--model openai/gpt-oss-120b
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Model ids with slashes such as `openai/gpt-oss-120b` are supported.
|
|
118
|
+
|
|
104
119
|
## Usage
|
|
105
120
|
|
|
106
121
|
### Commit changes
|
|
@@ -161,6 +176,15 @@ uvx git-copilot-commit commit \
|
|
|
161
176
|
--model your-model-id
|
|
162
177
|
```
|
|
163
178
|
|
|
179
|
+
Use a self-hosted GPT-OSS endpoint:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
uvx git-copilot-commit commit \
|
|
183
|
+
--provider openai \
|
|
184
|
+
--base-url http://example.com:8001/v1/chat/completions \
|
|
185
|
+
--model openai/gpt-oss-120b
|
|
186
|
+
```
|
|
187
|
+
|
|
164
188
|
Split staged hunks into separate commits:
|
|
165
189
|
|
|
166
190
|
```bash
|
|
@@ -218,11 +242,21 @@ git ai-commit --all --yes --model claude-3.5-sonnet
|
|
|
218
242
|
You can also set provider defaults with environment variables:
|
|
219
243
|
|
|
220
244
|
```bash
|
|
221
|
-
export
|
|
245
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
246
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://127.0.0.1:11434/v1
|
|
247
|
+
export GIT_COPILOT_COMMIT_API_KEY=...
|
|
222
248
|
export OPENAI_API_KEY=...
|
|
223
249
|
git ai-commit --provider openai --model your-model-id
|
|
224
250
|
```
|
|
225
251
|
|
|
252
|
+
For example:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
export GIT_COPILOT_COMMIT_PROVIDER=openai
|
|
256
|
+
export GIT_COPILOT_COMMIT_BASE_URL=http://example.com:8001/v1
|
|
257
|
+
git ai-commit --model openai/gpt-oss-120b
|
|
258
|
+
```
|
|
259
|
+
|
|
226
260
|
> [!TIP]
|
|
227
261
|
>
|
|
228
262
|
> Show more context in diffs by running the following command:
|