@@ -4,11 +4,12 @@ A collection of lightweight Bash scripts to enhance your coding workflow with AI
4
4
5
5
## Overview
6
6
7
- This repository contains three main tools:
7
+ This repository contains four main tools:
8
8
9
9
1 . ** ` context ` ** - Extracts code context from your project to send to an LLM
10
10
2 . ** ` apply-md ` ** - Applies code changes from LLM's markdown response
11
11
3 . ** ` git-context ` ** - Generates git context for AI-assisted commit messages
12
+ 4 . ** ` autocommit ` ** - Automatically creates AI-generated commit messages using git-context
12
13
13
14
## Workflow
14
15
@@ -37,7 +38,7 @@ Simply clone this repository and make the scripts executable:
37
38
``` bash
38
39
git clone https://github.com/vgrichina/poorcoder.git
39
40
cd poorcoder
40
- chmod +x context apply-md git-context
41
+ chmod +x context apply-md git-context autocommit
41
42
```
42
43
43
44
You can either use the scripts directly from this folder or add them to your PATH for global access.
@@ -50,10 +51,10 @@ For heavy usage, copy the scripts and prompts directory directly into your proje
50
51
# Clone the repository
51
52
git clone https://github.com/vgrichina/poorcoder.git
52
53
# Copy essential files to your project
53
- cp poorcoder/{context,apply-md,git-context} /path/to/your/project/
54
+ cp poorcoder/{context,apply-md,git-context,autocommit } /path/to/your/project/
54
55
cp -r poorcoder/prompts /path/to/your/project/
55
56
# Make scripts executable
56
- chmod +x /path/to/your/project/{context,apply-md,git-context}
57
+ chmod +x /path/to/your/project/{context,apply-md,git-context,autocommit }
57
58
```
58
59
59
60
This approach lets you customize both the scripts and prompts for your specific project workflow. You can also create custom aliases or wrapper scripts, for example:
@@ -122,6 +123,25 @@ git commit -am "$(./git-context | llm -m openrouter/anthropic/claude-3.5-haiku)"
122
123
123
124
[ See full documentation for git-context] ( ./docs/git-context.md )
124
125
126
+ ### 4. ` autocommit ` - Automated AI Commit Message Generator
127
+
128
+ Automatically creates commits with AI-generated commit messages using git-context.
129
+
130
+ ``` bash
131
+ # Basic usage - commits all changes with an AI-generated message
132
+ ./autocommit
133
+
134
+ # The script opens an editor to allow you to review/edit the message before finalizing
135
+ ```
136
+
137
+ The autocommit script is a simple wrapper that:
138
+ 1 . Uses git-context to gather information about your changes
139
+ 2 . Passes that context to an LLM via the llm CLI tool
140
+ 3 . Uses the generated message for a git commit
141
+ 4 . Opens your editor to let you review/edit the message before finalizing
142
+
143
+ This script requires the ` llm ` CLI tool to be installed and configured with an appropriate LLM model.
144
+
125
145
## Component Interaction
126
146
127
147
The following diagram shows how the different components of poorcoder interact with each other and with external systems:
@@ -132,6 +152,7 @@ flowchart TB
132
152
context["context\n(Extract Code Context)"]
133
153
applymd["apply-md\n(Apply Code Changes)"]
134
154
gitcontext["git-context\n(Generate Git Info)"]
155
+ autocommit["autocommit\n(AI Commit Messages)"]
135
156
clipboard[("Clipboard\n(pbcopy/pbpaste)")]
136
157
files[("Project Files")]
137
158
git[("Git Repository")]
@@ -158,6 +179,11 @@ flowchart TB
158
179
gitcontext -->|"Generate context"| llmcli
159
180
llmcli -->|"Generate message"| git
160
181
182
+ %% Autocommit workflow
183
+ autocommit -->|"Uses"| gitcontext
184
+ autocommit -->|"Uses"| llmcli
185
+ autocommit -->|"Commits to"| git
186
+
161
187
%% Direct CLI workflow
162
188
context -.->|"Direct pipe"| llmcli
163
189
llmcli -.->|"Direct pipe"| applymd
@@ -168,7 +194,7 @@ flowchart TB
168
194
classDef external fill:#6a89cc,stroke:#333,stroke-width:1px,color:white
169
195
classDef cli fill:#78e08f,stroke:#333,stroke-width:1px
170
196
171
- class context,applymd,gitcontext tool
197
+ class context,applymd,gitcontext,autocommit tool
172
198
class files,clipboard,git storage
173
199
class llm external
174
200
class llmcli cli
@@ -202,6 +228,9 @@ For quick operations or automation using LLM CLI tools:
202
228
# Generate commit message using LLM CLI
203
229
git commit -am " $( ./git-context | llm -m openrouter/anthropic/claude-3.5-haiku) " -e
204
230
231
+ # Or use the autocommit script for a simpler workflow
232
+ ./autocommit
233
+
205
234
# Fix a small issue directly in terminal
206
235
./context --include=" src/buggy-file.js" | llm " Fix the null reference bug" | ./apply-md
207
236
```
@@ -222,9 +251,9 @@ git commit -am "$(./git-context | llm -m openrouter/anthropic/claude-3.5-haiku)"
222
251
pbpaste | ./apply-md # Apply changes
223
252
```
224
253
225
- 4 . Generate a commit message:
254
+ 4 . Generate a commit message using autocommit :
226
255
``` bash
227
- git commit -am " $( ./git-context | llm -m openrouter/anthropic/claude-3.5-haiku ) " -e
256
+ ./autocommit # Automatically generates commit message and opens editor
228
257
```
229
258
230
259
## Integration with Other Tools
0 commit comments