Skip to content

Commit 553d886

Browse files
committed
docs(readme): update documentation with screenshots and tables
Added screenshots and demo GIFs to illustrate key features. Reorganised command documentation into tables for better readability. Removed redundant keyboard shortcut sections and consolidated information. Added error handling table with status codes. - Add screenshots and demo GIFs for visual documentation - Convert keyboard shortcuts to formatted tables - Add error handling reference table with status codes - Update temperature default value and description - Remove duplicate keyboard shortcut sections - Improve configuration section with table formatting
1 parent bcc4240 commit 553d886

File tree

1 file changed

+60
-55
lines changed

1 file changed

+60
-55
lines changed

README.md

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Diff Commit is a VSCode extension that helps you generate commit messages follow
44

55
The generated commit messages are compatible with [googleapis/release-please](https://github.com/googleapis/release-please) and other tools that use conventional commits.
66

7+
![Diff Commit Screenshot](screenshots/diff-commit-screenshot.avif)
8+
79
## Table of Contents
810

911
- [Diff Commit](#diff-commit)
@@ -14,27 +16,15 @@ The generated commit messages are compatible with [googleapis/release-please](ht
1416
- [Typical Workflow](#typical-workflow)
1517
- [Commands](#commands)
1618
- [`DiffCommit: Generate Commit Message`](#diffcommit-generate-commit-message)
17-
- [DiffCommit: Generate Commit Message Default Keyboard Shortcuts](#diffcommit-generate-commit-message-default-keyboard-shortcuts)
1819
- [`DiffCommit: Preview Commit Message`](#diffcommit-preview-commit-message)
19-
- [DiffCommit: Preview Commit Message Default Keyboard Shortcuts](#diffcommit-preview-commit-message-default-keyboard-shortcuts)
2020
- [`DiffCommit: Update API Key`](#diffcommit-update-api-key)
2121
- [`DiffCommit: Delete API Key`](#diffcommit-delete-api-key)
2222
- [Configuration](#configuration)
2323
- [`diffCommit.allowedTypes`](#diffcommitallowedtypes)
24-
- [allowedTypes Default Value](#allowedtypes-default-value)
25-
- [allowedTypes Options](#allowedtypes-options)
2624
- [`diffCommit.customInstructions`](#diffcommitcustominstructions)
27-
- [customInstructions Default Value](#custominstructions-default-value)
28-
- [customInstructions Options](#custominstructions-options)
2925
- [`diffCommit.model`](#diffcommitmodel)
30-
- [model Default Value](#model-default-value)
31-
- [model Options](#model-options)
3226
- [`diffCommit.maxTokens`](#diffcommitmaxtokens)
33-
- [maxTokens Default Value](#maxtokens-default-value)
34-
- [maxTokens Range](#maxtokens-range)
3527
- [`diffCommit.temperature`](#diffcommittemperature)
36-
- [temperature Default Value](#temperature-default-value)
37-
- [temperature Range](#temperature-range)
3828
- [Error Handling](#error-handling)
3929
- [Git Related](#git-related)
4030
- [API Key Related](#api-key-related)
@@ -69,7 +59,7 @@ Install the extension directly from the [Visual Studio Code Marketplace](https:/
6959
## Typical Workflow
7060

7161
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>)
62+
2. Run the command: "DiffCommit: Generate Commit Message" (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>G</kbd>)
7363
3. Confirm or edit the generated commit message in the Source Control message input
7464
4. Click 'Commit' to commit the changes with the generated message
7565

@@ -81,28 +71,41 @@ DiffCommit commands can be accessed from the Command Palette (<kbd>Cmd</kbd>/<kb
8171

8272
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.
8373

84-
#### DiffCommit: Generate Commit Message Default Keyboard Shortcuts
74+
| **Platform** | **Keyboard Shortcut** |
75+
| :----------- | :-------------------------------------------------------------- |
76+
| macOS | <kbd>Cmd</kbd> + <kbd>K</kbd> → <kbd>Cmd</kbd> + <kbd>G</kbd> |
77+
| Linux | <kbd>Ctrl</kbd> + <kbd>K</kbd> → <kbd>Ctrl</kbd> + <kbd>G</kbd> |
78+
| Windows | <kbd>Ctrl</kbd> + <kbd>K</kbd> → <kbd>Ctrl</kbd> + <kbd>G</kbd> |
8579

86-
- 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>
80+
![Demo video of Diff Commit: Generate Commit Message](screenshots/diff-commit-cmd-generate.gif)
8881

8982
### `DiffCommit: Preview Commit Message`
9083

9184
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.
9285

93-
#### DiffCommit: Preview Commit Message Default Keyboard Shortcuts
86+
| **Platform** | **Keyboard Shortcut** |
87+
| :----------- | :-------------------------------------------------------------- |
88+
| macOS | <kbd>Cmd</kbd> + <kbd>K</kbd> → <kbd>Cmd</kbd> + <kbd>P</kbd> |
89+
| Linux | <kbd>Ctrl</kbd> + <kbd>K</kbd> → <kbd>Ctrl</kbd> + <kbd>P</kbd> |
90+
| Windows | <kbd>Ctrl</kbd> + <kbd>K</kbd> → <kbd>Ctrl</kbd> + <kbd>P</kbd> |
9491

95-
- 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>
92+
![!Demo video of Diff Commit: Preview Commit Message](screenshots/diff-commit-cmd-preview.gif)
9793

9894
### `DiffCommit: Update API Key`
9995

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.
96+
This will update the Anthropic API key used for API access.
97+
98+
1. Enter your API key when prompted
99+
2. Press <kbd>Enter</kbd> to confirm or <kbd>Esc</kbd> to cancel
100+
101+
![Demo video of Diff Commit: Update API Key](screenshots/diff-commit-cmd-update.gif)
101102

102103
### `DiffCommit: Delete API Key`
103104

104105
This will delete the stored API key from your system and prevent DiffCommit from accessing the API in the future.
105106

107+
![Demo video of Diff Commit: Delete API Key](screenshots/diff-commit-cmd-delete.gif)
108+
106109
## Configuration
107110

108111
DiffCommit provides the following settings to customise its behavior.
@@ -111,66 +114,68 @@ DiffCommit provides the following settings to customise its behavior.
111114

112115
A list of allowed commit types. If provided, this replaces the default options.
113116

114-
#### allowedTypes Default Value
115-
116-
[ "feat", "fix", "refactor", "chore", "docs", "style", "test", "perf", "ci" ]
117-
118-
#### allowedTypes Options
119-
120-
**string[]** - A list (array) of any string you want to be able to use as a commit type.
117+
| **Type** | **Description** | **Default Value** |
118+
| :------------- | :---------------------------------------------------------------- | :---------------------------------------------------------------------------- |
119+
| Array\<string> | A list (array) of any string/s you want available as commit types | [ "feat", "fix", "refactor", "chore", "docs", "style", "test", "perf", "ci" ] |
121120

122121
### `diffCommit.customInstructions`
123122

124123
Add additional custom instructions to the commit generation prompt. Useful for providing context or specific requirements like 'Use Australian English spelling'.
125124

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.
125+
| **Type** | **Description** | **Default Value** |
126+
| :------- | :------------------------------------------------------------------------------------ | :---------------: |
127+
| string | Free formatted string that you want included as custom instructions for the AI prompt | "" |
133128

134129
### `diffCommit.model`
135130

136131
The Anthropic AI model to use for generating commit messages.
137132

138-
#### model Default Value
139-
140-
"claude-3-5-sonnet-latest"
141-
142-
#### model Options
143-
144-
**enum** - "claude-3-opus-latest" | "claude-3-sonnet-latest" | "claude-3-haiku-20240307"
133+
| **Type** | **Options** | **Default Value** |
134+
| :------- | :-------------------------------------------------------------------------------- | :------------------------- |
135+
| enum | "claude-3-opus-latest" \| "claude-3-5-sonnet-latest" \| "claude-3-haiku-20240307" | "claude-3-5-sonnet-latest" |
145136

146137
### `diffCommit.maxTokens`
147138

148139
Maximum number of tokens to generate in the response. Higher values allow for longer commit messages but use more API tokens.
149140

150-
#### maxTokens Default Value
151-
152-
1024
153-
154-
#### maxTokens Range
155-
156-
**number** - 1 to 8192
141+
| **Type** | **Minimum** | **Maximum** | **Default Value** |
142+
| :------- | :---------: | :---------: | :---------------: |
143+
| number | 1 | 8192 | 1024 |
157144

158145
### `diffCommit.temperature`
159146

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
147+
Controls randomness in the response. Lower values (like 0.3) produce more focused and consistent commit messages, while higher values introduce more variety.
163148

164-
0.4
149+
For concise, focused commit messages, I recommend the default value of 0.3. If you want a little more creativity or room for the AI model to interpret the reason for changes, try a larger value.
165150

166-
#### temperature Range
167-
168-
**number** - 0 to 1
151+
| **Type** | **Minimum** | **Maximum** | **Default Value** |
152+
| :------- | :---------: | :---------: | :---------------: |
153+
| number | 0 | 1 | 0.3 |
169154

170155
## Error Handling
171156

172157
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.
173158

159+
| | **Error** | **Status Code** |
160+
| :----------------------- | :--------------------------------------------------------------- | :-------------: |
161+
| **Git Related** | Git extension not found in VSCode | |
162+
| | No Git repository found in the current workspace | |
163+
| | No workspace folder found | |
164+
| | No staged changes detected | |
165+
| **API Key Related** | API key is missing or not provided | |
166+
| | Invalid API key format (should start with sk-ant-api) | |
167+
| | Failed to access or update secure storage | |
168+
| **Anthropic API Errors** | Bad Request: Review your prompt and try again | 400 |
169+
| | Unauthorized: Invalid API key, update your API key and try again | 401 |
170+
| | Forbidden: Permission denied, update your API key and try again | 403 |
171+
| | Rate Limited: Too many requests, try again later | 429 |
172+
| | Server Error: Anthropic API server error | 500 |
173+
| **Other Errors** | Failed to write commit message to Source Control | |
174+
| | Failed to open commit message preview | |
175+
| | No commit message was generated by the API | |
176+
177+
If you encounter any of these errors, Diff Commit will display a message with more details. For persistent issues, please check your configuration and if appropriate, raise an issue on [GitHub](https://github.com/tsdevau/diff-commit/issues).
178+
174179
### Git Related
175180

176181
- Git extension not found in VSCode

0 commit comments

Comments
 (0)