Skip to content

Commit 854faff

Browse files
committed
feat(docs): update docs for enhanced Git workflow integration
- revise README and help to clarify Neovim plugin usage - document new async operations and error handling - update feature lists with tool operation counts and assistant - improve usage examples for buffer and chat workflows - add details on keymaps, file filtering, and configuration
1 parent dc41b45 commit 854faff

File tree

2 files changed

+61
-49
lines changed

2 files changed

+61
-49
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# CodeCompanion Git Commit Extension
1+
# CodeCompanion GitCommit Extension
22

3-
A CodeCompanion extension that generates AI-powered git commit messages following the Conventional Commits specification, with powerful Git tool integration.
3+
A Neovim plugin extension for CodeCompanion that generates AI-powered Git commit messages following the Conventional Commits specification, with comprehensive Git workflow integration.
44

55
## ✨ Features
66

77
- 🤖 **AI Commit Generation** - Generate Conventional Commits compliant messages using CodeCompanion's LLM adapters
8-
- 🛠️ **Git Tool Integration** - Execute Git operations through `@git_read` and `@git_edit` tools in chat
8+
- 🛠️ **Git Tool Integration** - Execute Git operations through `@git_read` (15 operations) and `@git_edit` (16 operations) tools in chat
9+
- 🤖 **Git Assistant** - Intelligent Git workflow assistance via `@git_bot` combining read/write operations
910
- 🌍 **Multi-language Support** - Generate commit messages in multiple languages
10-
- 📝 **Smart Buffer Integration** - Auto-generate commit messages in gitcommit buffers
11-
- 📋 **File Filtering** - Support glob patterns to exclude generated files from analysis
12-
- 💬 **Natural Language Interface** - Control Git workflows through conversation
11+
- 📝 **Smart Buffer Integration** - Auto-generate commit messages in gitcommit buffers with configurable keymaps
12+
- 📋 **File Filtering** - Support glob patterns to exclude files from diff analysis
13+
- **Async Operations** - Non-blocking Git operations with proper error handling
1314

1415
## 📦 Installation
1516

@@ -62,8 +63,6 @@ require("codecompanion").setup({
6263
|---------|-------------|
6364
| `:CodeCompanionGitCommit` | Generate Git commit message |
6465
| `:CCGitCommit` | Generate Git commit message (short alias) |
65-
| `:CodeCompanionGit` | Open Git assistant chat |
66-
| `:CCGit` | Open Git assistant chat (short alias) |
6766

6867
### Git Tool Operations
6968

@@ -101,22 +100,25 @@ Use a comprehensive Git assistant that combines read and write operations:
101100
@git_bot Analyze recent commit history and summarize main changes
102101
```
103102

104-
### Workflow Examples
103+
### Basic Usage
105104

106-
**Quick commit workflow:**
105+
**1. Generate commit message:**
107106
```
108-
@git_read status # Check status
109-
@git_edit stage --files [...] # Stage files
110-
:CodeCompanionGitCommit # Generate commit message
107+
:CodeCompanionGitCommit
111108
```
112109

113-
**Branch management:**
110+
**2. GitCommit buffer integration:**
111+
- Run `git commit` to open commit buffer
112+
- Press `<leader>gc` to generate message (or auto-generates if enabled)
113+
- Edit and save to complete commit
114+
115+
**3. Chat-based Git workflow:**
114116
```
115-
@git_read branch
116-
@git_edit create_branch --branch_name "feature/awesome"
117-
# ... make changes ...
118-
@git_edit stage --files [...]
117+
@git_read status # Check repository status
118+
@git_edit stage --files ["file1.txt", "file2.txt"] # Stage files
119119
/gitcommit # Generate commit message in chat
120+
@git_edit commit --commit_message "feat: add new feature" # Commit
121+
@git_edit push --remote "origin" --branch "main" # Push changes
120122
```
121123

122124
## ⚙️ Configuration Options

doc/codecompanion-gitcommit.txt

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
*codecompanion-gitcommit.txt* For Neovim >= 0.8.0 Last change: 2025 Jan 02
22

3-
CODECOMPANION GIT COMMIT EXTENSION *codecompanion-gitcommit*
3+
CODECOMPANION GITCOMMIT EXTENSION *codecompanion-gitcommit*
44

5-
A CodeCompanion extension that generates AI-powered git commit messages
6-
following the Conventional Commits specification, with powerful Git tool
7-
integration.
5+
A Neovim plugin extension for CodeCompanion that generates AI-powered Git
6+
commit messages following the Conventional Commits specification, with
7+
comprehensive Git workflow integration.
88

99
==============================================================================
1010
CONTENTS *codecompanion-gitcommit-contents*
@@ -21,14 +21,16 @@ CONTENTS *codecompanion-gitcommit-contents*
2121
==============================================================================
2222
1. INTRODUCTION *codecompanion-gitcommit-intro*
2323

24-
The CodeCompanion Git Commit Extension is a powerful tool that leverages AI
25-
to generate meaningful git commit messages following the Conventional Commits
26-
specification. It integrates seamlessly with CodeCompanion's LLM adapters to
27-
analyze your staged changes and create appropriate commit messages.
24+
The CodeCompanion GitCommit Extension is a powerful Neovim plugin that
25+
leverages AI to generate meaningful Git commit messages following the
26+
Conventional Commits specification. It integrates seamlessly with
27+
CodeCompanion's LLM adapters to analyze your staged changes and create
28+
appropriate commit messages.
2829

29-
The extension provides comprehensive Git operations through @git_read,
30-
@git_edit, and @git_bot tools, offering a natural language interface for
31-
Git workflow management within CodeCompanion chat buffers.
30+
The extension provides comprehensive Git operations through @git_read (15
31+
operations), @git_edit (16 operations), and @git_bot tools, offering a
32+
natural language interface for Git workflow management within CodeCompanion
33+
chat buffers.
3234

3335
==============================================================================
3436
2. FEATURES *codecompanion-gitcommit-features*
@@ -38,19 +40,22 @@ Git workflow management within CodeCompanion chat buffers.
3840
• Conventional Commits specification compliance
3941
• Multi-language support for commit messages
4042
• Support for regular commits and amend commits
43+
• Smart diff analysis with file filtering capabilities
4144

4245
🛠️ Git Tool Integration
43-
• @git_read tool - Execute read-only Git operations through chat
44-
• @git_edit tool - Execute write-access Git operations through chat
45-
• @git_bot tool group - Comprehensive Git assistant combining read/write ops
46+
• @git_read tool - 15 read-only Git operations (status, log, diff, etc.)
47+
• @git_edit tool - 16 write-access Git operations (stage, commit, push, etc.)
48+
• @git_bot tool - Comprehensive Git assistant combining all operations
4649
• Natural language interface for Git workflow control
47-
• Automatic approval requirements for destructive operations
50+
• Async operations with proper error handling
51+
• Safety confirmations for destructive operations
4852

4953
📝 Smart Integration
50-
• Smart keymap integration for gitcommit buffers
51-
• Automatic git repository detection
52-
• Support for user commands and slash commands
53-
• File filtering support using glob patterns
54+
• GitCommit buffer keymap integration with auto-generation
55+
• Automatic Git repository detection
56+
• Slash commands (/gitcommit) for chat integration
57+
• Configurable file filtering using glob patterns
58+
• Programmable API for external integrations
5459

5560
==============================================================================
5661
3. INSTALLATION *codecompanion-gitcommit-install*
@@ -98,29 +103,34 @@ Add this extension to your CodeCompanion configuration:
98103
==============================================================================
99104
4. USAGE *codecompanion-gitcommit-usage*
100105

101-
Basic workflow:
106+
Basic Usage:
102107

103-
1. Stage your changes: >
104-
git add .
105-
<
106-
2. Generate commit message: >
108+
1. Generate commit message: >
107109
:CodeCompanionGitCommit
108110
<
109-
3. Review the generated commit message in the floating window
110-
111-
4. Choose an action:
111+
2. Review the generated commit message in the floating window
112+
3. Choose an action:
112113
• c - Copy to clipboard
113114
• y - Copy to yank register
114115
• s - Submit changes
115116
• Enter - Copy and close
116117
• q/Esc - Close
117118

118-
GitCommit buffer integration:
119+
GitCommit Buffer Integration:
119120

120121
1. Run `git commit` to open commit buffer
121-
2. If `auto_generate` is enabled, message appears automatically
122-
3. Otherwise, press `<leader>gc` in normal mode to generate
123-
4. Edit as needed and save to complete the commit
122+
2. Press `<leader>gc` to generate message (or auto-generates if enabled)
123+
3. Edit as needed and save to complete the commit
124+
125+
Chat-based Git Workflow:
126+
127+
Use Git tools in CodeCompanion chat: >
128+
@git_read status # Check repository status
129+
@git_edit stage --files ["file.txt"] # Stage files
130+
/gitcommit # Generate commit message
131+
@git_edit commit --commit_message "feat: add feature" # Commit
132+
@git_edit push --remote "origin" --branch "main" # Push
133+
<
124134

125135
==============================================================================
126136
5. COMMANDS *codecompanion-gitcommit-commands*

0 commit comments

Comments
 (0)