git-copilot-commit 0.1.8__tar.gz → 0.1.10__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.1.8 → git_copilot_commit-0.1.10}/PKG-INFO +37 -27
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/README.md +36 -26
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/pyproject.toml +1 -1
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/src/git_copilot_commit/cli.py +16 -7
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/uv.lock +1 -1
- git_copilot_commit-0.1.10/vhs/demo.vhs +35 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/.github/workflows/ci.yml +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/.gitignore +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/.python-version +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/LICENSE +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/src/git_copilot_commit/__init__.py +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/src/git_copilot_commit/git.py +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/src/git_copilot_commit/py.typed +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/src/git_copilot_commit/settings.py +0 -0
- {git_copilot_commit-0.1.8 → git_copilot_commit-0.1.10}/src/git_copilot_commit/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-copilot-commit
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: Automatically generate and commit changes using copilot
|
|
5
5
|
Author-email: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -15,6 +15,8 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
|
|
16
16
|
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot.
|
|
17
17
|
|
|
18
|
+

|
|
19
|
+
|
|
18
20
|
## Features
|
|
19
21
|
|
|
20
22
|
- Generates commit messages based on your staged changes
|
|
@@ -69,39 +71,54 @@ git-copilot-commit commit
|
|
|
69
71
|
### Commit changes
|
|
70
72
|
|
|
71
73
|
```bash
|
|
72
|
-
git-copilot-commit commit
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
**Options:**
|
|
76
|
-
|
|
77
|
-
- `--all, -a`: Stage all files
|
|
78
|
-
- `--verbose, -v`: Show detailed output
|
|
79
|
-
- `--model, -m`: Choose an AI model
|
|
74
|
+
$ uvx git-copilot-commit commit --help
|
|
75
|
+
Usage: git-copilot-commit commit [OPTIONS]
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
Automatically commit changes in the current git repository.
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
Options:
|
|
80
|
+
-a, --all Stage all files before committing
|
|
81
|
+
-v, --verbose Show verbose output
|
|
82
|
+
-m, --model TEXT Model to use for generating commit message
|
|
83
|
+
--help Show this message and exit.
|
|
84
|
+
```
|
|
87
85
|
|
|
88
86
|
### Authenticate
|
|
89
87
|
|
|
90
88
|
```bash
|
|
91
|
-
git-copilot-commit authenticate
|
|
89
|
+
$ uvx git-copilot-commit authenticate --help
|
|
90
|
+
Usage: git-copilot-commit authenticate [OPTIONS]
|
|
91
|
+
|
|
92
|
+
Autheticate with GitHub Copilot.
|
|
93
|
+
|
|
94
|
+
Options:
|
|
95
|
+
--help Show this message and exit.
|
|
92
96
|
```
|
|
93
97
|
|
|
94
98
|
### List models
|
|
95
99
|
|
|
96
100
|
```bash
|
|
97
|
-
git-copilot-commit models
|
|
101
|
+
$ uvx git-copilot-commit models --help
|
|
102
|
+
Usage: git-copilot-commit models [OPTIONS]
|
|
103
|
+
|
|
104
|
+
List models available for chat in a table.
|
|
105
|
+
|
|
106
|
+
Options:
|
|
107
|
+
--help Show this message and exit.
|
|
98
108
|
```
|
|
99
109
|
|
|
100
110
|
### Configure
|
|
101
111
|
|
|
102
112
|
```bash
|
|
103
|
-
git-copilot-commit config --
|
|
104
|
-
git-copilot-commit config
|
|
113
|
+
$ uvx git-copilot-commit config --help
|
|
114
|
+
Usage: git-copilot-commit config [OPTIONS]
|
|
115
|
+
|
|
116
|
+
Manage application configuration.
|
|
117
|
+
|
|
118
|
+
Options:
|
|
119
|
+
--set-default-model TEXT Set default model for commit messages
|
|
120
|
+
--show Show current configuration
|
|
121
|
+
--help Show this message and exit.
|
|
105
122
|
```
|
|
106
123
|
|
|
107
124
|
## Examples
|
|
@@ -152,13 +169,6 @@ Follows [Conventional Commits](https://www.conventionalcommits.org/):
|
|
|
152
169
|
- `chore`: Maintenance
|
|
153
170
|
- `revert`: Revert changes
|
|
154
171
|
|
|
155
|
-
**Examples:**
|
|
156
|
-
|
|
157
|
-
- `feat(auth): add JWT authentication`
|
|
158
|
-
- `fix(db): retry connection on failure`
|
|
159
|
-
- `docs(readme): update install steps`
|
|
160
|
-
- `refactor(utils): simplify date parsing`
|
|
161
|
-
|
|
162
172
|
## Git Configuration
|
|
163
173
|
|
|
164
174
|
Add a git alias by adding the following to your `~/.gitconfig`:
|
|
@@ -172,11 +182,11 @@ Now you can run:
|
|
|
172
182
|
|
|
173
183
|
```bash
|
|
174
184
|
git ai-commit
|
|
175
|
-
git ai-commit --model claude-3.5-sonnet
|
|
176
185
|
git ai-commit --all --verbose
|
|
186
|
+
git ai-commit --model claude-3.5-sonnet
|
|
177
187
|
```
|
|
178
188
|
|
|
179
|
-
|
|
189
|
+
Additionally, show more context in diffs by running the following command:
|
|
180
190
|
|
|
181
191
|
```bash
|
|
182
192
|
git config --global diff.context 3
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot.
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- Generates commit messages based on your staged changes
|
|
@@ -56,39 +58,54 @@ git-copilot-commit commit
|
|
|
56
58
|
### Commit changes
|
|
57
59
|
|
|
58
60
|
```bash
|
|
59
|
-
git-copilot-commit commit
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
**Options:**
|
|
63
|
-
|
|
64
|
-
- `--all, -a`: Stage all files
|
|
65
|
-
- `--verbose, -v`: Show detailed output
|
|
66
|
-
- `--model, -m`: Choose an AI model
|
|
61
|
+
$ uvx git-copilot-commit commit --help
|
|
62
|
+
Usage: git-copilot-commit commit [OPTIONS]
|
|
67
63
|
|
|
68
|
-
|
|
64
|
+
Automatically commit changes in the current git repository.
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
Options:
|
|
67
|
+
-a, --all Stage all files before committing
|
|
68
|
+
-v, --verbose Show verbose output
|
|
69
|
+
-m, --model TEXT Model to use for generating commit message
|
|
70
|
+
--help Show this message and exit.
|
|
71
|
+
```
|
|
74
72
|
|
|
75
73
|
### Authenticate
|
|
76
74
|
|
|
77
75
|
```bash
|
|
78
|
-
git-copilot-commit authenticate
|
|
76
|
+
$ uvx git-copilot-commit authenticate --help
|
|
77
|
+
Usage: git-copilot-commit authenticate [OPTIONS]
|
|
78
|
+
|
|
79
|
+
Autheticate with GitHub Copilot.
|
|
80
|
+
|
|
81
|
+
Options:
|
|
82
|
+
--help Show this message and exit.
|
|
79
83
|
```
|
|
80
84
|
|
|
81
85
|
### List models
|
|
82
86
|
|
|
83
87
|
```bash
|
|
84
|
-
git-copilot-commit models
|
|
88
|
+
$ uvx git-copilot-commit models --help
|
|
89
|
+
Usage: git-copilot-commit models [OPTIONS]
|
|
90
|
+
|
|
91
|
+
List models available for chat in a table.
|
|
92
|
+
|
|
93
|
+
Options:
|
|
94
|
+
--help Show this message and exit.
|
|
85
95
|
```
|
|
86
96
|
|
|
87
97
|
### Configure
|
|
88
98
|
|
|
89
99
|
```bash
|
|
90
|
-
git-copilot-commit config --
|
|
91
|
-
git-copilot-commit config
|
|
100
|
+
$ uvx git-copilot-commit config --help
|
|
101
|
+
Usage: git-copilot-commit config [OPTIONS]
|
|
102
|
+
|
|
103
|
+
Manage application configuration.
|
|
104
|
+
|
|
105
|
+
Options:
|
|
106
|
+
--set-default-model TEXT Set default model for commit messages
|
|
107
|
+
--show Show current configuration
|
|
108
|
+
--help Show this message and exit.
|
|
92
109
|
```
|
|
93
110
|
|
|
94
111
|
## Examples
|
|
@@ -139,13 +156,6 @@ Follows [Conventional Commits](https://www.conventionalcommits.org/):
|
|
|
139
156
|
- `chore`: Maintenance
|
|
140
157
|
- `revert`: Revert changes
|
|
141
158
|
|
|
142
|
-
**Examples:**
|
|
143
|
-
|
|
144
|
-
- `feat(auth): add JWT authentication`
|
|
145
|
-
- `fix(db): retry connection on failure`
|
|
146
|
-
- `docs(readme): update install steps`
|
|
147
|
-
- `refactor(utils): simplify date parsing`
|
|
148
|
-
|
|
149
159
|
## Git Configuration
|
|
150
160
|
|
|
151
161
|
Add a git alias by adding the following to your `~/.gitconfig`:
|
|
@@ -159,11 +169,11 @@ Now you can run:
|
|
|
159
169
|
|
|
160
170
|
```bash
|
|
161
171
|
git ai-commit
|
|
162
|
-
git ai-commit --model claude-3.5-sonnet
|
|
163
172
|
git ai-commit --all --verbose
|
|
173
|
+
git ai-commit --model claude-3.5-sonnet
|
|
164
174
|
```
|
|
165
175
|
|
|
166
|
-
|
|
176
|
+
Additionally, show more context in diffs by running the following command:
|
|
167
177
|
|
|
168
178
|
```bash
|
|
169
179
|
git config --global diff.context 3
|
|
@@ -21,7 +21,7 @@ app = typer.Typer(help=__doc__, add_completion=False)
|
|
|
21
21
|
|
|
22
22
|
def version_callback(value: bool):
|
|
23
23
|
if value:
|
|
24
|
-
rich.print(f"git-copilot-
|
|
24
|
+
rich.print(f"git-copilot-commit [bold green]{__version__}[/]")
|
|
25
25
|
raise typer.Exit()
|
|
26
26
|
|
|
27
27
|
|
|
@@ -78,9 +78,13 @@ def generate_commit_message(
|
|
|
78
78
|
) -> str:
|
|
79
79
|
"""Generate a conventional commit message using Copilot API."""
|
|
80
80
|
|
|
81
|
-
# Get recent commits for context
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
# Get recent commits for context (handle empty repositories)
|
|
82
|
+
try:
|
|
83
|
+
recent_commits = repo.get_recent_commits(limit=5)
|
|
84
|
+
recent_commits_text = "\n".join([f"- {msg}" for _, msg in recent_commits])
|
|
85
|
+
except GitError:
|
|
86
|
+
# No commits yet in this repository
|
|
87
|
+
recent_commits_text = "No previous commits (initial commit)"
|
|
84
88
|
|
|
85
89
|
client = Copilot(
|
|
86
90
|
system_prompt="""
|
|
@@ -172,6 +176,7 @@ Return the commit message as the output without any additional text, explanation
|
|
|
172
176
|
)
|
|
173
177
|
|
|
174
178
|
prompt = f"""Recent commits:
|
|
179
|
+
|
|
175
180
|
{recent_commits_text}
|
|
176
181
|
|
|
177
182
|
`git status`:
|
|
@@ -260,10 +265,14 @@ def commit(
|
|
|
260
265
|
raise typer.Exit()
|
|
261
266
|
|
|
262
267
|
# Generate or use provided commit message
|
|
263
|
-
with console.status(
|
|
268
|
+
with console.status(
|
|
269
|
+
"[cyan]Generating commit message based on [bold]`git diff --staged`[/bold] ...[/cyan]"
|
|
270
|
+
):
|
|
264
271
|
commit_message = generate_commit_message(repo, status, model)
|
|
265
272
|
|
|
266
|
-
console.print(
|
|
273
|
+
console.print(
|
|
274
|
+
"[cyan]Generated commit message based on [bold]`git diff --staged`[/bold] ...[/cyan]"
|
|
275
|
+
)
|
|
267
276
|
|
|
268
277
|
# Display commit message
|
|
269
278
|
console.print(Panel(commit_message, title="Commit Message", border_style="green"))
|
|
@@ -315,7 +324,7 @@ def authenticate():
|
|
|
315
324
|
|
|
316
325
|
@app.command()
|
|
317
326
|
def models():
|
|
318
|
-
"""List models available for chat in a
|
|
327
|
+
"""List models available for chat in a table."""
|
|
319
328
|
models = Copilot().models
|
|
320
329
|
|
|
321
330
|
console = Console()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# VHS script to showcase git-copilot-commit
|
|
2
|
+
# Run with: vhs < demo.vhs
|
|
3
|
+
|
|
4
|
+
# Set up the terminal
|
|
5
|
+
Set Shell "bash"
|
|
6
|
+
Set FontSize 14
|
|
7
|
+
Set Width 1200
|
|
8
|
+
Set Height 600
|
|
9
|
+
Set PlaybackSpeed 1.0
|
|
10
|
+
Set TypingSpeed 50ms
|
|
11
|
+
Set Theme "Catppuccin Mocha"
|
|
12
|
+
|
|
13
|
+
# Show the title
|
|
14
|
+
Type "# git-copilot-commit demo"
|
|
15
|
+
Enter
|
|
16
|
+
Enter
|
|
17
|
+
Sleep 2s
|
|
18
|
+
|
|
19
|
+
# Demonstrate the tool
|
|
20
|
+
Type "uv run git-copilot-commit commit"
|
|
21
|
+
Enter
|
|
22
|
+
Sleep 5s
|
|
23
|
+
|
|
24
|
+
Enter # Yes to stage files
|
|
25
|
+
Sleep 5s
|
|
26
|
+
|
|
27
|
+
Enter # Yes to commit
|
|
28
|
+
Sleep 5s
|
|
29
|
+
|
|
30
|
+
Type "git log --oneline --graph --all -n 5"
|
|
31
|
+
Enter
|
|
32
|
+
|
|
33
|
+
Sleep 10s
|
|
34
|
+
|
|
35
|
+
Output demo.gif
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|