Skip to content

Commit 9eafd8c

Browse files
committed
feat: enhance configuration options and commit message generation
- Added language option support. - Added more prompt customization. - Simplified commit generation in one single prompt. - Updated dependencies.
1 parent 6d56091 commit 9eafd8c

File tree

9 files changed

+353
-263
lines changed

9 files changed

+353
-263
lines changed

README.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,47 @@ A free alternative to Github Copilot's commit generator that runs on your device
1616
## Requirements
1717

1818
- Install [Ollama][1] on your local machine.
19-
- Install the model to use: `ollama pull [model_name]`, recommended to use `llama3.2`.
19+
- Install the model to use: `ollama pull [model_name]`, recommended to use `llama3.2` or `gemma3`.
2020
- Make sure ollama is running, you can do it by visiting http://127.0.0.1:11434/ in your web browser (The port number might be different for you). If not, only opening the app should be enough, or run in your terminal: `ollama serve`.
2121

2222
## Configuration
2323

2424
- Model: You can select the model from the plugin configuration.
2525

26-
`Llama` - default (Uses llama3.2:latest)
26+
`Llama` - default (Uses llama3.2:latest) (slow)
2727

2828
`Codegemma` (Uses codegemma:latest)
2929

3030
`Codellama` (Uses codellama. Worst result obtained)
3131

3232
`Mistral` (Uses mistral:latest)
3333

34-
`Gemma` (Uses gemma3:latest)
34+
`Gemma` (Uses gemma3:latest) (fast)
3535

3636
`Qwen` (Uses qwen3:latest)
3737

3838
`Custom` - It allows you to write down any other model name from ollama.
3939

40+
- Use Emojis: It allows you to enable or disable the use of emojis in commit messages.
41+
4042
- Use Description: It allows you to enable or disable the use of commit descriptions.
4143

42-
- Use Emojis: It allows you to enable or disable the use of emojis in commit messages.
44+
- Use Lowercase: Enables or disables the use of lowercase at the beginning of commit messages.
45+
46+
- Language: Language for commit messages.
47+
48+
- Prompt Temperature: Custom temperature for generating the commit message. (Higher number = more creative)
49+
50+
- Commit Template: It allows you to write down the commit template you want to use. You should use the following placeholders:
51+
- `{{type}}`: It will be replaced by the type of the commit.
52+
- `{{emoji}}`: It will be replaced by the emoji selected in the configuration.
53+
- `{{message}}`: It will be replaced by the commit message.
54+
55+
Default value: `{{type}} {{emoji}}: {{message}}`
56+
57+
- Custom Model: Allows you to specify any model. The model has to be downloaded and available on your Ollama instance. **Note:** Ignored if `commitollama.model` is not set to "Custom".
58+
59+
- Custom Language: Allows you to specify any language for the commit messages. **Note:** Ignored if `commitollama.language` is not set to "Custom".
4360

4461
- Custom Emojis: Allows you to specify the emojis you want to use in the next template object within the VSCode config.json.
4562

@@ -58,23 +75,13 @@ A free alternative to Github Copilot's commit generator that runs on your device
5875

5976
- Custom Endpoint: Ollama usually uses port 11434. It is the value that will be used if empty.
6077

61-
- Custom Summary Prompt: The prompt that will be used to generate the summary of all git diff.
62-
63-
- Custom Commit Prompt: The prompt that will be used to generate the commit message.
64-
65-
- Custom Summary Temperature: The temperature that will be used to generate the summary of all git diff.
66-
67-
- Custom Commit Temperature: The temperature that will be used to generate the commit message.
78+
- Custom Prompt: The prompt that will be used to generate the commit message instead of the default one. If this field is populated, it will override all the extension prompts and rules.
6879

69-
- Use Lowercase: Enables or disables the use of lowercase at the beginning of commit messages.
80+
- Custom Type Rules: Custom rules for commit message types.
7081

71-
- Commit Template: It allows you to write down the commit template you want to use. You should use the following placeholders:
72-
- `{{type}}`: It will be replaced by the type of the commit.
73-
- `{{emoji}}`: It will be replaced by the emoji selected in the configuration.
74-
- `{{message}}`: It will be replaced by the commit message.
82+
- Custom Commit Message Rules: Custom rules for commit messages.
7583

76-
Default value: `{{type}} {{emoji}}: {{message}}`
77-
84+
- Custom Description Prompt: A custom prompt to generate the commit description.
7885

7986
## Known Issues
8087

package.json

Lines changed: 70 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,10 @@
1111
"engines": {
1212
"vscode": "^1.98.0"
1313
},
14-
"categories": [
15-
"Machine Learning",
16-
"Programming Languages"
17-
],
14+
"categories": ["Machine Learning", "Programming Languages"],
1815
"icon": "icon.jpg",
1916
"license": "MIT",
20-
"keywords": [
21-
"code",
22-
"assistant",
23-
"ai",
24-
"llm",
25-
"commits",
26-
"ollama"
27-
],
17+
"keywords": ["code", "assistant", "ai", "llm", "commits", "ollama"],
2818
"main": "./out/extension.js",
2919
"activationEvents": [],
3020
"contributes": {
@@ -80,68 +70,85 @@
8070
"default": false,
8171
"order": 2
8272
},
83-
"commitollama.commitEmojis": {
84-
"type": "object",
85-
"description": "Map commit types to emojis. Only used if emojis are enabled.",
86-
"default": {
87-
"feat": "",
88-
"fix": "🐛",
89-
"docs": "📝",
90-
"style": "💎",
91-
"refactor": "♻️",
92-
"test": "🧪",
93-
"chore": "📦",
94-
"revert": ""
95-
},
73+
"commitollama.useLowerCase": {
74+
"type": "boolean",
75+
"description": "Enable or disable lowercase commit messages.",
76+
"default": false,
9677
"order": 3
9778
},
98-
"commitollama.custom.endpoint": {
79+
"commitollama.language": {
9980
"type": "string",
100-
"description": "Ollama Server Endpoint. Leave empty to use the default ollama endpoint.",
81+
"enum": [
82+
"Arabic",
83+
"Chinese",
84+
"English",
85+
"French",
86+
"German",
87+
"Italian",
88+
"Japanese",
89+
"Korean",
90+
"Portuguese",
91+
"Russian",
92+
"Spanish",
93+
"Custom"
94+
],
95+
"description": "Language for commit messages.",
96+
"default": "English",
10197
"order": 4
10298
},
99+
"commitollama.promptTemperature": {
100+
"type": "number",
101+
"minimum": 0,
102+
"maximum": 1,
103+
"description": "Custom temperature for generating the commit message. (Higher number = more creative)",
104+
"default": 0.2,
105+
"order": 7
106+
},
107+
"commitollama.commitTemplate": {
108+
"type": "string",
109+
"description": "Custom template for commit messages.",
110+
"default": "{{type}} {{emoji}}: {{message}}",
111+
"order": 8
112+
},
103113
"commitollama.custom.model": {
104114
"type": "string",
105115
"description": "Allows you to specify any model name. The model has to be downloaded and available on your Ollama instance. **Note:** Ignored if `commitollama.model` is not set to \"Custom\".",
106116
"order": 5
107117
},
108-
"commitollama.custom.summaryPrompt": {
118+
"commitollama.custom.language": {
109119
"type": "string",
110-
"description": "Custom prompt to summarize the git diff.",
120+
"description": "Allows you to specify any language for the commit messages. **Note:** Ignored if `commitollama.language` is not set to \"Custom\".",
111121
"order": 6
112122
},
113-
"commitollama.custom.summaryTemperature": {
114-
"type": "number",
115-
"minimum": 0,
116-
"maximum": 1,
117-
"description": "Custom temperature to summarize the git diff. (Higher number = more creative)",
118-
"default": 0.8,
119-
"order": 7
123+
"commitollama.custom.emojis": {
124+
"type": "object",
125+
"description": "Map commit types to emojis. Only used if emojis are enabled.",
126+
"order": 9
127+
},
128+
"commitollama.custom.endpoint": {
129+
"type": "string",
130+
"description": "Ollama Server Endpoint. Leave empty to use the default ollama endpoint.",
131+
"order": 10
120132
},
121-
"commitollama.custom.commitPrompt": {
133+
"commitollama.custom.prompt": {
122134
"type": "string",
123135
"description": "Custom prompt to generate the commit message with.",
124-
"order": 8
136+
"order": 11
125137
},
126-
"commitollama.custom.commitTemperature": {
127-
"type": "number",
128-
"minimum": 0,
129-
"maximum": 1,
130-
"description": "Custom temperature for generating the commit message. (Higher number = more creative)",
131-
"default": 0.2,
132-
"order": 9
138+
"commitollama.custom.typeRules": {
139+
"type": "string",
140+
"description": "Custom rules for commit message types.",
141+
"order": 12
133142
},
134-
"commitollama.useLowerCase": {
135-
"type": "boolean",
136-
"description": "Enable or disable lowercase commit messages.",
137-
"default": false,
138-
"order": 10
143+
"commitollama.custom.commitMessageRules": {
144+
"type": "string",
145+
"description": "Custom rules for commit messages.",
146+
"order": 13
139147
},
140-
"commitollama.commitTemplate": {
148+
"commitollama.custom.descriptionPrompt": {
141149
"type": "string",
142-
"description": "Custom template for commit messages.",
143-
"default": "{{type}} {{emoji}}: {{message}}",
144-
"order": 11
150+
"description": "Custom prompt to generate the commit description with.",
151+
"order": 14
145152
}
146153
}
147154
}
@@ -156,27 +163,26 @@
156163
"format-fix": "npx @biomejs/biome format ./src --fix",
157164
"test": "vscode-test",
158165
"publish": "npm run build && vsce publish",
166+
"publish:major": "npm run build && vsce publish major",
159167
"publish:minor": "npm run build && vsce publish minor",
160168
"publish:patch": "npm run build && vsce publish patch",
161169
"package": "vsce package"
162170
},
163171
"devDependencies": {
164172
"@biomejs/biome": "1.9.4",
165173
"@types/mocha": "10.0.10",
166-
"@types/node": "22.15.2",
174+
"@types/node": "22.15.29",
167175
"@types/sinon": "17.0.4",
168176
"@types/vscode": "^1.98.0",
169-
"@vscode/test-cli": "0.0.10",
170-
"@vscode/test-electron": "2.4.1",
171-
"esbuild": "0.25.3",
172-
"mocha": "11.1.0",
173-
"sinon": "19.0.2",
177+
"@vscode/test-cli": "0.0.11",
178+
"@vscode/test-electron": "2.5.2",
179+
"esbuild": "0.25.5",
180+
"mocha": "11.5.0",
181+
"sinon": "20.0.0",
174182
"typescript": "5.8.3"
175183
},
176184
"dependencies": {
177-
"ollama": "0.5.15"
185+
"ollama": "0.5.16"
178186
},
179-
"extensionDependencies": [
180-
"vscode.git"
181-
]
187+
"extensionDependencies": ["vscode.git"]
182188
}

sampleWorkspace/.vscode/settings.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
{
2-
"commitollama.commitEmojis": {
3-
"feat": "",
4-
"fix": "🐛",
5-
"docs": "📝",
6-
"style": "💎",
7-
"refactor": "♻️",
8-
"test": "🧪",
9-
"chore": "📦",
10-
"revert": ""
11-
},
12-
"commitollama.useEmojis": true,
13-
"commitollama.useDescription": true,
14-
"commitollama.useLowerCase": true,
15-
"commitollama.commitTemplate": "{{type}} {{emoji}}: {{message}}"
2+
"commitollama.useEmojis": false,
3+
"commitollama.useDescription": false,
4+
"commitollama.useLowerCase": false,
5+
"commitollama.custom.emojis": {},
6+
"commitollama.commitTemplate": "{{type}} {{emoji}}: {{message}}",
167
}

0 commit comments

Comments
 (0)