@@ -13,7 +13,7 @@ Below is a sample execution of `commit-msg`:
1313
1414![ Commit-msg GIF] ( assets/commit.gif )
1515
16- Before running the application, ensure you have set the system environment variables. and add commit.exe to path variables (same for linux macOS)
16+ ## Before running the application, set LLM and API Key using " commit llm setup"
1717
1818## 🎃 Hacktoberfest 2025
1919
@@ -39,18 +39,6 @@ Looking to contribute? Check out:
3939
4040You can use ** Google Gemini** , ** Grok** , ** Claude** , ** ChatGPT** , or ** Ollama** (local) as the LLM to generate commit messages:
4141
42- ### Environment Variables
43-
44- | Variable | Values | Description |
45- | :--- | :--- | :--- |
46- | ` COMMIT_LLM ` | ` gemini ` , ` grok ` , ` claude ` , ` chatgpt ` , or ` ollama ` | Choose your LLM provider |
47- | ` GEMINI_API_KEY ` | Your API key | Required if using Gemini |
48- | ` GROK_API_KEY ` | Your API key | Required if using Grok |
49- | ` CLAUDE_API_KEY ` | Your API key | Required if using Claude |
50- | ` OPENAI_API_KEY ` | Your API key | Required if using ChatGPT |
51- | ` OLLAMA_URL ` | URL (optional) | Ollama server URL (default: http://localhost:11434/api/generate) |
52- | ` OLLAMA_MODEL ` | Model name (optional) | Ollama model to use (default: llama3) |
53-
5442---
5543
5644## 📦 Installation
@@ -74,22 +62,6 @@ You can use **Google Gemini**, **Grok**, **Claude**, **ChatGPT**, or **Ollama**
7462 echo ' export PATH=$PATH:/path/to/commit-msg' >> ~ /.bashrc # or ~/.zshrc
7563 ```
7664
77- 4 . Set up environment variables:
78-
79- ** Windows:**
80-
81- ``` cmd
82- setx COMMIT_LLM "gemini"
83- setx GEMINI_API_KEY "your-api-key-here"
84- ```
85-
86- ** Linux/macOS:**
87-
88- ``` bash
89- export COMMIT_LLM=gemini
90- export GEMINI_API_KEY=your-api-key-here
91- # Add to ~/.bashrc or ~/.zshrc to persist
92- ```
9365
9466### Option 2: Build from Source
9567
@@ -128,8 +100,25 @@ Or if running from source:
128100go run cmd/commit-msg/main.go .
129101```
130102
103+ ### Setup LLM and API Key
104+
105+ ``` bash
106+ commit llm setup
107+ ```
108+ <img width =" 551 " height =" 184 " alt =" Screenshot 2025-10-05 172731 " src =" https://github.com/user-attachments/assets/d71c38ad-4737-4ca8-bde3-fbff1066e62b " />
109+ <img width =" 536 " height =" 235 " alt =" Screenshot 2025-10-05 172748 " src =" https://github.com/user-attachments/assets/b6c5c0f0-bf6b-4ae7-966a-4cc16419c294 " />
110+
111+ ### Update LLM
112+
113+ ``` bash
114+ commit llm update
115+ ```
116+ <img width =" 477 " height =" 179 " alt =" Screenshot 2025-10-05 172814 " src =" https://github.com/user-attachments/assets/a8b7686f-106b-4408-8c73-254cdd7dc0b5 " />
117+ <img width =" 551 " height =" 176 " alt =" Screenshot 2025-10-05 172823 " src =" https://github.com/user-attachments/assets/b559c20c-4e18-4e46-97b3-0d26c278d9e0 " />
118+
131119### Example Workflow
132120
121+
133122``` bash
134123# Make changes to your code
135124echo " console.log('Hello World')" > app.js
@@ -161,38 +150,65 @@ commit .
161150
162151## 🔧 Configuration
163152
164- ### Getting API Keys
153+ ### Set LLM and API Keys
154+
155+ ``` bash
156+ commit llm setup
157+ ```
158+
159+ ### Update LLM
160+
161+ ``` bash
162+ commit llm update
163+ ```
164+
165+ ** Set LLM as default**
166+ ``` bash
167+ Select: Set Default
168+ ```
169+
170+ ** Change API Key**
171+ ``` bash
172+ Select: Change API Key
173+ ```
174+
175+ ** Delete LLM**
176+ ``` bash
177+ Select: Delete
178+ ```
179+ ---
180+
181+ ## Getting API Keys
165182
166183** Google Gemini:**
167184
1681851 . Visit [ Google AI Studio] ( https://makersuite.google.com/app/apikey )
1691862 . Create a new API key
170- 3 . Set the ` GEMINI_API_KEY ` environment variable
187+
171188
172189** Grok (X.AI):**
173190
1741911 . Visit [ X.AI Console] ( https://console.x.ai/ )
1751922 . Generate an API key
176- 3 . Set the ` GROK_API_KEY ` environment variable
193+
177194
178195** Groq:**
179196
1801971 . Sign up at [ Groq Cloud] ( https://console.groq.com/ )
1811982 . Create an API key
182- 3 . Set the ` GROQ_API_KEY ` environment variable
183- 4 . _ (Optional)_ Set ` GROQ_MODEL ` or ` GROQ_API_URL ` to override defaults
199+
184200
185201** Claude (Anthropic):**
186202
1872031 . Visit the [ Anthropic Console] ( https://console.anthropic.com/ )
1882042 . Create a new API key
189- 3 . Set the ` CLAUDE_API_KEY ` environment variable
205+
190206
191207** OpenAI (ChatGPT):**
192208
1932091 . Visit [ OpenAI Platform] ( https://platform.openai.com/api-keys )
1942102 . Create a new API key
195- 3 . Set the ` OPENAI_API_KEY ` environment variable
211+
196212
197213** Ollama (Local LLM):**
198214
0 commit comments