gflows 0.1.11 → 0.1.12
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 +101 -11
- package/package.json +1 -1
- package/src/commands/bump.ts +1 -0
- package/src/commands/delete.ts +2 -0
- package/src/commands/finish.ts +17 -4
- package/src/commands/help.ts +1 -1
- package/src/commands/init.ts +1 -0
- package/src/commands/list.ts +2 -0
- package/src/commands/start.ts +1 -0
- package/src/commands/status.ts +1 -0
- package/src/commands/switch.ts +2 -0
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ gflows finish hotfix --push # merge to main, then dev; tag v1.3.1;
|
|
|
171
171
|
| `delete` | `-L` | Delete local workflow branch(es). Never main/dev. |
|
|
172
172
|
| `list` | `-l` | List workflow branches; optional type filter and remote. |
|
|
173
173
|
| `bump` | — | Bump or rollback package version (patch/minor/major). |
|
|
174
|
-
| `completion` | — | Print shell completion script (bash
|
|
174
|
+
| `completion` | — | Print shell completion script (bash/zsh/fish). |
|
|
175
175
|
| `status` | `-t` | Show current branch, type, base, merge target(s), ahead/behind. |
|
|
176
176
|
| `help` | `-h` | Show usage and quick reference. |
|
|
177
177
|
| `version` | `-V` | Show version. |
|
|
@@ -179,13 +179,30 @@ gflows finish hotfix --push # merge to main, then dev; tag v1.3.1;
|
|
|
179
179
|
|
|
180
180
|
**Branch types (for start/finish/list):** `feature` (`-f`), `bugfix` (`-b`), `chore` (`-c`), `release` (`-r`), `hotfix` (`-x`), `spike` (`-e`).
|
|
181
181
|
|
|
182
|
+
**Common flags** (used by multiple commands):
|
|
183
|
+
|
|
184
|
+
| Flag | Short | Description |
|
|
185
|
+
|------|-------|-------------|
|
|
186
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
187
|
+
| `--dry-run` | `-d` | Log intended actions only; no writes. |
|
|
188
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
189
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
190
|
+
| `--push` | `-p` | Push after init/start/finish. |
|
|
191
|
+
| `--no-push` | `-P` | Do not push. |
|
|
192
|
+
| `--main <name>` | — | Main branch override. |
|
|
193
|
+
| `--dev <name>` | — | Dev branch override. |
|
|
194
|
+
| `--remote <name>` | `-R` | Remote for push. |
|
|
195
|
+
| `--from <branch>` | `-o` | Base branch override (start). |
|
|
196
|
+
| `--branch <name>` | `-B` | Branch name (finish). |
|
|
197
|
+
| `--yes` | `-y` | Skip confirmations. |
|
|
198
|
+
|
|
182
199
|
---
|
|
183
200
|
|
|
184
201
|
### init
|
|
185
202
|
|
|
186
203
|
Ensures the **main** branch exists (exits with error if not). Creates **dev** from main if it does not exist; does nothing if dev already exists. Does not rewrite or force-push.
|
|
187
204
|
|
|
188
|
-
You can set and persist config with `**--main`**, `**--dev
|
|
205
|
+
You can set and persist config with `**--main`**, `**--dev`**, and `**-R`/`--remote**`. Any of these flags cause init to write or update `.gflows.json` with the given values (after a successful init; skipped with `--dry-run`).
|
|
189
206
|
|
|
190
207
|
**Examples:**
|
|
191
208
|
|
|
@@ -197,7 +214,18 @@ gflows init -C ../other-repo # run in another directory
|
|
|
197
214
|
gflows init --dry-run # log intended actions only
|
|
198
215
|
```
|
|
199
216
|
|
|
200
|
-
**Flags:**
|
|
217
|
+
**Flags:**
|
|
218
|
+
|
|
219
|
+
| Flag | Short | Description |
|
|
220
|
+
|------|-------|-------------|
|
|
221
|
+
| `--push` | `-p` | Push dev to remote after creating. |
|
|
222
|
+
| `--main <name>` | — | Main branch name (persisted to `.gflows.json` when provided). |
|
|
223
|
+
| `--dev <name>` | — | Dev branch name (persisted to `.gflows.json` when provided). |
|
|
224
|
+
| `--remote <name>` | `-R` | Remote name (persisted to `.gflows.json` when provided). |
|
|
225
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
226
|
+
| `--dry-run` | `-d` | Log intended actions only; no writes. |
|
|
227
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
228
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
201
229
|
|
|
202
230
|
---
|
|
203
231
|
|
|
@@ -220,7 +248,18 @@ gflows start feature api-v2 --push # create branch and push to rem
|
|
|
220
248
|
gflows start chore deps-update -C ./backend # run in subdirectory
|
|
221
249
|
```
|
|
222
250
|
|
|
223
|
-
**Flags:**
|
|
251
|
+
**Flags:**
|
|
252
|
+
|
|
253
|
+
| Flag | Short | Description |
|
|
254
|
+
|------|-------|-------------|
|
|
255
|
+
| `--force` | — | Allow dirty working tree. |
|
|
256
|
+
| `--push` | `-p` | Push new branch to remote after creating. |
|
|
257
|
+
| `--from <branch>` | `-o` | Base branch override (e.g. `-o main` for bugfix). |
|
|
258
|
+
| `--remote <name>` | `-R` | Remote for push. |
|
|
259
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
260
|
+
| `--dry-run` | `-d` | Log intended actions only; no writes. |
|
|
261
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
262
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
224
263
|
|
|
225
264
|
---
|
|
226
265
|
|
|
@@ -245,7 +284,25 @@ gflows finish -y # skip "Delete branch after finish?"
|
|
|
245
284
|
|
|
246
285
|
**Branch resolution:** If you omit the branch name, gflows uses the current branch. With `-B` and no value in a TTY, it shows a picker of workflow branches. Without a TTY, you must pass the branch name explicitly.
|
|
247
286
|
|
|
248
|
-
**Flags:**
|
|
287
|
+
**Flags:**
|
|
288
|
+
|
|
289
|
+
| Flag | Short | Description |
|
|
290
|
+
|------|-------|-------------|
|
|
291
|
+
| `--branch <name>` | `-B` | Branch to finish (current branch if omitted; picker in TTY when `-B` with no value). |
|
|
292
|
+
| `--no-ff` | — | Always create a merge commit. |
|
|
293
|
+
| `--delete` | `-D` | Delete branch after finish. |
|
|
294
|
+
| `--no-delete` | `-N` | Do not delete branch after finish. |
|
|
295
|
+
| `--push` | `-p` | Push after merge (finish prompts "Do you want to push?" when neither `-p` nor `-P`). |
|
|
296
|
+
| `--no-push` | `-P` | Do not push. |
|
|
297
|
+
| `--sign` | `-s` | Sign the tag (release/hotfix; GPG). |
|
|
298
|
+
| `--no-tag` | `-T` | Do not create tag (release/hotfix). |
|
|
299
|
+
| `--tag-message <msg>` | `-M` | Tag message. |
|
|
300
|
+
| `--message <msg>` | `-m` | Merge message. |
|
|
301
|
+
| `--yes` | `-y` | Skip confirmations (e.g. "Delete branch after finish?"). |
|
|
302
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
303
|
+
| `--dry-run` | `-d` | Log intended actions only; no writes. |
|
|
304
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
305
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
249
306
|
|
|
250
307
|
---
|
|
251
308
|
|
|
@@ -261,7 +318,13 @@ gflows switch feature/auth-refactor
|
|
|
261
318
|
gflows -W feature/auth-refactor # same with short command
|
|
262
319
|
```
|
|
263
320
|
|
|
264
|
-
**Flags:**
|
|
321
|
+
**Flags:**
|
|
322
|
+
|
|
323
|
+
| Flag | Short | Description |
|
|
324
|
+
|------|-------|-------------|
|
|
325
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
326
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
327
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
265
328
|
|
|
266
329
|
---
|
|
267
330
|
|
|
@@ -277,7 +340,13 @@ gflows delete feature/old-spike
|
|
|
277
340
|
gflows delete feature/one feature/two # delete multiple
|
|
278
341
|
```
|
|
279
342
|
|
|
280
|
-
**Flags:**
|
|
343
|
+
**Flags:**
|
|
344
|
+
|
|
345
|
+
| Flag | Short | Description |
|
|
346
|
+
|------|-------|-------------|
|
|
347
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
348
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
349
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
281
350
|
|
|
282
351
|
---
|
|
283
352
|
|
|
@@ -295,7 +364,15 @@ gflows list -r feature # remote + local feature branches
|
|
|
295
364
|
gflows list --include-remote
|
|
296
365
|
```
|
|
297
366
|
|
|
298
|
-
**Flags:**
|
|
367
|
+
**Flags:**
|
|
368
|
+
|
|
369
|
+
| Flag | Short | Description |
|
|
370
|
+
|------|-------|-------------|
|
|
371
|
+
| `--include-remote` | `-r` | Include remote-tracking branches (may run `git fetch`). |
|
|
372
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
373
|
+
| `--dry-run` | `-d` | Log intended actions only. |
|
|
374
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
375
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
299
376
|
|
|
300
377
|
---
|
|
301
378
|
|
|
@@ -317,7 +394,14 @@ gflows bump # interactive (direction + type) when T
|
|
|
317
394
|
gflows bump --dry-run # print old → new, no file writes
|
|
318
395
|
```
|
|
319
396
|
|
|
320
|
-
**Flags:**
|
|
397
|
+
**Flags:**
|
|
398
|
+
|
|
399
|
+
| Flag | Short | Description |
|
|
400
|
+
|------|-------|-------------|
|
|
401
|
+
| `--dry-run` | `-d` | Print old → new version only; no file writes. |
|
|
402
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
403
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
404
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
321
405
|
|
|
322
406
|
---
|
|
323
407
|
|
|
@@ -332,7 +416,13 @@ gflows status
|
|
|
332
416
|
gflows -t
|
|
333
417
|
```
|
|
334
418
|
|
|
335
|
-
**Flags:**
|
|
419
|
+
**Flags:**
|
|
420
|
+
|
|
421
|
+
| Flag | Short | Description |
|
|
422
|
+
|------|-------|-------------|
|
|
423
|
+
| `--path <dir>` | `-C` | Run as if in `<dir>`. |
|
|
424
|
+
| `--verbose` | `-v` | Verbose output. |
|
|
425
|
+
| `--quiet` | `-q` | Minimal output. |
|
|
336
426
|
|
|
337
427
|
---
|
|
338
428
|
|
|
@@ -386,7 +476,7 @@ Configuration is **optional**. Override branch names, remote, and branch **prefi
|
|
|
386
476
|
**Resolution order** (later overrides earlier):
|
|
387
477
|
|
|
388
478
|
1. Built-in defaults (`main`, `dev`, `origin`, and default prefixes).
|
|
389
|
-
2. Repo config file: `**.gflows.json`** in repo root, or `**gflows
|
|
479
|
+
2. Repo config file: `**.gflows.json`** in repo root, or `**gflows`** key in `**package.json**`.
|
|
390
480
|
3. CLI (e.g. `--main`, `--dev`, `-R`/`--remote`).
|
|
391
481
|
|
|
392
482
|
Only include keys you want to override; the rest stay default. Invalid or malformed config is ignored (with an optional warning when using `-v`).
|
package/package.json
CHANGED
package/src/commands/bump.ts
CHANGED
|
@@ -210,6 +210,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
210
210
|
const updated = [PACKAGE_JSON];
|
|
211
211
|
if (jsrUpdated) updated.push(JSR_JSON);
|
|
212
212
|
success(`Updated: ${updated.join(", ")}`);
|
|
213
|
+
// Hint: suggest next step — commit and start release branch
|
|
213
214
|
hint("Commit the change, then run gflows start release vX.Y.Z to release.");
|
|
214
215
|
}
|
|
215
216
|
}
|
package/src/commands/delete.ts
CHANGED
|
@@ -80,6 +80,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
if (!quiet && !dryRun) {
|
|
83
|
+
// Hint: suggest listing remaining branches
|
|
83
84
|
hint("Use gflows list to see remaining workflow branches.");
|
|
84
85
|
}
|
|
85
86
|
return;
|
|
@@ -139,6 +140,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
if (!quiet && !dryRun && chosen.length > 0) {
|
|
143
|
+
// Hint: suggest listing remaining branches
|
|
142
144
|
hint("Use gflows list to see remaining workflow branches.");
|
|
143
145
|
}
|
|
144
146
|
}
|
package/src/commands/finish.ts
CHANGED
|
@@ -242,10 +242,21 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
const
|
|
246
|
-
const didCreateTag = !!(
|
|
245
|
+
const createdTagName =
|
|
247
246
|
meta.mergeTarget === "main-then-dev" && meta.tagOnFinish && version && !args.noTag
|
|
248
|
-
|
|
247
|
+
? normalizeTagVersion(version)
|
|
248
|
+
: undefined;
|
|
249
|
+
const didCreateTag = Boolean(createdTagName);
|
|
250
|
+
|
|
251
|
+
let doPush = args.push && !args.noPush;
|
|
252
|
+
if (!args.push && !args.noPush && isTTY) {
|
|
253
|
+
const { confirm } = await import("@inquirer/prompts");
|
|
254
|
+
doPush = await confirm({
|
|
255
|
+
message: "Do you want to push?",
|
|
256
|
+
default: true,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
249
260
|
if (doPush) {
|
|
250
261
|
const remote = args.remote ?? config.remote;
|
|
251
262
|
const refsToPush: string[] = [config.dev];
|
|
@@ -271,7 +282,9 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
271
282
|
}
|
|
272
283
|
|
|
273
284
|
if (!args.quiet && !args.dryRun) {
|
|
274
|
-
|
|
285
|
+
const tagSuffix = createdTagName ? ` (tag ${createdTagName})` : "";
|
|
286
|
+
success(`gflows: finished '${branchToFinish}' into ${meta.mergeTarget}${tagSuffix}.`);
|
|
287
|
+
// Hint: suggest next step — create a new workflow branch
|
|
275
288
|
hint("Run gflows start <type> <name> to create a new workflow branch.");
|
|
276
289
|
}
|
|
277
290
|
}
|
package/src/commands/help.ts
CHANGED
|
@@ -32,7 +32,7 @@ Types: feature (-f), bugfix (-b), chore (-c), release (-r), hotfix (-x), spike (
|
|
|
32
32
|
|
|
33
33
|
Common flags:
|
|
34
34
|
-p, --push Push after init/start/finish
|
|
35
|
-
-P, --no-push Do not push
|
|
35
|
+
-P, --no-push Do not push (finish: prompts "Do you want to push?" when neither -p nor -P)
|
|
36
36
|
--main <name> Main branch (init: persist to .gflows.json)
|
|
37
37
|
--dev <name> Dev branch (init: persist to .gflows.json)
|
|
38
38
|
-R, --remote <name> Remote for push (init: persist to .gflows.json)
|
package/src/commands/init.ts
CHANGED
package/src/commands/list.ts
CHANGED
|
@@ -90,8 +90,10 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
90
90
|
|
|
91
91
|
if (!quiet && sorted.length === 0) {
|
|
92
92
|
console.error("No workflow branches found.");
|
|
93
|
+
// Hint: suggest creating first workflow branch
|
|
93
94
|
hint("Run gflows start <type> <name> to create a workflow branch.");
|
|
94
95
|
} else if (!quiet && sorted.length > 0) {
|
|
96
|
+
// Hint: suggest switching to a listed branch
|
|
95
97
|
hint("Use gflows switch <branch> to switch to a branch.");
|
|
96
98
|
}
|
|
97
99
|
}
|
package/src/commands/start.ts
CHANGED
|
@@ -141,6 +141,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
if (!args.quiet && !args.dryRun) {
|
|
144
|
+
// Hint: suggest next step — merge branch when done
|
|
144
145
|
hint(`When done, run gflows finish ${type} to merge into the target branch.`);
|
|
145
146
|
}
|
|
146
147
|
}
|
package/src/commands/status.ts
CHANGED
|
@@ -138,6 +138,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
138
138
|
|
|
139
139
|
if (!quiet) {
|
|
140
140
|
console.log(`Ahead/behind: ${ahead} ahead, ${behind} behind`);
|
|
141
|
+
// Hint: suggest next step — finish current branch
|
|
141
142
|
hint(`Run gflows finish ${classification} to merge into ${mergeTargetDisplay}.`);
|
|
142
143
|
}
|
|
143
144
|
}
|
package/src/commands/switch.ts
CHANGED
|
@@ -65,6 +65,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
65
65
|
});
|
|
66
66
|
if (!quiet && !dryRun) {
|
|
67
67
|
success(`Switched to branch '${branchName}'.`);
|
|
68
|
+
// Hint: suggest listing branches
|
|
68
69
|
hint("Use gflows list to see all workflow branches.");
|
|
69
70
|
}
|
|
70
71
|
return;
|
|
@@ -104,6 +105,7 @@ export async function run(args: ParsedArgs): Promise<void> {
|
|
|
104
105
|
});
|
|
105
106
|
if (!quiet && !dryRun) {
|
|
106
107
|
success(`Switched to branch '${chosen}'.`);
|
|
108
|
+
// Hint: suggest listing branches
|
|
107
109
|
hint("Use gflows list to see all workflow branches.");
|
|
108
110
|
}
|
|
109
111
|
}
|