git-copilot-commit 0.5.7__tar.gz → 0.6.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 (34) hide show
  1. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/PKG-INFO +51 -7
  2. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/README.md +49 -5
  3. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/pyproject.toml +1 -1
  4. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/cli.py +158 -62
  5. git_copilot_commit-0.6.0/src/git_copilot_commit/llms/copilot.py +799 -0
  6. git_copilot_commit-0.6.0/src/git_copilot_commit/llms/core.py +802 -0
  7. git_copilot_commit-0.6.0/src/git_copilot_commit/llms/openai_api.py +219 -0
  8. git_copilot_commit-0.6.0/src/git_copilot_commit/llms/providers.py +373 -0
  9. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/prompts/commit-message-generator-prompt.md +4 -3
  10. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/prompts/split-commit-planner-prompt.md +1 -0
  11. git_copilot_commit-0.6.0/src/git_copilot_commit/py.typed +0 -0
  12. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/tests/test_cli.py +79 -19
  13. git_copilot_commit-0.5.7/tests/test_github_copilot_utils.py → git_copilot_commit-0.6.0/tests/test_llm_and_copilot.py +118 -135
  14. git_copilot_commit-0.6.0/tests/test_providers.py +178 -0
  15. git_copilot_commit-0.6.0/uv.lock +321 -0
  16. git_copilot_commit-0.5.7/src/git_copilot_commit/github_copilot.py +0 -1579
  17. git_copilot_commit-0.5.7/uv.lock +0 -331
  18. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/.github/dependabot.yml +0 -0
  19. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/.github/workflows/ci.yml +0 -0
  20. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/.gitignore +0 -0
  21. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/.justfile +0 -0
  22. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/.python-version +0 -0
  23. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/LICENSE +0 -0
  24. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/__init__.py +0 -0
  25. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/git.py +0 -0
  26. /git_copilot_commit-0.5.7/src/git_copilot_commit/py.typed → /git_copilot_commit-0.6.0/src/git_copilot_commit/llms/__init__.py +0 -0
  27. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/settings.py +0 -0
  28. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/split_commits.py +0 -0
  29. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/src/git_copilot_commit/version.py +0 -0
  30. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/tests/conftest.py +0 -0
  31. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/tests/test_git.py +0 -0
  32. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/tests/test_settings.py +0 -0
  33. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/tests/test_split_commits.py +0 -0
  34. {git_copilot_commit-0.5.7 → git_copilot_commit-0.6.0}/vhs/demo.vhs +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-copilot-commit
3
- Version: 0.5.7
4
- Summary: Automatically generate and commit changes using GitHub Copilot
3
+ Version: 0.6.0
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
@@ -18,14 +18,15 @@ Description-Content-Type: text/markdown
18
18
  [![PyPI](https://img.shields.io/pypi/v/git-copilot-commit)](https://pypi.org/project/git-copilot-commit/)
19
19
  [![License](https://img.shields.io/github/license/kdheepak/git-copilot-commit)](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.
21
+ AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or any OpenAI-compatible LLM.
22
22
 
23
23
  ![Screenshot of git-copilot-commit in action](https://github.com/user-attachments/assets/6a6d70a6-6060-44e6-8cf4-a6532e9e9142)
24
24
 
25
25
  ## Features
26
26
 
27
27
  - Generates commit messages based on your staged changes
28
- - Supports multiple LLM models: GPT-4, Claude, Gemini, and more
28
+ - Supports GitHub Copilot and OpenAI-compatible `/v1/models` + `/v1/chat/completions` APIs
29
+ - Supports multiple LLM models: GPT, Claude, Gemini, local models, and more
29
30
  - Allows editing of generated messages before committing
30
31
  - Follows the [Conventional Commits](https://www.conventionalcommits.org/) standard
31
32
 
@@ -50,7 +51,7 @@ You can run the latest version of tool directly every time by invoking this one
50
51
  uvx git-copilot-commit --help
51
52
  ```
52
53
 
53
- Alternatively, you can install the tool once into a global isolated environment
54
+ Alternatively, you can install the tool once into a global isolated environment
54
55
  and run `git-copilot-commit` to invoke it:
55
56
 
56
57
  ```bash
@@ -65,10 +66,12 @@ git-copilot-commit --help
65
66
 
66
67
  ## Prerequisites
67
68
 
68
- - Active GitHub Copilot subscription
69
+ - Either an active GitHub Copilot subscription or access to an OpenAI-compatible API endpoint
69
70
 
70
71
  ## Quick Start
71
72
 
73
+ ### GitHub Copilot
74
+
72
75
  1. Authenticate with GitHub Copilot:
73
76
 
74
77
  ```bash
@@ -91,6 +94,27 @@ git-copilot-commit --help
91
94
  uvx git-copilot-commit commit --all --yes
92
95
  ```
93
96
 
97
+ ### OpenAI-compatible provider
98
+
99
+ 1. Point the CLI at your server:
100
+
101
+ ```bash
102
+ uvx git-copilot-commit models \
103
+ --provider openai \
104
+ --base-url http://127.0.0.1:11434/v1
105
+ ```
106
+
107
+ 2. Generate and commit:
108
+
109
+ ```bash
110
+ uvx git-copilot-commit commit \
111
+ --provider openai \
112
+ --base-url http://127.0.0.1:11434/v1 \
113
+ --model your-model-id
114
+ ```
115
+
116
+ If your server requires an API key, also pass `--api-key ...` or set `OPENAI_API_KEY`.
117
+
94
118
  ## Usage
95
119
 
96
120
  ### Commit changes
@@ -109,6 +133,9 @@ $ uvx git-copilot-commit commit --help
109
133
  │ --model -m MODEL_ID Model to use for generating commit message │
110
134
  │ --yes -y Automatically accept the generated commit message │
111
135
  │ --context -c TEXT Optional user-provided context to guide commit message │
136
+ │ --provider TEXT LLM provider to use: copilot or openai │
137
+ │ --base-url URL Base URL for an OpenAI-compatible provider │
138
+ │ --api-key TEXT API key for an OpenAI-compatible provider │
112
139
  │ --ca-bundle PATH Path to a custom CA bundle (PEM) │
113
140
  │ --insecure Disable SSL certificate verification. │
114
141
  │ --native-tls --no-native-tls Use the OS's native certificate store via 'truststore' │
@@ -139,6 +166,15 @@ Use a specific model:
139
166
  uvx git-copilot-commit commit --model claude-3.5-sonnet
140
167
  ```
141
168
 
169
+ Use a local OpenAI-compatible server:
170
+
171
+ ```bash
172
+ uvx git-copilot-commit commit \
173
+ --provider openai \
174
+ --base-url http://127.0.0.1:11434/v1 \
175
+ --model your-model-id
176
+ ```
177
+
142
178
  Split staged hunks into separate commits:
143
179
 
144
180
  ```bash
@@ -193,6 +229,14 @@ specify which model should be used to generate the commit in one CLI invocation.
193
229
  git ai-commit --all --yes --model claude-3.5-sonnet
194
230
  ```
195
231
 
232
+ You can also set provider defaults with environment variables:
233
+
234
+ ```bash
235
+ export OPENAI_BASE_URL=http://127.0.0.1:11434/v1
236
+ export OPENAI_API_KEY=...
237
+ git ai-commit --provider openai --model your-model-id
238
+ ```
239
+
196
240
  > [!TIP]
197
241
  >
198
242
  > Show more context in diffs by running the following command:
@@ -201,5 +245,5 @@ git ai-commit --all --yes --model claude-3.5-sonnet
201
245
  > git config --global diff.context 3
202
246
  > ```
203
247
  >
204
- > This may be useful because this tool sends the diffs with surrounding context
248
+ > This may be useful because this tool sends the diffs with surrounding context
205
249
  > to the LLM for generating a commit message
@@ -4,14 +4,15 @@
4
4
  [![PyPI](https://img.shields.io/pypi/v/git-copilot-commit)](https://pypi.org/project/git-copilot-commit/)
5
5
  [![License](https://img.shields.io/github/license/kdheepak/git-copilot-commit)](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.
7
+ AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or any OpenAI-compatible LLM.
8
8
 
9
9
  ![Screenshot of git-copilot-commit in action](https://github.com/user-attachments/assets/6a6d70a6-6060-44e6-8cf4-a6532e9e9142)
10
10
 
11
11
  ## Features
12
12
 
13
13
  - Generates commit messages based on your staged changes
14
- - Supports multiple LLM models: GPT-4, Claude, Gemini, and more
14
+ - Supports GitHub Copilot and OpenAI-compatible `/v1/models` + `/v1/chat/completions` APIs
15
+ - Supports multiple LLM models: GPT, Claude, Gemini, local models, and more
15
16
  - Allows editing of generated messages before committing
16
17
  - Follows the [Conventional Commits](https://www.conventionalcommits.org/) standard
17
18
 
@@ -36,7 +37,7 @@ You can run the latest version of tool directly every time by invoking this one
36
37
  uvx git-copilot-commit --help
37
38
  ```
38
39
 
39
- Alternatively, you can install the tool once into a global isolated environment
40
+ Alternatively, you can install the tool once into a global isolated environment
40
41
  and run `git-copilot-commit` to invoke it:
41
42
 
42
43
  ```bash
@@ -51,10 +52,12 @@ git-copilot-commit --help
51
52
 
52
53
  ## Prerequisites
53
54
 
54
- - Active GitHub Copilot subscription
55
+ - Either an active GitHub Copilot subscription or access to an OpenAI-compatible API endpoint
55
56
 
56
57
  ## Quick Start
57
58
 
59
+ ### GitHub Copilot
60
+
58
61
  1. Authenticate with GitHub Copilot:
59
62
 
60
63
  ```bash
@@ -77,6 +80,27 @@ git-copilot-commit --help
77
80
  uvx git-copilot-commit commit --all --yes
78
81
  ```
79
82
 
83
+ ### OpenAI-compatible provider
84
+
85
+ 1. Point the CLI at your server:
86
+
87
+ ```bash
88
+ uvx git-copilot-commit models \
89
+ --provider openai \
90
+ --base-url http://127.0.0.1:11434/v1
91
+ ```
92
+
93
+ 2. Generate and commit:
94
+
95
+ ```bash
96
+ uvx git-copilot-commit commit \
97
+ --provider openai \
98
+ --base-url http://127.0.0.1:11434/v1 \
99
+ --model your-model-id
100
+ ```
101
+
102
+ If your server requires an API key, also pass `--api-key ...` or set `OPENAI_API_KEY`.
103
+
80
104
  ## Usage
81
105
 
82
106
  ### Commit changes
@@ -95,6 +119,9 @@ $ uvx git-copilot-commit commit --help
95
119
  │ --model -m MODEL_ID Model to use for generating commit message │
96
120
  │ --yes -y Automatically accept the generated commit message │
97
121
  │ --context -c TEXT Optional user-provided context to guide commit message │
122
+ │ --provider TEXT LLM provider to use: copilot or openai │
123
+ │ --base-url URL Base URL for an OpenAI-compatible provider │
124
+ │ --api-key TEXT API key for an OpenAI-compatible provider │
98
125
  │ --ca-bundle PATH Path to a custom CA bundle (PEM) │
99
126
  │ --insecure Disable SSL certificate verification. │
100
127
  │ --native-tls --no-native-tls Use the OS's native certificate store via 'truststore' │
@@ -125,6 +152,15 @@ Use a specific model:
125
152
  uvx git-copilot-commit commit --model claude-3.5-sonnet
126
153
  ```
127
154
 
155
+ Use a local OpenAI-compatible server:
156
+
157
+ ```bash
158
+ uvx git-copilot-commit commit \
159
+ --provider openai \
160
+ --base-url http://127.0.0.1:11434/v1 \
161
+ --model your-model-id
162
+ ```
163
+
128
164
  Split staged hunks into separate commits:
129
165
 
130
166
  ```bash
@@ -179,6 +215,14 @@ specify which model should be used to generate the commit in one CLI invocation.
179
215
  git ai-commit --all --yes --model claude-3.5-sonnet
180
216
  ```
181
217
 
218
+ You can also set provider defaults with environment variables:
219
+
220
+ ```bash
221
+ export OPENAI_BASE_URL=http://127.0.0.1:11434/v1
222
+ export OPENAI_API_KEY=...
223
+ git ai-commit --provider openai --model your-model-id
224
+ ```
225
+
182
226
  > [!TIP]
183
227
  >
184
228
  > Show more context in diffs by running the following command:
@@ -187,5 +231,5 @@ git ai-commit --all --yes --model claude-3.5-sonnet
187
231
  > git config --global diff.context 3
188
232
  > ```
189
233
  >
190
- > This may be useful because this tool sends the diffs with surrounding context
234
+ > This may be useful because this tool sends the diffs with surrounding context
191
235
  > to the LLM for generating a commit message
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "git-copilot-commit"
3
3
  dynamic = ["version"]
4
- description = "Automatically generate and commit changes using GitHub Copilot"
4
+ description = "Automatically generate and commit changes using GitHub Copilot or OpenAI-compatible LLMs"
5
5
  readme = "README.md"
6
6
  authors = [
7
7
  { name = "Dheepak Krishnamurthy", email = "1813121+kdheepak@users.noreply.github.com" },