geeto 0.6.6 → 0.9.0
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 +23 -9
- package/lib/api/copilot-adapter.d.ts +14 -5
- package/lib/api/copilot-adapter.d.ts.map +1 -1
- package/lib/api/copilot-adapter.js +15 -21
- package/lib/api/copilot-adapter.js.map +1 -1
- package/lib/api/copilot-sdk.d.ts +3 -16
- package/lib/api/copilot-sdk.d.ts.map +1 -1
- package/lib/api/copilot-sdk.js +166 -456
- package/lib/api/copilot-sdk.js.map +1 -1
- package/lib/api/copilot.d.ts +3 -4
- package/lib/api/copilot.d.ts.map +1 -1
- package/lib/api/copilot.js +28 -28
- package/lib/api/copilot.js.map +1 -1
- package/lib/api/gemini-sdk.d.ts.map +1 -1
- package/lib/api/gemini-sdk.js +11 -77
- package/lib/api/gemini-sdk.js.map +1 -1
- package/lib/api/gemini.d.ts +2 -2
- package/lib/api/gemini.d.ts.map +1 -1
- package/lib/api/gemini.js +24 -19
- package/lib/api/gemini.js.map +1 -1
- package/lib/api/gitlab.d.ts +80 -0
- package/lib/api/gitlab.d.ts.map +1 -0
- package/lib/api/gitlab.js +192 -0
- package/lib/api/gitlab.js.map +1 -0
- package/lib/api/openrouter-sdk.d.ts.map +1 -1
- package/lib/api/openrouter-sdk.js +11 -76
- package/lib/api/openrouter-sdk.js.map +1 -1
- package/lib/api/openrouter.d.ts.map +1 -1
- package/lib/api/openrouter.js +2 -16
- package/lib/api/openrouter.js.map +1 -1
- package/lib/api/platform.d.ts +78 -0
- package/lib/api/platform.d.ts.map +1 -0
- package/lib/api/platform.js +218 -0
- package/lib/api/platform.js.map +1 -0
- package/lib/cli/input.d.ts +2 -2
- package/lib/cli/input.d.ts.map +1 -1
- package/lib/cli/input.js +23 -27
- package/lib/cli/input.js.map +1 -1
- package/lib/cli/menu.d.ts +1 -1
- package/lib/cli/menu.d.ts.map +1 -1
- package/lib/cli/menu.js +123 -100
- package/lib/cli/menu.js.map +1 -1
- package/lib/core/copilot-setup.d.ts +8 -7
- package/lib/core/copilot-setup.d.ts.map +1 -1
- package/lib/core/copilot-setup.js +59 -230
- package/lib/core/copilot-setup.js.map +1 -1
- package/lib/core/gemini-setup.js +7 -7
- package/lib/core/gemini-setup.js.map +1 -1
- package/lib/core/gitlab-setup.d.ts +5 -0
- package/lib/core/gitlab-setup.d.ts.map +1 -0
- package/lib/core/gitlab-setup.js +85 -0
- package/lib/core/gitlab-setup.js.map +1 -0
- package/lib/core/openrouter-setup.d.ts.map +1 -1
- package/lib/core/openrouter-setup.js +17 -0
- package/lib/core/openrouter-setup.js.map +1 -1
- package/lib/index.js +501 -704
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +10 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/utils/ai-provider-helpers.d.ts +5 -0
- package/lib/utils/ai-provider-helpers.d.ts.map +1 -0
- package/lib/utils/ai-provider-helpers.js +23 -0
- package/lib/utils/ai-provider-helpers.js.map +1 -0
- package/lib/utils/ai-text.d.ts +23 -0
- package/lib/utils/ai-text.d.ts.map +1 -0
- package/lib/utils/ai-text.js +57 -0
- package/lib/utils/ai-text.js.map +1 -0
- package/lib/utils/ai-workflow.d.ts +18 -0
- package/lib/utils/ai-workflow.d.ts.map +1 -0
- package/lib/utils/ai-workflow.js +66 -0
- package/lib/utils/ai-workflow.js.map +1 -0
- package/lib/utils/branch-naming.d.ts.map +1 -1
- package/lib/utils/branch-naming.js +1 -3
- package/lib/utils/branch-naming.js.map +1 -1
- package/lib/utils/config.d.ts +13 -1
- package/lib/utils/config.d.ts.map +1 -1
- package/lib/utils/config.js +38 -1
- package/lib/utils/config.js.map +1 -1
- package/lib/utils/display.d.ts.map +1 -1
- package/lib/utils/display.js +4 -3
- package/lib/utils/display.js.map +1 -1
- package/lib/utils/git-ai.js +13 -13
- package/lib/utils/git-ai.js.map +1 -1
- package/lib/utils/git-errors.d.ts.map +1 -1
- package/lib/utils/git-errors.js +2 -6
- package/lib/utils/git-errors.js.map +1 -1
- package/lib/utils/git.d.ts.map +1 -1
- package/lib/utils/git.js +5 -0
- package/lib/utils/git.js.map +1 -1
- package/lib/utils/github-helpers.d.ts +33 -0
- package/lib/utils/github-helpers.d.ts.map +1 -0
- package/lib/utils/github-helpers.js +101 -0
- package/lib/utils/github-helpers.js.map +1 -0
- package/lib/utils/prompt-loader.d.ts +9 -0
- package/lib/utils/prompt-loader.d.ts.map +1 -0
- package/lib/utils/prompt-loader.js +42 -0
- package/lib/utils/prompt-loader.js.map +1 -0
- package/lib/utils/prompts-embedded.d.ts +2 -0
- package/lib/utils/prompts-embedded.d.ts.map +1 -0
- package/lib/utils/prompts-embedded.js +255 -0
- package/lib/utils/prompts-embedded.js.map +1 -0
- package/lib/utils/scramble.d.ts +9 -86
- package/lib/utils/scramble.d.ts.map +1 -1
- package/lib/utils/scramble.js +27 -279
- package/lib/utils/scramble.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/workflows/alias.d.ts.map +1 -1
- package/lib/workflows/alias.js +1 -0
- package/lib/workflows/alias.js.map +1 -1
- package/lib/workflows/amend.d.ts.map +1 -1
- package/lib/workflows/amend.js +1 -5
- package/lib/workflows/amend.js.map +1 -1
- package/lib/workflows/branch-helpers.d.ts.map +1 -1
- package/lib/workflows/branch-helpers.js +0 -1
- package/lib/workflows/branch-helpers.js.map +1 -1
- package/lib/workflows/commit.d.ts.map +1 -1
- package/lib/workflows/commit.js +160 -187
- package/lib/workflows/commit.js.map +1 -1
- package/lib/workflows/doctor.d.ts +7 -0
- package/lib/workflows/doctor.d.ts.map +1 -0
- package/lib/workflows/doctor.js +284 -0
- package/lib/workflows/doctor.js.map +1 -0
- package/lib/workflows/issue.d.ts +1 -1
- package/lib/workflows/issue.d.ts.map +1 -1
- package/lib/workflows/issue.js +28 -115
- package/lib/workflows/issue.js.map +1 -1
- package/lib/workflows/main-helpers.d.ts +34 -0
- package/lib/workflows/main-helpers.d.ts.map +1 -0
- package/lib/workflows/main-helpers.js +346 -0
- package/lib/workflows/main-helpers.js.map +1 -0
- package/lib/workflows/main-steps.d.ts.map +1 -1
- package/lib/workflows/main-steps.js +9 -134
- package/lib/workflows/main-steps.js.map +1 -1
- package/lib/workflows/main.d.ts +2 -6
- package/lib/workflows/main.d.ts.map +1 -1
- package/lib/workflows/main.js +44 -381
- package/lib/workflows/main.js.map +1 -1
- package/lib/workflows/pr.d.ts +2 -2
- package/lib/workflows/pr.d.ts.map +1 -1
- package/lib/workflows/pr.js +49 -137
- package/lib/workflows/pr.js.map +1 -1
- package/lib/workflows/prune.d.ts.map +1 -1
- package/lib/workflows/prune.js +2 -10
- package/lib/workflows/prune.js.map +1 -1
- package/lib/workflows/pull.d.ts.map +1 -1
- package/lib/workflows/pull.js +2 -24
- package/lib/workflows/pull.js.map +1 -1
- package/lib/workflows/release-merge.d.ts +12 -0
- package/lib/workflows/release-merge.d.ts.map +1 -0
- package/lib/workflows/release-merge.js +569 -0
- package/lib/workflows/release-merge.js.map +1 -0
- package/lib/workflows/release-notes.d.ts +13 -0
- package/lib/workflows/release-notes.d.ts.map +1 -0
- package/lib/workflows/release-notes.js +141 -0
- package/lib/workflows/release-notes.js.map +1 -0
- package/lib/workflows/release-recover.d.ts +5 -0
- package/lib/workflows/release-recover.d.ts.map +1 -0
- package/lib/workflows/release-recover.js +137 -0
- package/lib/workflows/release-recover.js.map +1 -0
- package/lib/workflows/release-sync.d.ts +7 -0
- package/lib/workflows/release-sync.d.ts.map +1 -0
- package/lib/workflows/release-sync.js +321 -0
- package/lib/workflows/release-sync.js.map +1 -0
- package/lib/workflows/release-utils.d.ts +36 -0
- package/lib/workflows/release-utils.d.ts.map +1 -0
- package/lib/workflows/release-utils.js +150 -0
- package/lib/workflows/release-utils.js.map +1 -0
- package/lib/workflows/release.d.ts.map +1 -1
- package/lib/workflows/release.js +92 -719
- package/lib/workflows/release.js.map +1 -1
- package/lib/workflows/repo-settings.d.ts +2 -2
- package/lib/workflows/repo-settings.d.ts.map +1 -1
- package/lib/workflows/repo-settings.js +33 -24
- package/lib/workflows/repo-settings.js.map +1 -1
- package/lib/workflows/reword.d.ts.map +1 -1
- package/lib/workflows/reword.js +154 -151
- package/lib/workflows/reword.js.map +1 -1
- package/lib/workflows/security-gate.d.ts.map +1 -1
- package/lib/workflows/security-gate.js +15 -75
- package/lib/workflows/security-gate.js.map +1 -1
- package/lib/workflows/settings.d.ts +2 -1
- package/lib/workflows/settings.d.ts.map +1 -1
- package/lib/workflows/settings.js +289 -19
- package/lib/workflows/settings.js.map +1 -1
- package/lib/workflows/trello-menu.d.ts +2 -5
- package/lib/workflows/trello-menu.d.ts.map +1 -1
- package/lib/workflows/trello-menu.js +67 -228
- package/lib/workflows/trello-menu.js.map +1 -1
- package/package.json +3 -6
- package/prompts/branch-name-prompt.md +4 -0
- package/prompts/commit-message-prompt.md +12 -0
- package/prompts/issue-prompt.md +19 -0
- package/prompts/issue-review.with-context.prompt.yml +77 -0
- package/prompts/pr-prompt.md +14 -0
- package/prompts/release-notes-prompt.md +35 -0
- package/prompts/repo-description-prompt.md +1 -0
- package/prompts/security-gate-prompt.md +80 -0
package/lib/index.js
CHANGED
|
@@ -1,732 +1,529 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* Geeto - Git flow automation CLI tool with AI-powered branch naming
|
|
4
|
-
* Main entry point - delegates to modular workflows
|
|
4
|
+
* Main entry point - delegates to modular workflows via command registry
|
|
5
5
|
*/
|
|
6
|
-
import path from 'node:path';
|
|
7
6
|
import { VERSION } from './version.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Registry of all standalone commands.
|
|
9
|
+
* Order determines priority when multiple flags are passed.
|
|
10
|
+
*/
|
|
11
|
+
const COMMAND_REGISTRY = [
|
|
12
|
+
// Git tools
|
|
13
|
+
{
|
|
14
|
+
flag: '--abort',
|
|
15
|
+
alias: undefined,
|
|
16
|
+
module: './workflows/abort.js',
|
|
17
|
+
handler: 'handleAbort',
|
|
18
|
+
errorLabel: 'Abort',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
flag: '--pull',
|
|
22
|
+
alias: '-pl',
|
|
23
|
+
module: './workflows/pull.js',
|
|
24
|
+
handler: 'handlePull',
|
|
25
|
+
errorLabel: 'Pull',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
flag: '--prune',
|
|
29
|
+
alias: undefined,
|
|
30
|
+
module: './workflows/prune.js',
|
|
31
|
+
handler: 'handlePrune',
|
|
32
|
+
errorLabel: 'Prune',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
flag: '--fetch',
|
|
36
|
+
alias: '-ft',
|
|
37
|
+
module: './workflows/fetch.js',
|
|
38
|
+
handler: 'handleFetch',
|
|
39
|
+
errorLabel: 'Fetch',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
flag: '--status',
|
|
43
|
+
alias: '-st',
|
|
44
|
+
module: './workflows/status.js',
|
|
45
|
+
handler: 'handleStatus',
|
|
46
|
+
errorLabel: 'Status',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
flag: '--revert',
|
|
50
|
+
alias: '-rv',
|
|
51
|
+
module: './workflows/revert.js',
|
|
52
|
+
handler: 'handleRevert',
|
|
53
|
+
errorLabel: 'Revert',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
flag: '--alias',
|
|
57
|
+
alias: '-al',
|
|
58
|
+
module: './workflows/alias.js',
|
|
59
|
+
handler: 'handleAlias',
|
|
60
|
+
errorLabel: 'Alias',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
flag: '--reword',
|
|
64
|
+
alias: '-rw',
|
|
65
|
+
module: './workflows/reword.js',
|
|
66
|
+
handler: 'handleReword',
|
|
67
|
+
errorLabel: 'Reword',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
flag: '--cleanup',
|
|
71
|
+
alias: '-cl',
|
|
72
|
+
module: './workflows/cleanup.js',
|
|
73
|
+
handler: 'handleInteractiveCleanup',
|
|
74
|
+
errorLabel: 'Cleanup',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
flag: '--switch',
|
|
78
|
+
alias: '-sw',
|
|
79
|
+
module: './workflows/switch.js',
|
|
80
|
+
handler: 'handleBranchSwitch',
|
|
81
|
+
errorLabel: 'Switch',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
flag: '--compare',
|
|
85
|
+
alias: '-cmp',
|
|
86
|
+
module: './workflows/compare.js',
|
|
87
|
+
handler: 'handleBranchCompare',
|
|
88
|
+
errorLabel: 'Compare',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
flag: '--cherry-pick',
|
|
92
|
+
alias: '-cp',
|
|
93
|
+
module: './workflows/cherry-pick.js',
|
|
94
|
+
handler: 'handleCherryPick',
|
|
95
|
+
errorLabel: 'Cherry-pick',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
flag: '--pr',
|
|
99
|
+
alias: '-pr',
|
|
100
|
+
module: './workflows/pr.js',
|
|
101
|
+
handler: 'handleCreatePR',
|
|
102
|
+
errorLabel: 'PR',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
flag: '--issue',
|
|
106
|
+
alias: '-i',
|
|
107
|
+
module: './workflows/issue.js',
|
|
108
|
+
handler: 'handleCreateIssue',
|
|
109
|
+
errorLabel: 'Issue',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
flag: '--log',
|
|
113
|
+
alias: '-lg',
|
|
114
|
+
module: './workflows/history.js',
|
|
115
|
+
handler: 'handleHistory',
|
|
116
|
+
errorLabel: 'History',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
flag: '--stash',
|
|
120
|
+
alias: '-sh',
|
|
121
|
+
module: './workflows/stash.js',
|
|
122
|
+
handler: 'handleStash',
|
|
123
|
+
errorLabel: 'Stash',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
flag: '--amend',
|
|
127
|
+
alias: '-am',
|
|
128
|
+
module: './workflows/amend.js',
|
|
129
|
+
handler: 'handleAmend',
|
|
130
|
+
errorLabel: 'Amend',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
flag: '--stats',
|
|
134
|
+
alias: '-sts',
|
|
135
|
+
module: './workflows/stats.js',
|
|
136
|
+
handler: 'handleStats',
|
|
137
|
+
errorLabel: 'Stats',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
flag: '--undo',
|
|
141
|
+
alias: '-u',
|
|
142
|
+
module: './workflows/undo.js',
|
|
143
|
+
handler: 'handleUndo',
|
|
144
|
+
errorLabel: 'Undo',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
flag: '--tag',
|
|
148
|
+
alias: '-t',
|
|
149
|
+
module: './workflows/release.js',
|
|
150
|
+
handler: 'handleRelease',
|
|
151
|
+
errorLabel: 'Release',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
flag: '--repo',
|
|
155
|
+
alias: '-rp',
|
|
156
|
+
module: './workflows/repo-settings.js',
|
|
157
|
+
handler: 'handleRepoSettings',
|
|
158
|
+
errorLabel: 'Repo settings',
|
|
159
|
+
},
|
|
160
|
+
// Trello
|
|
161
|
+
{
|
|
162
|
+
flag: '--trello',
|
|
163
|
+
alias: '-tr',
|
|
164
|
+
module: './workflows/trello-menu.js',
|
|
165
|
+
handler: 'showTrelloMenu',
|
|
166
|
+
errorLabel: 'Trello menu',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
flag: '--trello-generate',
|
|
170
|
+
alias: '-tg',
|
|
171
|
+
module: './workflows/trello-menu.js',
|
|
172
|
+
handler: 'handleGenerateTaskInstructions',
|
|
173
|
+
errorLabel: 'Trello generate',
|
|
174
|
+
},
|
|
175
|
+
// Settings
|
|
176
|
+
{
|
|
177
|
+
flag: '--separator',
|
|
178
|
+
alias: undefined,
|
|
179
|
+
module: './workflows/settings.js',
|
|
180
|
+
handler: 'handleSeparatorSetting',
|
|
181
|
+
errorLabel: 'Settings',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
flag: '--sync-models',
|
|
185
|
+
alias: undefined,
|
|
186
|
+
module: './workflows/settings.js',
|
|
187
|
+
handler: 'handleModelResetSetting',
|
|
188
|
+
errorLabel: 'Settings',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
flag: '--change-model',
|
|
192
|
+
alias: undefined,
|
|
193
|
+
module: './workflows/settings.js',
|
|
194
|
+
handler: 'handleChangeModelSetting',
|
|
195
|
+
errorLabel: 'Settings',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
flag: '--setup-gemini',
|
|
199
|
+
alias: undefined,
|
|
200
|
+
module: './workflows/settings.js',
|
|
201
|
+
handler: 'handleGeminiSetting',
|
|
202
|
+
errorLabel: 'Settings',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
flag: '--setup-openrouter',
|
|
206
|
+
alias: undefined,
|
|
207
|
+
module: './workflows/settings.js',
|
|
208
|
+
handler: 'handleOpenRouterSetting',
|
|
209
|
+
errorLabel: 'Settings',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
flag: '--setup-trello',
|
|
213
|
+
alias: undefined,
|
|
214
|
+
module: './workflows/settings.js',
|
|
215
|
+
handler: 'handleTrelloSetting',
|
|
216
|
+
errorLabel: 'Settings',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
flag: '--setup-github',
|
|
220
|
+
alias: undefined,
|
|
221
|
+
module: './core/github-setup.js',
|
|
222
|
+
handler: 'setupGithubConfigInteractive',
|
|
223
|
+
errorLabel: 'Settings',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
flag: '--setup-gitlab',
|
|
227
|
+
alias: undefined,
|
|
228
|
+
module: './core/gitlab-setup.js',
|
|
229
|
+
handler: 'setupGitlabConfigInteractive',
|
|
230
|
+
errorLabel: 'Settings',
|
|
231
|
+
},
|
|
232
|
+
// Doctor / Info
|
|
233
|
+
{
|
|
234
|
+
flag: '--uninstall',
|
|
235
|
+
alias: undefined,
|
|
236
|
+
module: './workflows/doctor.js',
|
|
237
|
+
handler: 'handleUninstall',
|
|
238
|
+
errorLabel: 'Uninstall',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
flag: '--where',
|
|
242
|
+
alias: undefined,
|
|
243
|
+
module: './workflows/doctor.js',
|
|
244
|
+
handler: 'handleWhereInstalled',
|
|
245
|
+
errorLabel: 'Where',
|
|
246
|
+
},
|
|
247
|
+
];
|
|
248
|
+
/** Flags that set the `startAt` step for the main workflow */
|
|
249
|
+
const START_AT_FLAGS = [
|
|
250
|
+
{ flag: '--commit', alias: '-c', startAt: 'commit' },
|
|
251
|
+
{ flag: '--merge', alias: '-m', startAt: 'merge' },
|
|
252
|
+
{ flag: '--branch', alias: '-b', startAt: 'branch' },
|
|
253
|
+
{ flag: '--stage', alias: '-s', startAt: 'stage' },
|
|
254
|
+
{ flag: '--push', alias: '-p', startAt: 'push' },
|
|
255
|
+
];
|
|
256
|
+
/** Modifier flags that don't trigger a command on their own */
|
|
257
|
+
const MODIFIER_FLAGS = [
|
|
258
|
+
{ flag: '--fresh', alias: '-f' },
|
|
259
|
+
{ flag: '--resume', alias: '-r' },
|
|
260
|
+
{ flag: '--version', alias: '-v' },
|
|
261
|
+
{ flag: '--help', alias: '-h' },
|
|
262
|
+
{ flag: '--dry-run', alias: '-dr' },
|
|
263
|
+
];
|
|
264
|
+
// ─── Valid Flags (auto-generated from registries) ────────────────────
|
|
265
|
+
function buildValidFlags() {
|
|
266
|
+
const flags = new Set();
|
|
267
|
+
for (const cmd of COMMAND_REGISTRY) {
|
|
268
|
+
flags.add(cmd.flag);
|
|
269
|
+
if (cmd.alias)
|
|
270
|
+
flags.add(cmd.alias);
|
|
271
|
+
}
|
|
272
|
+
for (const sf of START_AT_FLAGS) {
|
|
273
|
+
flags.add(sf.flag);
|
|
274
|
+
flags.add(sf.alias);
|
|
275
|
+
}
|
|
276
|
+
// Special compound aliases
|
|
277
|
+
flags.add('-sa');
|
|
278
|
+
flags.add('-as');
|
|
279
|
+
for (const mf of MODIFIER_FLAGS) {
|
|
280
|
+
flags.add(mf.flag);
|
|
281
|
+
flags.add(mf.alias);
|
|
282
|
+
}
|
|
283
|
+
return flags;
|
|
265
284
|
}
|
|
266
|
-
;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
console.log(` ${B}USAGE${R}`);
|
|
282
|
-
console.log(` ${C}geeto${R} ${G}[command] [options]${R}`);
|
|
283
|
-
console.log('');
|
|
284
|
-
console.log(` ${B}WORKFLOW${R}`);
|
|
285
|
-
console.log(` ${C}-s, --stage${R} Stage files interactively`);
|
|
286
|
-
console.log(` ${C}-sa, -as${R} Stage all changes automatically`);
|
|
287
|
-
console.log(` ${C}-c, --commit${R} Create a commit with AI message`);
|
|
288
|
-
console.log(` ${C}-b, --branch${R} Create a branch with AI name`);
|
|
289
|
-
console.log(` ${C}-p, --push${R} Push current branch to remote`);
|
|
290
|
-
console.log(` ${C}-m, --merge${R} Merge branches interactively`);
|
|
291
|
-
console.log('');
|
|
292
|
-
console.log(` ${B}GIT TOOLS${R}`);
|
|
293
|
-
console.log(` ${C}-cl, --cleanup${R} Clean up local & remote branches`);
|
|
294
|
-
console.log(` ${C}-sw, --switch${R} Switch branches with fuzzy search`);
|
|
295
|
-
console.log(` ${C}-cmp, --compare${R} Compare current branch with another`);
|
|
296
|
-
console.log(` ${C}-cp, --cherry-pick${R} Cherry-pick from another branch`);
|
|
297
|
-
console.log(` ${C}-lg, --log${R} View commit history with timeline`);
|
|
298
|
-
console.log(` ${C}-sh, --stash${R} Manage stashes interactively`);
|
|
299
|
-
console.log(` ${C}-am, --amend${R} Amend the last commit`);
|
|
300
|
-
console.log(` ${C}-u, --undo${R} Undo the last git action safely`);
|
|
301
|
-
console.log(` ${C}-rv, --revert${R} Revert the last commit (soft reset)`);
|
|
302
|
-
console.log(` ${C}-al, --alias${R} Install shell aliases for geeto`);
|
|
303
|
-
console.log(` ${C}-rw, --reword${R} Edit past commit messages`);
|
|
304
|
-
console.log(` ${C}-sts, --stats${R} Repository statistics dashboard`);
|
|
305
|
-
console.log(` ${C} --abort${R} Abort in-progress operation`);
|
|
306
|
-
console.log(` ${C}-pl, --pull${R} Pull from remote interactively`);
|
|
307
|
-
console.log(` ${C}-ft, --fetch${R} Fetch latest from remote`);
|
|
308
|
-
console.log(` ${C} --prune${R} Remove stale remote branches`);
|
|
309
|
-
console.log(` ${C}-st, --status${R} Pretty git status overview`);
|
|
310
|
-
console.log('');
|
|
311
|
-
console.log(` ${B}GITHUB${R}`);
|
|
312
|
-
console.log(` ${C}-pr, --pr${R} Create a Pull Request`);
|
|
313
|
-
console.log(` ${C}-i, --issue${R} Create an Issue`);
|
|
314
|
-
console.log(` ${C}-t, --tag${R} Release & tag manager with semver`);
|
|
315
|
-
console.log(` ${C}-rp, --repo${R} Update GitHub repo settings`);
|
|
316
|
-
console.log('');
|
|
317
|
-
console.log(` ${B}TRELLO${R}`);
|
|
318
|
-
console.log(` ${C}-tr, --trello${R} Open Trello menu`);
|
|
319
|
-
console.log(` ${C}-tl, --trello-list${R} List boards and lists`);
|
|
320
|
-
console.log(` ${C}-tg, --trello-generate${R} Generate tasks from Trello`);
|
|
321
|
-
console.log('');
|
|
322
|
-
console.log(` ${B}SETTINGS${R}`);
|
|
323
|
-
console.log(` ${C} --setup-gemini${R} Configure Gemini AI`);
|
|
324
|
-
console.log(` ${C} --setup-openrouter${R} Configure OpenRouter AI`);
|
|
325
|
-
console.log(` ${C} --setup-github${R} Configure GitHub token`);
|
|
326
|
-
console.log(` ${C} --setup-trello${R} Configure Trello integration`);
|
|
327
|
-
console.log(` ${C} --change-model${R} Switch AI provider / model`);
|
|
328
|
-
console.log(` ${C} --sync-models${R} Fetch latest model list`);
|
|
329
|
-
console.log(` ${C} --separator${R} Set branch name separator`);
|
|
330
|
-
console.log('');
|
|
331
|
-
console.log(` ${B}OPTIONS${R}`);
|
|
332
|
-
console.log(` ${C}-f, --fresh${R} Start fresh (ignore checkpoint)`);
|
|
333
|
-
console.log(` ${C}-r, --resume${R} Resume from last checkpoint`);
|
|
334
|
-
console.log(` ${C}-dr, --dry-run${R} Simulate commands without executing`);
|
|
335
|
-
console.log(` ${C}-v, --version${R} Show version`);
|
|
336
|
-
console.log(` ${C}-h, --help${R} Show this help message`);
|
|
337
|
-
console.log('');
|
|
338
|
-
console.log(` ${B}EDITOR${R}`);
|
|
339
|
-
console.log(` ${C}geeto <file>${R} Open file in inline editor`);
|
|
340
|
-
console.log('');
|
|
341
|
-
process.exit(0);
|
|
342
|
-
}
|
|
343
|
-
// Dry-run mode handling
|
|
344
|
-
if (dryRunMode) {
|
|
345
|
-
const { setDryRun, printDryRunBanner, printDryRunSummary } = await import('./utils/dry-run.js');
|
|
346
|
-
const hasOtherCommand = startAt !== undefined ||
|
|
347
|
-
showCleanup ||
|
|
348
|
-
showSwitch ||
|
|
349
|
-
showCompare ||
|
|
350
|
-
showCherryPick ||
|
|
351
|
-
showPR ||
|
|
352
|
-
showIssue ||
|
|
353
|
-
showHistory ||
|
|
354
|
-
showStash ||
|
|
355
|
-
showAmend ||
|
|
356
|
-
showStats ||
|
|
357
|
-
showUndo ||
|
|
358
|
-
showRelease ||
|
|
359
|
-
showRepoSettings ||
|
|
360
|
-
showTrello ||
|
|
361
|
-
showTrelloLists ||
|
|
362
|
-
showTrelloGenerate ||
|
|
363
|
-
showAbort ||
|
|
364
|
-
showPull ||
|
|
365
|
-
showPrune ||
|
|
366
|
-
showFetch ||
|
|
367
|
-
showStatus ||
|
|
368
|
-
showRevert ||
|
|
369
|
-
showAlias ||
|
|
370
|
-
showReword ||
|
|
371
|
-
settingsAction !== undefined;
|
|
372
|
-
if (!hasOtherCommand) {
|
|
373
|
-
// Standalone --dry-run: show interactive menu
|
|
374
|
-
try {
|
|
375
|
-
const { handleDryRunMenu } = await import('./workflows/dry-run.js');
|
|
376
|
-
await handleDryRunMenu();
|
|
377
|
-
process.exit(0);
|
|
378
|
-
}
|
|
379
|
-
catch (error) {
|
|
380
|
-
console.error('Dry-run error:', error);
|
|
381
|
-
process.exit(1);
|
|
285
|
+
const validFlags = buildValidFlags();
|
|
286
|
+
function parseArgs(argv) {
|
|
287
|
+
let startAt;
|
|
288
|
+
let fresh = false;
|
|
289
|
+
let resume = false;
|
|
290
|
+
let stageAll = false;
|
|
291
|
+
let dryRunMode = false;
|
|
292
|
+
let showVersion = false;
|
|
293
|
+
let showHelp = false;
|
|
294
|
+
const activeFlags = new Set();
|
|
295
|
+
for (const arg of argv) {
|
|
296
|
+
// Start-at flags (workflow step shortcuts)
|
|
297
|
+
for (const sf of START_AT_FLAGS) {
|
|
298
|
+
if (arg === sf.flag || arg === sf.alias) {
|
|
299
|
+
startAt = sf.startAt;
|
|
382
300
|
}
|
|
383
301
|
}
|
|
384
|
-
//
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
const { editInline } = await import('./cli/input.js');
|
|
405
|
-
const result = await editInline(content, path.basename(editFilePath), path.extname(editFilePath));
|
|
406
|
-
if (result === null) {
|
|
407
|
-
console.log(` \u001B[90m✗ Cancelled\u001B[0m`);
|
|
408
|
-
}
|
|
409
|
-
else {
|
|
410
|
-
fs.writeFileSync(resolved, result + '\n', 'utf8');
|
|
411
|
-
console.log(` \u001B[32m✓\u001B[0m Saved to ${editFilePath}`);
|
|
302
|
+
// Special compound: -sa / -as → stage + stageAll
|
|
303
|
+
if (arg === '-sa' || arg === '-as') {
|
|
304
|
+
startAt = 'stage';
|
|
305
|
+
stageAll = true;
|
|
306
|
+
}
|
|
307
|
+
// Modifier flags
|
|
308
|
+
if (arg === '-f' || arg === '--fresh')
|
|
309
|
+
fresh = true;
|
|
310
|
+
if (arg === '-r' || arg === '--resume')
|
|
311
|
+
resume = true;
|
|
312
|
+
if (arg === '-v' || arg === '--version')
|
|
313
|
+
showVersion = true;
|
|
314
|
+
if (arg === '-h' || arg === '--help')
|
|
315
|
+
showHelp = true;
|
|
316
|
+
if (arg === '--dry-run' || arg === '-dr')
|
|
317
|
+
dryRunMode = true;
|
|
318
|
+
// Command registry lookup
|
|
319
|
+
for (const cmd of COMMAND_REGISTRY) {
|
|
320
|
+
if (arg === cmd.flag || arg === cmd.alias) {
|
|
321
|
+
activeFlags.add(cmd.flag);
|
|
412
322
|
}
|
|
413
|
-
process.exit(0);
|
|
414
|
-
}
|
|
415
|
-
catch (error) {
|
|
416
|
-
console.error('Editor error:', error);
|
|
417
|
-
process.exit(1);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
if (showAbort) {
|
|
421
|
-
try {
|
|
422
|
-
const { handleAbort } = await import('./workflows/abort.js');
|
|
423
|
-
await handleAbort();
|
|
424
|
-
process.exit(0);
|
|
425
|
-
}
|
|
426
|
-
catch (error) {
|
|
427
|
-
console.error('Abort error:', error);
|
|
428
|
-
process.exit(1);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if (showPull) {
|
|
432
|
-
try {
|
|
433
|
-
const { handlePull } = await import('./workflows/pull.js');
|
|
434
|
-
await handlePull();
|
|
435
|
-
process.exit(0);
|
|
436
|
-
}
|
|
437
|
-
catch (error) {
|
|
438
|
-
console.error('Pull error:', error);
|
|
439
|
-
process.exit(1);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
if (showPrune) {
|
|
443
|
-
try {
|
|
444
|
-
const { handlePrune } = await import('./workflows/prune.js');
|
|
445
|
-
await handlePrune();
|
|
446
|
-
process.exit(0);
|
|
447
|
-
}
|
|
448
|
-
catch (error) {
|
|
449
|
-
console.error('Prune error:', error);
|
|
450
|
-
process.exit(1);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
if (showFetch) {
|
|
454
|
-
try {
|
|
455
|
-
const { handleFetch } = await import('./workflows/fetch.js');
|
|
456
|
-
await handleFetch();
|
|
457
|
-
process.exit(0);
|
|
458
|
-
}
|
|
459
|
-
catch (error) {
|
|
460
|
-
console.error('Fetch error:', error);
|
|
461
|
-
process.exit(1);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
if (showStatus) {
|
|
465
|
-
try {
|
|
466
|
-
const { handleStatus } = await import('./workflows/status.js');
|
|
467
|
-
handleStatus();
|
|
468
|
-
process.exit(0);
|
|
469
|
-
}
|
|
470
|
-
catch (error) {
|
|
471
|
-
console.error('Status error:', error);
|
|
472
|
-
process.exit(1);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
if (showRevert) {
|
|
476
|
-
try {
|
|
477
|
-
const { handleRevert } = await import('./workflows/revert.js');
|
|
478
|
-
await handleRevert();
|
|
479
|
-
process.exit(0);
|
|
480
|
-
}
|
|
481
|
-
catch (error) {
|
|
482
|
-
console.error('Revert error:', error);
|
|
483
|
-
process.exit(1);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
if (showAlias) {
|
|
487
|
-
try {
|
|
488
|
-
const { handleAlias } = await import('./workflows/alias.js');
|
|
489
|
-
await handleAlias();
|
|
490
|
-
process.exit(0);
|
|
491
|
-
}
|
|
492
|
-
catch (error) {
|
|
493
|
-
console.error('Alias error:', error);
|
|
494
|
-
process.exit(1);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
if (showReword) {
|
|
498
|
-
try {
|
|
499
|
-
const { handleReword } = await import('./workflows/reword.js');
|
|
500
|
-
await handleReword();
|
|
501
|
-
process.exit(0);
|
|
502
|
-
}
|
|
503
|
-
catch (error) {
|
|
504
|
-
console.error('Reword error:', error);
|
|
505
|
-
process.exit(1);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
if (showCleanup) {
|
|
509
|
-
try {
|
|
510
|
-
const { handleInteractiveCleanup } = await import('./workflows/cleanup.js');
|
|
511
|
-
await handleInteractiveCleanup();
|
|
512
|
-
process.exit(0);
|
|
513
323
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
if (showRepoSettings) {
|
|
324
|
+
// Non-flag argument → ignored
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
startAt,
|
|
328
|
+
fresh,
|
|
329
|
+
resume,
|
|
330
|
+
stageAll,
|
|
331
|
+
dryRunMode,
|
|
332
|
+
showVersion,
|
|
333
|
+
showHelp,
|
|
334
|
+
activeFlags,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
// ─── Help Display ────────────────────────────────────────────────────
|
|
338
|
+
function showHelpMessage() {
|
|
339
|
+
const C = '\u001B[36m'; // cyan
|
|
340
|
+
const B = '\u001B[1m'; // bright/bold
|
|
341
|
+
const G = '\u001B[90m'; // gray
|
|
342
|
+
const R = '\u001B[0m'; // reset
|
|
343
|
+
console.log('');
|
|
344
|
+
console.log(` ${B}Geeto CLI${R} ${G}v${VERSION}${R}`);
|
|
345
|
+
console.log(` ${G}Git flow automation with AI-powered workflows${R}`);
|
|
346
|
+
console.log('');
|
|
347
|
+
console.log(` ${B}USAGE${R}`);
|
|
348
|
+
console.log(` ${C}geeto${R} ${G}[command] [options]${R}`);
|
|
349
|
+
console.log('');
|
|
350
|
+
console.log(` ${B}WORKFLOW${R}`);
|
|
351
|
+
console.log(` ${C}-s, --stage${R} Stage files interactively`);
|
|
352
|
+
console.log(` ${C}-sa, -as${R} Stage all changes automatically`);
|
|
353
|
+
console.log(` ${C}-c, --commit${R} Create a commit with AI message`);
|
|
354
|
+
console.log(` ${C}-b, --branch${R} Create a branch with AI name`);
|
|
355
|
+
console.log(` ${C}-p, --push${R} Push current branch to remote`);
|
|
356
|
+
console.log(` ${C}-m, --merge${R} Merge branches interactively`);
|
|
357
|
+
console.log('');
|
|
358
|
+
console.log(` ${B}GIT TOOLS${R}`);
|
|
359
|
+
console.log(` ${C}-cl, --cleanup${R} Clean up local & remote branches`);
|
|
360
|
+
console.log(` ${C}-sw, --switch${R} Switch branches with fuzzy search`);
|
|
361
|
+
console.log(` ${C}-cmp, --compare${R} Compare current branch with another`);
|
|
362
|
+
console.log(` ${C}-cp, --cherry-pick${R} Cherry-pick from another branch`);
|
|
363
|
+
console.log(` ${C}-lg, --log${R} View commit history with timeline`);
|
|
364
|
+
console.log(` ${C}-sh, --stash${R} Manage stashes interactively`);
|
|
365
|
+
console.log(` ${C}-am, --amend${R} Amend the last commit`);
|
|
366
|
+
console.log(` ${C}-u, --undo${R} Undo the last git action safely`);
|
|
367
|
+
console.log(` ${C}-rv, --revert${R} Revert the last commit (soft reset)`);
|
|
368
|
+
console.log(` ${C}-al, --alias${R} Install shell aliases for geeto`);
|
|
369
|
+
console.log(` ${C}-rw, --reword${R} Edit past commit messages`);
|
|
370
|
+
console.log(` ${C}-sts, --stats${R} Repository statistics dashboard`);
|
|
371
|
+
console.log(` ${C} --abort${R} Abort in-progress operation`);
|
|
372
|
+
console.log(` ${C}-pl, --pull${R} Pull from remote interactively`);
|
|
373
|
+
console.log(` ${C}-ft, --fetch${R} Fetch latest from remote`);
|
|
374
|
+
console.log(` ${C} --prune${R} Remove stale remote branches`);
|
|
375
|
+
console.log(` ${C}-st, --status${R} Pretty git status overview`);
|
|
376
|
+
console.log('');
|
|
377
|
+
console.log(` ${B}GITHUB / GITLAB${R}`);
|
|
378
|
+
console.log(` ${C}-pr, --pr${R} Create a Pull Request / Merge Request`);
|
|
379
|
+
console.log(` ${C}-i, --issue${R} Create an Issue`);
|
|
380
|
+
console.log(` ${C}-t, --tag${R} Release & tag manager with semver`);
|
|
381
|
+
console.log(` ${C}-rp, --repo${R} Update repo settings`);
|
|
382
|
+
console.log('');
|
|
383
|
+
console.log(` ${B}TRELLO${R}`);
|
|
384
|
+
console.log(` ${C}-tr, --trello${R} Open Trello menu`);
|
|
385
|
+
console.log(` ${C}-tl, --trello-list${R} List boards and lists`);
|
|
386
|
+
console.log(` ${C}-tg, --trello-generate${R} Generate tasks from Trello`);
|
|
387
|
+
console.log('');
|
|
388
|
+
console.log(` ${B}SETTINGS${R}`);
|
|
389
|
+
console.log(` ${C} --setup-gemini${R} Configure Gemini AI`);
|
|
390
|
+
console.log(` ${C} --setup-openrouter${R} Configure OpenRouter AI`);
|
|
391
|
+
console.log(` ${C} --setup-github${R} Configure GitHub token`);
|
|
392
|
+
console.log(` ${C} --setup-gitlab${R} Configure GitLab token`);
|
|
393
|
+
console.log(` ${C} --setup-trello${R} Configure Trello integration`);
|
|
394
|
+
console.log(` ${C} --change-model${R} Switch AI provider / model`);
|
|
395
|
+
console.log(` ${C} --sync-models${R} Fetch latest model list`);
|
|
396
|
+
console.log(` ${C} --separator${R} Set branch name separator`);
|
|
397
|
+
console.log('');
|
|
398
|
+
console.log(` ${B}OPTIONS${R}`);
|
|
399
|
+
console.log(` ${C}-f, --fresh${R} Start fresh (ignore checkpoint)`);
|
|
400
|
+
console.log(` ${C}-r, --resume${R} Resume from last checkpoint`);
|
|
401
|
+
console.log(` ${C}-dr, --dry-run${R} Simulate commands without executing`);
|
|
402
|
+
console.log(` ${C}-v, --version${R} Show version`);
|
|
403
|
+
console.log(` ${C}-h, --help${R} Show this help message`);
|
|
404
|
+
console.log('');
|
|
405
|
+
console.log(` ${B}INFO${R}`);
|
|
406
|
+
console.log(` ${C} --where${R} Show installation path & method`);
|
|
407
|
+
console.log(` ${C} --uninstall${R} Uninstall geeto CLI`);
|
|
408
|
+
console.log('');
|
|
409
|
+
}
|
|
410
|
+
// ─── Command Execution ───────────────────────────────────────────────
|
|
411
|
+
/**
|
|
412
|
+
* Static module map for compiled binary compatibility.
|
|
413
|
+
* Bun's compiler can only resolve string-literal dynamic imports — variable
|
|
414
|
+
* paths like `import(cmd.module)` won't be bundled. This map provides
|
|
415
|
+
* explicit string-literal imports that the compiler CAN resolve.
|
|
416
|
+
*/
|
|
417
|
+
const MODULE_LOADERS = {
|
|
418
|
+
'./workflows/abort.js': () => import('./workflows/abort.js'),
|
|
419
|
+
'./workflows/pull.js': () => import('./workflows/pull.js'),
|
|
420
|
+
'./workflows/prune.js': () => import('./workflows/prune.js'),
|
|
421
|
+
'./workflows/fetch.js': () => import('./workflows/fetch.js'),
|
|
422
|
+
'./workflows/status.js': () => import('./workflows/status.js'),
|
|
423
|
+
'./workflows/revert.js': () => import('./workflows/revert.js'),
|
|
424
|
+
'./workflows/alias.js': () => import('./workflows/alias.js'),
|
|
425
|
+
'./workflows/reword.js': () => import('./workflows/reword.js'),
|
|
426
|
+
'./workflows/cleanup.js': () => import('./workflows/cleanup.js'),
|
|
427
|
+
'./workflows/switch.js': () => import('./workflows/switch.js'),
|
|
428
|
+
'./workflows/compare.js': () => import('./workflows/compare.js'),
|
|
429
|
+
'./workflows/cherry-pick.js': () => import('./workflows/cherry-pick.js'),
|
|
430
|
+
'./workflows/pr.js': () => import('./workflows/pr.js'),
|
|
431
|
+
'./workflows/issue.js': () => import('./workflows/issue.js'),
|
|
432
|
+
'./workflows/history.js': () => import('./workflows/history.js'),
|
|
433
|
+
'./workflows/stash.js': () => import('./workflows/stash.js'),
|
|
434
|
+
'./workflows/amend.js': () => import('./workflows/amend.js'),
|
|
435
|
+
'./workflows/stats.js': () => import('./workflows/stats.js'),
|
|
436
|
+
'./workflows/undo.js': () => import('./workflows/undo.js'),
|
|
437
|
+
'./workflows/release.js': () => import('./workflows/release.js'),
|
|
438
|
+
'./workflows/repo-settings.js': () => import('./workflows/repo-settings.js'),
|
|
439
|
+
'./workflows/trello-menu.js': () => import('./workflows/trello-menu.js'),
|
|
440
|
+
'./workflows/settings.js': () => import('./workflows/settings.js'),
|
|
441
|
+
'./core/github-setup.js': () => import('./core/github-setup.js'),
|
|
442
|
+
'./core/gitlab-setup.js': () => import('./core/gitlab-setup.js'),
|
|
443
|
+
'./workflows/doctor.js': () => import('./workflows/doctor.js'),
|
|
444
|
+
};
|
|
445
|
+
async function handleDryRunSetup(args) {
|
|
446
|
+
const { setDryRun, printDryRunBanner, printDryRunSummary } = await import('./utils/dry-run.js');
|
|
447
|
+
const hasOtherCommand = args.startAt !== undefined || args.activeFlags.size > 0;
|
|
448
|
+
if (!hasOtherCommand) {
|
|
449
|
+
// Standalone --dry-run: show interactive menu
|
|
641
450
|
try {
|
|
642
|
-
const {
|
|
643
|
-
await
|
|
451
|
+
const { handleDryRunMenu } = await import('./workflows/dry-run.js');
|
|
452
|
+
await handleDryRunMenu();
|
|
644
453
|
process.exit(0);
|
|
645
454
|
}
|
|
646
455
|
catch (error) {
|
|
647
|
-
console.error('
|
|
456
|
+
console.error('Dry-run error:', error);
|
|
648
457
|
process.exit(1);
|
|
649
458
|
}
|
|
650
459
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
460
|
+
// Combo mode: activate dry-run, let normal routing handle it
|
|
461
|
+
setDryRun(true);
|
|
462
|
+
printDryRunBanner();
|
|
463
|
+
// Wrap process.exit to print summary before exiting
|
|
464
|
+
const originalExit = process.exit;
|
|
465
|
+
process.exit = ((code) => {
|
|
466
|
+
printDryRunSummary();
|
|
467
|
+
originalExit(code);
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
async function executeCommand(args) {
|
|
471
|
+
// 1. Version (instant, no imports)
|
|
472
|
+
if (args.showVersion) {
|
|
473
|
+
console.log(`Geeto v${VERSION}`);
|
|
474
|
+
process.exit(0);
|
|
661
475
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
process.exit(0);
|
|
667
|
-
}
|
|
668
|
-
catch (error) {
|
|
669
|
-
console.error('Trello list error:', error);
|
|
670
|
-
process.exit(1);
|
|
671
|
-
}
|
|
476
|
+
// 2. Help (instant, no imports)
|
|
477
|
+
if (args.showHelp) {
|
|
478
|
+
showHelpMessage();
|
|
479
|
+
process.exit(0);
|
|
672
480
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
await handleGenerateTaskInstructions();
|
|
677
|
-
process.exit(0);
|
|
678
|
-
}
|
|
679
|
-
catch (error) {
|
|
680
|
-
console.error('Trello generate error:', error);
|
|
681
|
-
process.exit(1);
|
|
682
|
-
}
|
|
481
|
+
// 3. Dry-run mode setup (must run before other commands)
|
|
482
|
+
if (args.dryRunMode) {
|
|
483
|
+
await handleDryRunSetup(args);
|
|
683
484
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
case 'change-model': {
|
|
697
|
-
await handleChangeModelSetting();
|
|
698
|
-
break;
|
|
699
|
-
}
|
|
700
|
-
case 'gemini': {
|
|
701
|
-
await handleGeminiSetting();
|
|
702
|
-
break;
|
|
703
|
-
}
|
|
704
|
-
case 'openrouter': {
|
|
705
|
-
await handleOpenRouterSetting();
|
|
706
|
-
break;
|
|
707
|
-
}
|
|
708
|
-
case 'trello': {
|
|
709
|
-
await handleTrelloSetting();
|
|
710
|
-
break;
|
|
711
|
-
}
|
|
712
|
-
case 'github': {
|
|
713
|
-
const { setupGithubConfigInteractive } = await import('./core/github-setup.js');
|
|
714
|
-
setupGithubConfigInteractive();
|
|
715
|
-
break;
|
|
485
|
+
// 4. Registry commands — first match wins
|
|
486
|
+
for (const cmd of COMMAND_REGISTRY) {
|
|
487
|
+
if (args.activeFlags.has(cmd.flag)) {
|
|
488
|
+
try {
|
|
489
|
+
const loader = MODULE_LOADERS[cmd.module];
|
|
490
|
+
if (!loader)
|
|
491
|
+
throw new Error(`No module loader for ${cmd.module}`);
|
|
492
|
+
const mod = (await loader());
|
|
493
|
+
const handlerFn = mod[cmd.handler];
|
|
494
|
+
if (handlerFn) {
|
|
495
|
+
await handlerFn();
|
|
716
496
|
}
|
|
497
|
+
process.exit(0);
|
|
498
|
+
}
|
|
499
|
+
catch (error) {
|
|
500
|
+
console.error(`${cmd.errorLabel} error:`, error);
|
|
501
|
+
process.exit(1);
|
|
717
502
|
}
|
|
718
|
-
process.exit(0);
|
|
719
|
-
}
|
|
720
|
-
catch (error) {
|
|
721
|
-
console.error('Settings error:', error);
|
|
722
|
-
process.exit(1);
|
|
723
503
|
}
|
|
724
504
|
}
|
|
725
|
-
//
|
|
726
|
-
|
|
727
|
-
main({
|
|
505
|
+
// 6. Default: run main workflow
|
|
506
|
+
const { main } = await import('./workflows/main.js');
|
|
507
|
+
main({
|
|
508
|
+
startAt: args.startAt,
|
|
509
|
+
fresh: args.fresh,
|
|
510
|
+
resume: args.resume,
|
|
511
|
+
stageAll: args.stageAll,
|
|
512
|
+
}).catch((error) => {
|
|
728
513
|
console.error('Fatal error:', error);
|
|
729
514
|
process.exit(1);
|
|
730
515
|
});
|
|
731
|
-
}
|
|
516
|
+
}
|
|
517
|
+
// ─── Entry Point ─────────────────────────────────────────────────────
|
|
518
|
+
const argv = process.argv.slice(2);
|
|
519
|
+
// Validate unknown flags
|
|
520
|
+
for (const arg of argv) {
|
|
521
|
+
if (arg.startsWith('-') && !validFlags.has(arg)) {
|
|
522
|
+
console.error(`Unknown flag: ${arg}`);
|
|
523
|
+
console.error('Use --help to see available options');
|
|
524
|
+
process.exit(1);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
const args = parseArgs(argv);
|
|
528
|
+
void executeCommand(args);
|
|
732
529
|
//# sourceMappingURL=index.js.map
|