@lenadweb/aicmt 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/dist/bin/aicmt.js +655 -11
- package/dist/bin/aicmt.js.map +1 -1
- package/dist/cli.js +655 -11
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@ AI-assisted git commits via OpenRouter. Designed for fast, consistent commit mes
|
|
|
5
5
|
## What it does
|
|
6
6
|
|
|
7
7
|
- Generates 3 commit message options from the staged diff
|
|
8
|
+
- Splits changes into multiple logical commits with `--split`
|
|
9
|
+
- Adds custom prefixes to commit messages with `--prefix`
|
|
8
10
|
- Supports global defaults with per-repo overrides
|
|
9
11
|
- Can auto-stage and auto-commit with `-y`
|
|
10
12
|
- Logs AI request/response with `--verbose` for troubleshooting
|
|
@@ -80,6 +82,97 @@ If there are unstaged changes, aicmt will ask to stage them. It always commits a
|
|
|
80
82
|
- `--dry-run`: Show the chosen message without committing
|
|
81
83
|
- `-v, --verbose`: Print AI request and response logs
|
|
82
84
|
- `-y, --yes`: Skip prompts (stage all, pick first message, auto-confirm)
|
|
85
|
+
- `-s, --split`: Split changes into multiple logical commits (file-level)
|
|
86
|
+
- `--split-hunks`: Split changes at hunk level (experimental)
|
|
87
|
+
- `--prefix <string>`: Add a prefix before the commit message (e.g., ticket number)
|
|
88
|
+
|
|
89
|
+
## Split mode
|
|
90
|
+
|
|
91
|
+
When you have multiple unrelated changes, use `--split` to automatically decompose them into separate commits:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
aicmt commit --split
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The AI analyzes your diff and groups files by logical changes:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Analyzing 5 changed files...
|
|
101
|
+
|
|
102
|
+
Proposed 3 commits:
|
|
103
|
+
|
|
104
|
+
1. feat: add user authentication
|
|
105
|
+
- src/auth.ts
|
|
106
|
+
- src/middleware/auth.ts
|
|
107
|
+
|
|
108
|
+
2. fix: correct validation logic
|
|
109
|
+
- src/validators.ts
|
|
110
|
+
|
|
111
|
+
3. docs: update API documentation
|
|
112
|
+
- README.md
|
|
113
|
+
- docs/api.md
|
|
114
|
+
|
|
115
|
+
Proceed with these 3 commits? (Y/n)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Split mode works with other flags:
|
|
119
|
+
|
|
120
|
+
- `--split --dry-run`: Preview proposed commits without creating them
|
|
121
|
+
- `--split -y`: Auto-confirm all commits
|
|
122
|
+
- `--split -v`: Show AI request/response for debugging
|
|
123
|
+
|
|
124
|
+
## Hunk-level split (experimental)
|
|
125
|
+
|
|
126
|
+
For finer control, use `--split-hunks` to split changes within files:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
aicmt commit --split-hunks
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This mode analyzes individual hunks (contiguous blocks of changes) rather than whole files:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Analyzing 4 hunks across 2 files...
|
|
136
|
+
(experimental hunk-level split mode)
|
|
137
|
+
|
|
138
|
+
Proposed 2 commits:
|
|
139
|
+
|
|
140
|
+
1. fix: correct error handling in auth
|
|
141
|
+
- src/auth.ts:1
|
|
142
|
+
- src/auth.ts:2
|
|
143
|
+
|
|
144
|
+
2. feat: add logging middleware
|
|
145
|
+
- src/auth.ts:3
|
|
146
|
+
- src/middleware.ts:1
|
|
147
|
+
|
|
148
|
+
Proceed with these 2 commits? (Y/n)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
This is useful when a single file contains multiple unrelated changes. If something goes wrong, the tool will automatically rollback all commits.
|
|
152
|
+
|
|
153
|
+
**Note:** This is experimental. Use `--dry-run` first to preview the proposed split.
|
|
154
|
+
|
|
155
|
+
## Commit message prefix
|
|
156
|
+
|
|
157
|
+
Add a prefix (like a ticket number) to all commit messages:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
aicmt commit --prefix "DEV-95: "
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The AI generates the commit message, then the prefix is added programmatically:
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
DEV-95: fix: update validation logic
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
This works with all modes:
|
|
170
|
+
|
|
171
|
+
- `--prefix "JIRA-123: "`: Standard commit with prefix
|
|
172
|
+
- `--prefix "TASK-456: " --split`: All split commits get the prefix
|
|
173
|
+
- `--prefix "FIX-789: " -y`: Auto-commit with prefix
|
|
174
|
+
|
|
175
|
+
The prefix is not sent to the AI, it's applied as post-processing to the generated message.
|
|
83
176
|
|
|
84
177
|
## Config format
|
|
85
178
|
|