Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# Test binary, built with `go test -c`
*.test

# Test Files
test_*

Comment on lines +14 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reconsider the test file ignore pattern.

The pattern test_* is overly broad and doesn't follow Go conventions:

  • Standard Go test files are named *_test.go, not test_*
  • This pattern could accidentally ignore legitimate files like test_data/, test_config.json, or test_helpers.go
  • Go test binaries created with go test -c are already covered by the *.test pattern on line 12

If the intent is to ignore temporary test files or test artifacts, consider either:

  1. Removing this pattern entirely (Go conventions already covered)
  2. Using a more specific pattern like test_output/ or test_artifacts/
  3. Documenting what specific files this is meant to ignore

Apply this diff to remove the overly broad pattern:

-# Test Files
-test_*
-

Or if specific test artifacts need to be ignored, use a more targeted pattern:

 # Test Files
-test_*
+test_output/
+test_artifacts/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Test Files
test_*
# Test Files
test_output/
test_artifacts/
🤖 Prompt for AI Agents
In .gitignore around lines 14 to 16, the broad pattern `test_*` will erroneously
ignore valid files and folders (e.g. test_data/, test_config.json,
test_helpers.go) and doesn't match Go test naming; remove the `test_*` line and,
if specific test artifacts should be ignored, replace it with targeted patterns
such as `test_output/`, `test_artifacts/`, or any explicit filenames/directories
you intend to exclude (do not add a blanket `test_*` pattern).

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

Expand Down
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Looking to contribute? Check out:
🔄 **Multiple LLM Support** - Choose between Google Gemini, Grok, Claude, ChatGPT, or Ollama (local)
📝 **Context-Aware** - Analyzes staged and unstaged changes
📋 **Auto-Copy to Clipboard** - Generated messages are automatically copied for instant use
🎛️ **Interactive Review Flow** - Accept, regenerate with new styles, or open the message in your editor before committing
📊 **File Statistics Display** - Visual preview of changed files and line counts
🚀 **Easy to Use** - Simple CLI interface with beautiful terminal UI
⚡ **Fast** - Quick generation of commit messages
Expand Down Expand Up @@ -62,7 +63,6 @@ You can use **Google Gemini**, **Grok**, **Claude**, **ChatGPT**, or **Ollama**
echo 'export PATH=$PATH:/path/to/commit-msg' >> ~/.bashrc # or ~/.zshrc
```


### Option 2: Build from Source

Requirements: Go 1.23.4 or higher
Expand Down Expand Up @@ -105,6 +105,7 @@ go run cmd/commit-msg/main.go .
```bash
commit llm setup
```

<img width="551" height="184" alt="Screenshot 2025-10-05 172731" src="https://github.com/user-attachments/assets/d71c38ad-4737-4ca8-bde3-fbff1066e62b" />
<img width="536" height="235" alt="Screenshot 2025-10-05 172748" src="https://github.com/user-attachments/assets/b6c5c0f0-bf6b-4ae7-966a-4cc16419c294" />

Expand All @@ -113,12 +114,12 @@ go run cmd/commit-msg/main.go .
```bash
commit llm update
```

<img width="477" height="179" alt="Screenshot 2025-10-05 172814" src="https://github.com/user-attachments/assets/a8b7686f-106b-4408-8c73-254cdd7dc0b5" />
<img width="551" height="176" alt="Screenshot 2025-10-05 172823" src="https://github.com/user-attachments/assets/b559c20c-4e18-4e46-97b3-0d26c278d9e0" />

### Example Workflow


```bash
# Make changes to your code
echo "console.log('Hello World')" > app.js
Expand All @@ -137,6 +138,17 @@ commit .
# You can now paste it with Ctrl+V (or Cmd+V on macOS)
```

### Interactive Commit Workflow

Once the commit message is generated, the CLI now offers a quick review loop:

- **Accept & copy** – use the message as-is (it still lands on your clipboard automatically)
- **Regenerate** – pick from presets like detailed summaries, casual tone, bug-fix emphasis, or provide custom instructions for the LLM
- **Edit in your editor** – open the message in `$GIT_EDITOR`, `$VISUAL`, `$EDITOR`, or a sensible fallback (`notepad` on Windows, `nano` elsewhere)
- **Exit** – leave without copying anything if the message isn't ready yet

This makes it easy to tweak the tone, iterate on suggestions, or fine-tune the final wording before you commit.

### Use Cases

- 📝 Generate commit messages for staged changes
Expand All @@ -162,20 +174,24 @@ commit .
commit llm update
```

**Set LLM as default**
### Set LLM as default

```bash
Select: Set Default
```

**Change API Key**
### Change API Key

```bash
Select: Change API Key
```

**Delete LLM**
### Delete LLM

```bash
Select: Delete
```

---

## Getting API Keys
Expand All @@ -185,40 +201,35 @@ Select: Delete
1. Visit [Google AI Studio](https://makersuite.google.com/app/apikey)
2. Create a new API key


**Grok (X.AI):**

1. Visit [X.AI Console](https://console.x.ai/)
2. Generate an API key


**Groq:**

1. Sign up at [Groq Cloud](https://console.groq.com/)
2. Create an API key


**Claude (Anthropic):**

1. Visit the [Anthropic Console](https://console.anthropic.com/)
2. Create a new API key


**OpenAI (ChatGPT):**

1. Visit [OpenAI Platform](https://platform.openai.com/api-keys)
2. Create a new API key


**Ollama (Local LLM):**

1. Install Ollama: Visit [Ollama.ai](https://ollama.ai/) and follow installation instructions
2. Start Ollama: `ollama serve`
3. Pull a model: `ollama pull llama3`
3. Pull a model: `ollama pull llama3.1`
4. Set environment variables:
```bash
export COMMIT_LLM=ollama
export OLLAMA_MODEL=llama3 # llama3 by default
export OLLAMA_MODEL=llama3.1 # llama3.1 by default
```

---
Expand Down
Loading
Loading