Skip to content

Commit e44f124

Browse files
committed
docs: Update README with new features: file/folder commit, regenerate, push
1 parent a7a4fde commit e44f124

1 file changed

Lines changed: 61 additions & 5 deletions

File tree

README.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ A command-line AI tool for autocommits.
88
- 🚀 Automatic commit generation using AI
99
- 📁 Directory-based commits - create separate commits for each root directory
1010
- 🎯 Interactive mode to choose between global or directory-based commits
11+
- 📄 **Commit specific files or folders** - Stage and commit only selected files/directories
12+
- 🔄 **Regenerate commit messages** - Don't like the suggestions? Regenerate with one click
13+
- 🚀 **Push to remote** - Automatically push commits after committing
1114
- ⚙️ Flexible configuration - use environment variables or .dcommit file
1215
- 🏠 Self-hosted model support - use your own AI infrastructure
1316
- 🆓 Multiple free tier options available
@@ -160,6 +163,9 @@ devcommit --stageAll --files file1.py file2.py
160163
git add src/ tests/
161164
devcommit --files src/ tests/
162165
166+
# Stage and commit multiple directories
167+
devcommit -s -f src/core src/modules/account/ src/modules/auth/
168+
163169
# Short form
164170
devcommit -s -f file1.py file2.py
165171
```
@@ -170,22 +176,66 @@ When using `--files` or `-f`:
170176
- With `--stageAll`: Stages the specified files/folders and then commits them
171177
- AI generates commit messages based on changes in those files
172178
- Works with both individual files and entire directories
179+
- Files with no changes are automatically filtered out
173180
174181
#### Commit Mode Behavior with `--files`
175182
176183
The `--files` flag respects your `COMMIT_MODE` setting:
177184
178185
- **`COMMIT_MODE=directory`** with `--files`:
179-
- Each file gets its own separate commit, even if files are in the same directory
180-
- Example: `devcommit -f src/test1.py src/test2.py` creates 2 separate commits
186+
- **Individual files**: Each file gets its own separate commit
187+
- Example: `devcommit -f src/test1.py src/test2.py` creates 2 separate commits
188+
- **Directories**: Each directory gets one commit containing all its files
189+
- Example: `devcommit -f src/core src/modules/account/` creates 2 commits (one per directory)
181190
182191
- **`COMMIT_MODE=global`** with `--files`:
183-
- All specified files are committed together in a single commit
192+
- All specified files/directories are committed together in a single commit
184193
- Example: `devcommit -f src/test1.py src/test2.py` creates 1 commit for both files
185194
186195
- **`COMMIT_MODE=auto`** with `--files`:
187-
- If files span multiple directories, prompts you to choose between one commit or separate commits
188-
- If all files are in the same directory, creates one commit (unless directory mode is selected)
196+
- Always prompts you to choose between one commit for all files or separate commits
197+
- If you select directory mode: individual files get separate commits, directories get one commit each
198+
- If you select global mode: everything is committed together
199+
200+
### Push to Remote
201+
202+
DevCommit can automatically push your commits to the remote repository after committing.
203+
204+
**Usage:**
205+
206+
```bash
207+
# Commit all staged changes and push
208+
devcommit --push
209+
210+
# Commit specific files and push
211+
devcommit --files file1.py file2.py --push
212+
213+
# Stage, commit, and push in one command
214+
devcommit --stageAll --push
215+
216+
# Short form
217+
devcommit -p
218+
devcommit -f file1.py -p
219+
```
220+
221+
**Note:** The push operation will only execute if commits were successfully made. If you cancel the commit, the push will be skipped.
222+
223+
### Regenerate Commit Messages
224+
225+
Don't like the AI-generated commit messages? You can regenerate them on the fly!
226+
227+
When viewing commit message options, you'll see:
228+
- Numbered commit message suggestions
229+
- ✏️ Enter custom message
230+
- 🔄 **Regenerate commit messages** (new!)
231+
- ❌ Cancel
232+
233+
Selecting "Regenerate commit messages" will:
234+
- Call the AI again to generate new suggestions
235+
- Show the new messages in the same prompt
236+
- Allow you to regenerate again or select a message
237+
238+
This works for all commit modes (global, directory, and per-file commits).
189239
190240
### Additional Options
191241
@@ -223,6 +273,12 @@ devcommit --push
223273
224274
# Commit specific files and push
225275
devcommit --files file1.py file2.py --push
276+
277+
# Stage and commit multiple directories with directory mode
278+
devcommit -s -f src/core src/modules/account/ --directory
279+
280+
# Stage and commit, then push
281+
devcommit -s -f src/core src/modules/account/ -p
226282
```
227283
228284
## AI Provider Support

0 commit comments

Comments
 (0)