Skip to content

Commit 105430b

Browse files
committed
Add autocommit script and update README with workflow documentation
Extends the poorcoder toolkit by introducing a new `autocommit` script that automates AI-generated commit messages. Updates README.md to explain the new script's purpose, usage, and integration with the existing workflow.
1 parent 15525f1 commit 105430b

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

README.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ A collection of lightweight Bash scripts to enhance your coding workflow with AI
44

55
## Overview
66

7-
This repository contains three main tools:
7+
This repository contains four main tools:
88

99
1. **`context`** - Extracts code context from your project to send to an LLM
1010
2. **`apply-md`** - Applies code changes from LLM's markdown response
1111
3. **`git-context`** - Generates git context for AI-assisted commit messages
12+
4. **`autocommit`** - Automatically creates AI-generated commit messages using git-context
1213

1314
## Workflow
1415

@@ -37,7 +38,7 @@ Simply clone this repository and make the scripts executable:
3738
```bash
3839
git clone https://github.com/vgrichina/poorcoder.git
3940
cd poorcoder
40-
chmod +x context apply-md git-context
41+
chmod +x context apply-md git-context autocommit
4142
```
4243

4344
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
5051
# Clone the repository
5152
git clone https://github.com/vgrichina/poorcoder.git
5253
# 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/
5455
cp -r poorcoder/prompts /path/to/your/project/
5556
# 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}
5758
```
5859

5960
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)"
122123

123124
[See full documentation for git-context](./docs/git-context.md)
124125

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+
125145
## Component Interaction
126146

127147
The following diagram shows how the different components of poorcoder interact with each other and with external systems:
@@ -132,6 +152,7 @@ flowchart TB
132152
context["context\n(Extract Code Context)"]
133153
applymd["apply-md\n(Apply Code Changes)"]
134154
gitcontext["git-context\n(Generate Git Info)"]
155+
autocommit["autocommit\n(AI Commit Messages)"]
135156
clipboard[("Clipboard\n(pbcopy/pbpaste)")]
136157
files[("Project Files")]
137158
git[("Git Repository")]
@@ -158,6 +179,11 @@ flowchart TB
158179
gitcontext -->|"Generate context"| llmcli
159180
llmcli -->|"Generate message"| git
160181
182+
%% Autocommit workflow
183+
autocommit -->|"Uses"| gitcontext
184+
autocommit -->|"Uses"| llmcli
185+
autocommit -->|"Commits to"| git
186+
161187
%% Direct CLI workflow
162188
context -.->|"Direct pipe"| llmcli
163189
llmcli -.->|"Direct pipe"| applymd
@@ -168,7 +194,7 @@ flowchart TB
168194
classDef external fill:#6a89cc,stroke:#333,stroke-width:1px,color:white
169195
classDef cli fill:#78e08f,stroke:#333,stroke-width:1px
170196
171-
class context,applymd,gitcontext tool
197+
class context,applymd,gitcontext,autocommit tool
172198
class files,clipboard,git storage
173199
class llm external
174200
class llmcli cli
@@ -202,6 +228,9 @@ For quick operations or automation using LLM CLI tools:
202228
# Generate commit message using LLM CLI
203229
git commit -am "$(./git-context | llm -m openrouter/anthropic/claude-3.5-haiku)" -e
204230

231+
# Or use the autocommit script for a simpler workflow
232+
./autocommit
233+
205234
# Fix a small issue directly in terminal
206235
./context --include="src/buggy-file.js" | llm "Fix the null reference bug" | ./apply-md
207236
```
@@ -222,9 +251,9 @@ git commit -am "$(./git-context | llm -m openrouter/anthropic/claude-3.5-haiku)"
222251
pbpaste | ./apply-md # Apply changes
223252
```
224253

225-
4. Generate a commit message:
254+
4. Generate a commit message using autocommit:
226255
```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
228257
```
229258

230259
## Integration with Other Tools

0 commit comments

Comments
 (0)