git-copilot-commit 0.1.7__tar.gz → 0.1.9__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.
@@ -0,0 +1,200 @@
1
+ Metadata-Version: 2.4
2
+ Name: git-copilot-commit
3
+ Version: 0.1.9
4
+ Summary: Automatically generate and commit changes using copilot
5
+ Author-email: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com>
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.12
8
+ Requires-Dist: platformdirs>=4.0.0
9
+ Requires-Dist: pycopilot>=0.1.6
10
+ Requires-Dist: rich>=14.0.0
11
+ Requires-Dist: typer>=0.16.0
12
+ Description-Content-Type: text/markdown
13
+
14
+ # `git-copilot-commit`
15
+
16
+ AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot.
17
+
18
+ ![](https://github.com/user-attachments/assets/6a6d70a6-6060-44e6-8cf4-a6532e9e9142)
19
+
20
+ ## Features
21
+
22
+ - Generates commit messages based on your staged changes
23
+ - Supports multiple AI models: GPT-4, Claude, Gemini, and more
24
+ - Allows editing of generated messages before committing
25
+ - Follows the [Conventional Commits](https://www.conventionalcommits.org/) standard
26
+
27
+ ## Installation
28
+
29
+ Install with [`uv`] (recommended):
30
+
31
+ ```bash
32
+ uv tool install git-copilot-commit
33
+ ```
34
+
35
+ Or with `pipx`:
36
+
37
+ ```bash
38
+ pipx install git-copilot-commit
39
+ ```
40
+
41
+ Or run directly with [`uv`]:
42
+
43
+ ```bash
44
+ uvx git-copilot-commit --help
45
+ ```
46
+
47
+ [`uv`]: https://github.com/astral-sh/uv
48
+
49
+ ## Prerequisites
50
+
51
+ - Active GitHub Copilot subscription
52
+
53
+ ## Quick Start
54
+
55
+ 1. Authenticate with GitHub Copilot:
56
+
57
+ ```bash
58
+ git-copilot-commit authenticate
59
+ ```
60
+
61
+ 2. Make changes in your repository.
62
+
63
+ 3. Generate and commit:
64
+
65
+ ```bash
66
+ git-copilot-commit commit
67
+ ```
68
+
69
+ ## Usage
70
+
71
+ ### Commit changes
72
+
73
+ ```bash
74
+ $ uvx git-copilot-commit commit --help
75
+ Usage: git-copilot-commit commit [OPTIONS]
76
+
77
+ Automatically commit changes in the current git repository.
78
+
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
+ ```
85
+
86
+ ### Authenticate
87
+
88
+ ```bash
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.
96
+ ```
97
+
98
+ ### List models
99
+
100
+ ```bash
101
+ $ uvx git-copilot-commit models --help
102
+ Usage: git-copilot-commit models [OPTIONS]
103
+
104
+ List models available for chat in a Rich table.
105
+
106
+ Options:
107
+ --help Show this message and exit.
108
+ ```
109
+
110
+ ### Configure
111
+
112
+ ```bash
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.
122
+ ```
123
+
124
+ ## Examples
125
+
126
+ Commit all changes:
127
+
128
+ ```bash
129
+ git-copilot-commit commit --all
130
+ ```
131
+
132
+ Verbose output:
133
+
134
+ ```bash
135
+ git-copilot-commit commit --verbose
136
+ ```
137
+
138
+ Use a specific model:
139
+
140
+ ```bash
141
+ git-copilot-commit commit --model claude-3.5-sonnet
142
+ ```
143
+
144
+ Set and use a default model:
145
+
146
+ ```bash
147
+ git-copilot-commit config --set-default-model gpt-4o
148
+ git-copilot-commit commit
149
+ git-copilot-commit commit --model claude-3.5-sonnet
150
+ ```
151
+
152
+ ## Commit Message Format
153
+
154
+ Follows [Conventional Commits](https://www.conventionalcommits.org/):
155
+
156
+ ```
157
+ <type>[optional scope]: <description>
158
+ ```
159
+
160
+ **Types:**
161
+
162
+ - `feat`: New feature
163
+ - `fix`: Bug fix
164
+ - `docs`: Documentation
165
+ - `style`: Formatting only
166
+ - `refactor`: Code restructure
167
+ - `perf`: Performance
168
+ - `test`: Tests
169
+ - `chore`: Maintenance
170
+ - `revert`: Revert changes
171
+
172
+ **Examples:**
173
+
174
+ - `feat(auth): add JWT authentication`
175
+ - `fix(db): retry connection on failure`
176
+ - `docs(readme): update install steps`
177
+ - `refactor(utils): simplify date parsing`
178
+
179
+ ## Git Configuration
180
+
181
+ Add a git alias by adding the following to your `~/.gitconfig`:
182
+
183
+ ```ini
184
+ [alias]
185
+ ai-commit = "!f() { git-copilot-commit commit $@; }; f"
186
+ ```
187
+
188
+ Now you can run:
189
+
190
+ ```bash
191
+ git ai-commit
192
+ git ai-commit --model claude-3.5-sonnet
193
+ git ai-commit --all --verbose
194
+ ```
195
+
196
+ Show more context in diffs:
197
+
198
+ ```bash
199
+ git config --global diff.context 3
200
+ ```
@@ -0,0 +1,187 @@
1
+ # `git-copilot-commit`
2
+
3
+ AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot.
4
+
5
+ ![](https://github.com/user-attachments/assets/6a6d70a6-6060-44e6-8cf4-a6532e9e9142)
6
+
7
+ ## Features
8
+
9
+ - Generates commit messages based on your staged changes
10
+ - Supports multiple AI models: GPT-4, Claude, Gemini, and more
11
+ - Allows editing of generated messages before committing
12
+ - Follows the [Conventional Commits](https://www.conventionalcommits.org/) standard
13
+
14
+ ## Installation
15
+
16
+ Install with [`uv`] (recommended):
17
+
18
+ ```bash
19
+ uv tool install git-copilot-commit
20
+ ```
21
+
22
+ Or with `pipx`:
23
+
24
+ ```bash
25
+ pipx install git-copilot-commit
26
+ ```
27
+
28
+ Or run directly with [`uv`]:
29
+
30
+ ```bash
31
+ uvx git-copilot-commit --help
32
+ ```
33
+
34
+ [`uv`]: https://github.com/astral-sh/uv
35
+
36
+ ## Prerequisites
37
+
38
+ - Active GitHub Copilot subscription
39
+
40
+ ## Quick Start
41
+
42
+ 1. Authenticate with GitHub Copilot:
43
+
44
+ ```bash
45
+ git-copilot-commit authenticate
46
+ ```
47
+
48
+ 2. Make changes in your repository.
49
+
50
+ 3. Generate and commit:
51
+
52
+ ```bash
53
+ git-copilot-commit commit
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ ### Commit changes
59
+
60
+ ```bash
61
+ $ uvx git-copilot-commit commit --help
62
+ Usage: git-copilot-commit commit [OPTIONS]
63
+
64
+ Automatically commit changes in the current git repository.
65
+
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
+ ```
72
+
73
+ ### Authenticate
74
+
75
+ ```bash
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.
83
+ ```
84
+
85
+ ### List models
86
+
87
+ ```bash
88
+ $ uvx git-copilot-commit models --help
89
+ Usage: git-copilot-commit models [OPTIONS]
90
+
91
+ List models available for chat in a Rich table.
92
+
93
+ Options:
94
+ --help Show this message and exit.
95
+ ```
96
+
97
+ ### Configure
98
+
99
+ ```bash
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.
109
+ ```
110
+
111
+ ## Examples
112
+
113
+ Commit all changes:
114
+
115
+ ```bash
116
+ git-copilot-commit commit --all
117
+ ```
118
+
119
+ Verbose output:
120
+
121
+ ```bash
122
+ git-copilot-commit commit --verbose
123
+ ```
124
+
125
+ Use a specific model:
126
+
127
+ ```bash
128
+ git-copilot-commit commit --model claude-3.5-sonnet
129
+ ```
130
+
131
+ Set and use a default model:
132
+
133
+ ```bash
134
+ git-copilot-commit config --set-default-model gpt-4o
135
+ git-copilot-commit commit
136
+ git-copilot-commit commit --model claude-3.5-sonnet
137
+ ```
138
+
139
+ ## Commit Message Format
140
+
141
+ Follows [Conventional Commits](https://www.conventionalcommits.org/):
142
+
143
+ ```
144
+ <type>[optional scope]: <description>
145
+ ```
146
+
147
+ **Types:**
148
+
149
+ - `feat`: New feature
150
+ - `fix`: Bug fix
151
+ - `docs`: Documentation
152
+ - `style`: Formatting only
153
+ - `refactor`: Code restructure
154
+ - `perf`: Performance
155
+ - `test`: Tests
156
+ - `chore`: Maintenance
157
+ - `revert`: Revert changes
158
+
159
+ **Examples:**
160
+
161
+ - `feat(auth): add JWT authentication`
162
+ - `fix(db): retry connection on failure`
163
+ - `docs(readme): update install steps`
164
+ - `refactor(utils): simplify date parsing`
165
+
166
+ ## Git Configuration
167
+
168
+ Add a git alias by adding the following to your `~/.gitconfig`:
169
+
170
+ ```ini
171
+ [alias]
172
+ ai-commit = "!f() { git-copilot-commit commit $@; }; f"
173
+ ```
174
+
175
+ Now you can run:
176
+
177
+ ```bash
178
+ git ai-commit
179
+ git ai-commit --model claude-3.5-sonnet
180
+ git ai-commit --all --verbose
181
+ ```
182
+
183
+ Show more context in diffs:
184
+
185
+ ```bash
186
+ git config --global diff.context 3
187
+ ```
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "git-copilot-commit"
3
- version = "0.1.7"
3
+ version = "0.1.9"
4
4
  description = "Automatically generate and commit changes using copilot"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -11,7 +11,7 @@ dependencies = [
11
11
  "pycopilot>=0.1.6",
12
12
  "rich>=14.0.0",
13
13
  "typer>=0.16.0",
14
- "xdg-base-dirs>=6.0.2",
14
+ "platformdirs>=4.0.0",
15
15
  ]
16
16
 
17
17
  [project.scripts]
@@ -1,28 +1,30 @@
1
1
  """
2
- Settings management using XDG Base Directory specification.
2
+ Settings management using platformdirs for cross-platform directory paths.
3
3
  """
4
4
 
5
5
  import json
6
6
  from typing import Any
7
7
 
8
- from xdg_base_dirs import (
9
- xdg_cache_home,
10
- xdg_config_home,
11
- xdg_data_home,
12
- xdg_state_home,
8
+ from platformdirs import (
9
+ user_cache_dir,
10
+ user_config_dir,
11
+ user_data_dir,
12
+ user_state_dir,
13
13
  )
14
14
 
15
15
 
16
16
  class Settings:
17
- """Manages application settings using XDG Base Directory specification."""
17
+ """Manages application settings using platformdirs for cross-platform directory paths."""
18
18
 
19
19
  APP_NAME = "git-copilot-commit"
20
20
 
21
21
  def __init__(self):
22
- self.config_dir = xdg_config_home() / self.APP_NAME
23
- self.data_dir = xdg_data_home() / self.APP_NAME
24
- self.cache_dir = xdg_cache_home() / self.APP_NAME
25
- self.state_dir = xdg_state_home() / self.APP_NAME
22
+ from pathlib import Path
23
+
24
+ self.config_dir = Path(user_config_dir(f"com.kdheepak.{self.APP_NAME}"))
25
+ self.data_dir = Path(user_data_dir(f"com.kdheepak.{self.APP_NAME}"))
26
+ self.cache_dir = Path(user_cache_dir(f"com.kdheepak.{self.APP_NAME}"))
27
+ self.state_dir = Path(user_state_dir(f"com.kdheepak.{self.APP_NAME}"))
26
28
 
27
29
  self.config_file = self.config_dir / "config.json"
28
30
 
@@ -57,21 +57,21 @@ wheels = [
57
57
 
58
58
  [[package]]
59
59
  name = "git-copilot-commit"
60
- version = "0.1.7"
60
+ version = "0.1.9"
61
61
  source = { editable = "." }
62
62
  dependencies = [
63
+ { name = "platformdirs" },
63
64
  { name = "pycopilot" },
64
65
  { name = "rich" },
65
66
  { name = "typer" },
66
- { name = "xdg-base-dirs" },
67
67
  ]
68
68
 
69
69
  [package.metadata]
70
70
  requires-dist = [
71
+ { name = "platformdirs", specifier = ">=4.0.0" },
71
72
  { name = "pycopilot", specifier = ">=0.1.6" },
72
73
  { name = "rich", specifier = ">=14.0.0" },
73
74
  { name = "typer", specifier = ">=0.16.0" },
74
- { name = "xdg-base-dirs", specifier = ">=6.0.2" },
75
75
  ]
76
76
 
77
77
  [[package]]
@@ -333,12 +333,3 @@ sdist = { url = "https://files.pythonhosted.org/packages/6c/63/53559446a878410fc
333
333
  wheels = [
334
334
  { url = "https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859", size = 34166, upload-time = "2024-01-06T02:10:55.763Z" },
335
335
  ]
336
-
337
- [[package]]
338
- name = "xdg-base-dirs"
339
- version = "6.0.2"
340
- source = { registry = "https://pypi.org/simple" }
341
- sdist = { url = "https://files.pythonhosted.org/packages/bf/d0/bbe05a15347538aaf9fa5b51ac3b97075dfb834931fcb77d81fbdb69e8f6/xdg_base_dirs-6.0.2.tar.gz", hash = "sha256:950504e14d27cf3c9cb37744680a43bf0ac42efefc4ef4acf98dc736cab2bced", size = 4085, upload-time = "2024-10-19T14:35:08.114Z" }
342
- wheels = [
343
- { url = "https://files.pythonhosted.org/packages/fc/03/030b47fd46b60fc87af548e57ff59c2ca84b2a1dadbe721bb0ce33896b2e/xdg_base_dirs-6.0.2-py3-none-any.whl", hash = "sha256:3c01d1b758ed4ace150ac960ac0bd13ce4542b9e2cdf01312dcda5012cfebabe", size = 4747, upload-time = "2024-10-19T14:35:05.931Z" },
344
- ]
@@ -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
@@ -1,201 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: git-copilot-commit
3
- Version: 0.1.7
4
- Summary: Automatically generate and commit changes using copilot
5
- Author-email: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com>
6
- License-File: LICENSE
7
- Requires-Python: >=3.12
8
- Requires-Dist: pycopilot>=0.1.6
9
- Requires-Dist: rich>=14.0.0
10
- Requires-Dist: typer>=0.16.0
11
- Requires-Dist: xdg-base-dirs>=6.0.2
12
- Description-Content-Type: text/markdown
13
-
14
- # git-copilot-commit
15
-
16
- 🤖 AI-powered Git commit assistant that automatically generates conventional commit messages using
17
- GitHub Copilot.
18
-
19
- ## Features
20
-
21
- - **AI-Generated Commit Messages**: Uses GitHub Copilot to analyze your staged changes and generate
22
- conventional commit messages
23
- - **Multiple AI Models**: Choose from GPT-4, Claude, Gemini, and other available models
24
- - **Configurable Defaults**: Set a default model to use across all commits
25
- - **Message Editing**: Edit generated messages using your git-configured editor or commit directly
26
- - **Conventional Commits**: Follows the [Conventional Commits](https://www.conventionalcommits.org/)
27
- specification
28
- - **Rich Output**: Beautiful terminal output with syntax highlighting and tables
29
-
30
- ## Installation
31
-
32
- Install using uv (recommended):
33
-
34
- ```bash
35
- uv tool install git-copilot-commit
36
- ```
37
-
38
- Or with pip:
39
-
40
- ```bash
41
- pipx install git-copilot-commit
42
- ```
43
-
44
- Or without installing:
45
-
46
- ```bash
47
- uvx git-copilot-commit --help
48
- ```
49
-
50
- ## Prerequisites
51
-
52
- **GitHub Copilot Access**: You need an active GitHub Copilot subscription
53
-
54
- ## Quick Start
55
-
56
- 1. **Authenticate with GitHub Copilot**:
57
-
58
- ```bash
59
- git-copilot-commit authenticate
60
- ```
61
-
62
- 2. **Make some changes** in your git repository
63
-
64
- 3. **Generate and commit**:
65
-
66
- ```bash
67
- git-copilot-commit commit
68
- ```
69
-
70
- ## Usage
71
-
72
- ### `commit`
73
-
74
- Automatically commit changes in the current git repository:
75
-
76
- ```bash
77
- git-copilot-commit commit
78
- ```
79
-
80
- **Options:**
81
-
82
- - `--all, -a`: Stage all files before committing
83
- - `--verbose, -v`: Show verbose output with file details
84
- - `--model, -m`: Specify which AI model to use for generating the commit message
85
-
86
- 1. The tool analyzes your changes
87
- 2. Prompts you to stage files (if needed)
88
- 3. Generates an AI-powered commit message
89
- 4. Offers three choices:
90
- - `(c)ommit`: Commit with the generated message
91
- - `(e)dit`: Edit the message in your git-configured editor
92
- - `(q)uit`: Cancel the commit
93
-
94
- ### `authenticate`
95
-
96
- Set up authentication with GitHub Copilot:
97
-
98
- ```bash
99
- git-copilot-commit authenticate
100
- ```
101
-
102
- ### `models`
103
-
104
- List available AI models:
105
-
106
- ```bash
107
- git-copilot-commit models
108
- ```
109
-
110
- ### `config`
111
-
112
- Manage application configuration:
113
-
114
- ```bash
115
- # Show current configuration
116
- git-copilot-commit config --show
117
-
118
- # Set a default model for all commits
119
- git-copilot-commit config --set-default-model gpt-4o
120
- ```
121
-
122
- ## Examples
123
-
124
- **Commit all changes with staging prompts:**
125
-
126
- ```bash
127
- git-copilot-commit commit --all
128
- ```
129
-
130
- **Commit with verbose output:**
131
-
132
- ```bash
133
- git-copilot-commit commit --verbose
134
- ```
135
-
136
- **Use a specific AI model:**
137
-
138
- ```bash
139
- git-copilot-commit commit --model claude-3.5-sonnet
140
- ```
141
-
142
- **Set up a default model and use it:**
143
-
144
- ```bash
145
- # Set default model once
146
- git-copilot-commit config --set-default-model gpt-4o
147
-
148
- # Now all commits will use gpt-4o by default
149
- git-copilot-commit commit
150
-
151
- # Override with a different model when needed
152
- git-copilot-commit commit --model claude-3.5-sonnet
153
- ```
154
-
155
- ## Generated Commit Message Format
156
-
157
- The tool follows the [Conventional Commits](https://www.conventionalcommits.org/) specification:
158
-
159
- ```
160
- <type>[optional scope]: <description>
161
- ```
162
-
163
- **Supported Types:**
164
-
165
- - `feat`: A new feature
166
- - `fix`: A bug fix
167
- - `docs`: Documentation changes
168
- - `style`: Code formatting (no logic changes)
169
- - `refactor`: Code restructuring (no behavior changes)
170
- - `perf`: Performance improvements
171
- - `test`: Adding or updating tests
172
- - `chore`: Maintenance tasks (tooling, dependencies, etc.)
173
- - `revert`: Reverting previous changes
174
-
175
- **Example Messages:**
176
-
177
- - `feat(auth): add user authentication with JWT`
178
- - `fix(database): handle connection retries properly`
179
- - `docs(readme): update installation instructions`
180
- - `refactor(utils): simplify date parsing logic`
181
-
182
- ## Git Configuration
183
-
184
- For the best experience with git-copilot-commit, consider adding this alias for the commit command:
185
-
186
- ```bash
187
- # Add a git alias for quick access
188
- git config --global alias.ai-commit "!git-copilot-commit commit"
189
-
190
- # Now you can use:
191
- git ai-commit
192
- git ai-commit --model claude-3.5-sonnet
193
- git ai-commit --all --verbose
194
- ```
195
-
196
- You can also configure git to show more context in diffs, which can help when reviewing changes:
197
-
198
- ```bash
199
- # Show more context in diffs
200
- git config --global diff.context 3
201
- ```
@@ -1,188 +0,0 @@
1
- # git-copilot-commit
2
-
3
- 🤖 AI-powered Git commit assistant that automatically generates conventional commit messages using
4
- GitHub Copilot.
5
-
6
- ## Features
7
-
8
- - **AI-Generated Commit Messages**: Uses GitHub Copilot to analyze your staged changes and generate
9
- conventional commit messages
10
- - **Multiple AI Models**: Choose from GPT-4, Claude, Gemini, and other available models
11
- - **Configurable Defaults**: Set a default model to use across all commits
12
- - **Message Editing**: Edit generated messages using your git-configured editor or commit directly
13
- - **Conventional Commits**: Follows the [Conventional Commits](https://www.conventionalcommits.org/)
14
- specification
15
- - **Rich Output**: Beautiful terminal output with syntax highlighting and tables
16
-
17
- ## Installation
18
-
19
- Install using uv (recommended):
20
-
21
- ```bash
22
- uv tool install git-copilot-commit
23
- ```
24
-
25
- Or with pip:
26
-
27
- ```bash
28
- pipx install git-copilot-commit
29
- ```
30
-
31
- Or without installing:
32
-
33
- ```bash
34
- uvx git-copilot-commit --help
35
- ```
36
-
37
- ## Prerequisites
38
-
39
- **GitHub Copilot Access**: You need an active GitHub Copilot subscription
40
-
41
- ## Quick Start
42
-
43
- 1. **Authenticate with GitHub Copilot**:
44
-
45
- ```bash
46
- git-copilot-commit authenticate
47
- ```
48
-
49
- 2. **Make some changes** in your git repository
50
-
51
- 3. **Generate and commit**:
52
-
53
- ```bash
54
- git-copilot-commit commit
55
- ```
56
-
57
- ## Usage
58
-
59
- ### `commit`
60
-
61
- Automatically commit changes in the current git repository:
62
-
63
- ```bash
64
- git-copilot-commit commit
65
- ```
66
-
67
- **Options:**
68
-
69
- - `--all, -a`: Stage all files before committing
70
- - `--verbose, -v`: Show verbose output with file details
71
- - `--model, -m`: Specify which AI model to use for generating the commit message
72
-
73
- 1. The tool analyzes your changes
74
- 2. Prompts you to stage files (if needed)
75
- 3. Generates an AI-powered commit message
76
- 4. Offers three choices:
77
- - `(c)ommit`: Commit with the generated message
78
- - `(e)dit`: Edit the message in your git-configured editor
79
- - `(q)uit`: Cancel the commit
80
-
81
- ### `authenticate`
82
-
83
- Set up authentication with GitHub Copilot:
84
-
85
- ```bash
86
- git-copilot-commit authenticate
87
- ```
88
-
89
- ### `models`
90
-
91
- List available AI models:
92
-
93
- ```bash
94
- git-copilot-commit models
95
- ```
96
-
97
- ### `config`
98
-
99
- Manage application configuration:
100
-
101
- ```bash
102
- # Show current configuration
103
- git-copilot-commit config --show
104
-
105
- # Set a default model for all commits
106
- git-copilot-commit config --set-default-model gpt-4o
107
- ```
108
-
109
- ## Examples
110
-
111
- **Commit all changes with staging prompts:**
112
-
113
- ```bash
114
- git-copilot-commit commit --all
115
- ```
116
-
117
- **Commit with verbose output:**
118
-
119
- ```bash
120
- git-copilot-commit commit --verbose
121
- ```
122
-
123
- **Use a specific AI model:**
124
-
125
- ```bash
126
- git-copilot-commit commit --model claude-3.5-sonnet
127
- ```
128
-
129
- **Set up a default model and use it:**
130
-
131
- ```bash
132
- # Set default model once
133
- git-copilot-commit config --set-default-model gpt-4o
134
-
135
- # Now all commits will use gpt-4o by default
136
- git-copilot-commit commit
137
-
138
- # Override with a different model when needed
139
- git-copilot-commit commit --model claude-3.5-sonnet
140
- ```
141
-
142
- ## Generated Commit Message Format
143
-
144
- The tool follows the [Conventional Commits](https://www.conventionalcommits.org/) specification:
145
-
146
- ```
147
- <type>[optional scope]: <description>
148
- ```
149
-
150
- **Supported Types:**
151
-
152
- - `feat`: A new feature
153
- - `fix`: A bug fix
154
- - `docs`: Documentation changes
155
- - `style`: Code formatting (no logic changes)
156
- - `refactor`: Code restructuring (no behavior changes)
157
- - `perf`: Performance improvements
158
- - `test`: Adding or updating tests
159
- - `chore`: Maintenance tasks (tooling, dependencies, etc.)
160
- - `revert`: Reverting previous changes
161
-
162
- **Example Messages:**
163
-
164
- - `feat(auth): add user authentication with JWT`
165
- - `fix(database): handle connection retries properly`
166
- - `docs(readme): update installation instructions`
167
- - `refactor(utils): simplify date parsing logic`
168
-
169
- ## Git Configuration
170
-
171
- For the best experience with git-copilot-commit, consider adding this alias for the commit command:
172
-
173
- ```bash
174
- # Add a git alias for quick access
175
- git config --global alias.ai-commit "!git-copilot-commit commit"
176
-
177
- # Now you can use:
178
- git ai-commit
179
- git ai-commit --model claude-3.5-sonnet
180
- git ai-commit --all --verbose
181
- ```
182
-
183
- You can also configure git to show more context in diffs, which can help when reviewing changes:
184
-
185
- ```bash
186
- # Show more context in diffs
187
- git config --global diff.context 3
188
- ```