You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(readme): add table of contents and configuration details
- Add detailed table of contents with section links
- Expand command descriptions with keyboard shortcuts
- Add detailed configuration section with default values and options
- Restructure error handling section with status codes
- Improve formatting and readability throughout document
@@ -4,6 +4,47 @@ Diff Commit is a VSCode extension that helps you generate commit messages follow
4
4
5
5
The generated commit messages are compatible with [googleapis/release-please](https://github.com/googleapis/release-please) and other tools that use conventional commits.
- Generate commit messages based on the diff of staged changes using Anthropic's AI models like Claude 3.5 Sonnet
@@ -27,49 +68,108 @@ Install the extension directly from the [Visual Studio Code Marketplace](https:/
27
68
28
69
## Typical Workflow
29
70
30
-
1. Stage your changes in Source Control
31
-
2. Open the Command Palette (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>)
32
-
3. Run the command: "DiffCommit: Generate Commit Message" (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>K</kbd> then <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>G</kbd>)
33
-
4. Enter your Anthropic API key when prompted (_first time only_)
34
-
5. Review the generated commit message in the Source Control message input
35
-
6. Edit the commit message if necessary
36
-
7. Click 'Commit' to commit the changes with the generated message
71
+
1. Stage the changes that you wish to commit as normal
72
+
2. Run the command: "DiffCommit: Generate Commit Message" (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>K</kbd> then <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>G</kbd>)
73
+
3. Confirm or edit the generated commit message in the Source Control message input
74
+
4. Click 'Commit' to commit the changes with the generated message
37
75
38
76
## Commands
39
77
40
-
Access DiffCommit commands from the Command Palette (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) or using the keyboard shortcuts:
78
+
DiffCommit commands can be accessed from the Command Palette (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) or using the default keyboard shortcuts.
79
+
80
+
### `DiffCommit: Generate Commit Message`
81
+
82
+
This will generate a commit message for staged changes and enter it in the Source Control message input box. You can preview and edit the generated message before committing.
- macOS: <kbd>Cmd</kbd> + <kbd>K</kbd> then <kbd>Cmd</kbd> + <kbd>G</kbd>
87
+
- Windows/Linux: <kbd>Ctrl</kbd> + <kbd>K</kbd> then <kbd>Ctrl</kbd> + <kbd>G</kbd>
88
+
89
+
### `DiffCommit: Preview Commit Message`
90
+
91
+
This will generate a commit message for staged changes and open it in a new editor window. You can preview and edit the generated message before committing.
- macOS: <kbd>Cmd</kbd> + <kbd>K</kbd> then <kbd>Cmd</kbd> + <kbd>P</kbd>
96
+
- Windows/Linux: <kbd>Ctrl</kbd> + <kbd>K</kbd> then <kbd>Ctrl</kbd> + <kbd>P</kbd>
97
+
98
+
### `DiffCommit: Update API Key`
99
+
100
+
This will update the Anthropic API key used for API access. Enter your API key when prompted and press <kbd>Enter</kbd> to confirm or <kbd>Esc</kbd> to cancel.
41
101
42
-
-`DiffCommit: Generate Commit Message`: Generate a commit message for staged changes and enter it in the Source Control message input
43
-
- macOS: <kbd>Cmd</kbd> + <kbd>K</kbd> then <kbd>Cmd</kbd> + <kbd>G</kbd>
44
-
- Windows/Linux: <kbd>Ctrl</kbd> + <kbd>K</kbd> then <kbd>Ctrl</kbd> + <kbd>G</kbd>
45
-
-`DiffCommit: Preview Commit Message`: Generate a commit message for staged changes and preview it in an editor window
46
-
- macOS: <kbd>Cmd</kbd> + <kbd>K</kbd> then <kbd>Cmd</kbd> + <kbd>P</kbd>
47
-
- Windows/Linux: <kbd>Ctrl</kbd> + <kbd>K</kbd> then <kbd>Ctrl</kbd> + <kbd>P</kbd>
48
-
-`DiffCommit: Update API Key`: Update the Anthropic API key used for API access
49
-
-`DiffCommit: Delete API Key`: Remove the stored Anthropic API key
102
+
### `DiffCommit: Delete API Key`
103
+
104
+
This will delete the stored API key from your system and prevent DiffCommit from accessing the API in the future.
50
105
51
106
## Configuration
52
107
53
-
This extension provides the following settings:
54
-
55
-
-`diffCommit.allowedTypes`: List of allowed commit types. If provided, this replaces the default options.
-`diffCommit.customInstructions`: Add additional custom instructions to the commit generation prompt. Useful for providing context or specific requirements like 'Use Australian English spelling'.
59
-
- Default: ""
60
-
-`diffCommit.model`: The Anthropic AI model to use for generating commit messages.
-`diffCommit.maxTokens`: Maximum number of tokens to generate in the response. Higher values allow for longer commit messages but use more API tokens.
64
-
- Default: 1024
65
-
- Range: 1 - 8192
66
-
-`diffCommit.temperature`: Controls randomness in the response. Lower values (like 0.4) produce more focused and consistent commit messages, while higher values introduce more variety.
67
-
- Default: 0.4
68
-
- Range: 0 - 1
108
+
DiffCommit provides the following settings to customise its behavior.
109
+
110
+
### `diffCommit.allowedTypes`
111
+
112
+
A list of allowed commit types. If provided, this replaces the default options.
**string[]** - A list (array) of any string you want to be able to use as a commit type.
121
+
122
+
### `diffCommit.customInstructions`
123
+
124
+
Add additional custom instructions to the commit generation prompt. Useful for providing context or specific requirements like 'Use Australian English spelling'.
125
+
126
+
#### customInstructions Default Value
127
+
128
+
""
129
+
130
+
#### customInstructions Options
131
+
132
+
**string** - Free formatted string that you want to included as custom instructions for the AI prompt.
133
+
134
+
### `diffCommit.model`
135
+
136
+
The Anthropic AI model to use for generating commit messages.
Maximum number of tokens to generate in the response. Higher values allow for longer commit messages but use more API tokens.
149
+
150
+
#### maxTokens Default Value
151
+
152
+
1024
153
+
154
+
#### maxTokens Range
155
+
156
+
**number** - 1 to 8192
157
+
158
+
### `diffCommit.temperature`
159
+
160
+
Controls randomness in the response. Lower values (like 0.4) produce more focused and consistent commit messages, while higher values introduce more variety.
161
+
162
+
#### temperature Default Value
163
+
164
+
0.4
165
+
166
+
#### temperature Range
167
+
168
+
**number** - 0 to 1
69
169
70
170
## Error Handling
71
171
72
-
Diff Commit includes comprehensive error handling to provide clear feedback and assist in troubleshooting. Here are the common error scenarios you might encounter:
172
+
Diff Commit accommodates error handling to provide clear feedback and assist in troubleshooting. The following are the common warning or error scenarios you might encounter.
73
173
74
174
### Git Related
75
175
@@ -86,19 +186,19 @@ Diff Commit includes comprehensive error handling to provide clear feedback and
86
186
87
187
### Anthropic API Errors
88
188
89
-
- Bad Request (400): Review your prompt and try again
90
-
-Unauthorized (401): Invalid API key, please update and try again
91
-
-Forbidden (403): Permission denied, review your API key
92
-
- Rate Limited (429): Too many requests, try again later
93
-
- Server Error (500): Anthropic API server error
189
+
-**400** - Bad Request: Review your prompt and try again
190
+
-**401** - Unauthorized: Invalid API key, update your API key and try again
191
+
-**403** - Forbidden: Permission denied, update your API key and try again
192
+
-**429** - Rate Limited: Too many requests, try again later
193
+
-**500** - Server Error: Anthropic API server error
94
194
95
195
### Other Errors
96
196
97
197
- Failed to write commit message to Source Control
98
198
- Failed to open commit message preview
99
199
- No commit message was generated by the API
100
200
101
-
If you encounter any of these errors, the extension will display a message with more details. For persistent issues, please check your setup or raise an issue on [GitHub](https://github.com/tsdevau/diff-commit/issues).
201
+
If you encounter any of these errors, the extension will display a message with more details. For persistent issues, please check your setup and if appropriate, raise an issue on [GitHub](https://github.com/tsdevau/diff-commit/issues).
0 commit comments