gflows 0.1.18 → 1.0.1

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.
Files changed (49) hide show
  1. package/AGENTS.md +78 -0
  2. package/CHANGELOG.md +48 -0
  3. package/README.md +279 -505
  4. package/llms.txt +22 -0
  5. package/package.json +29 -23
  6. package/src/cli.ts +21 -367
  7. package/src/commands/abort.ts +39 -0
  8. package/src/commands/bump.ts +10 -10
  9. package/src/commands/completion.ts +14 -4
  10. package/src/commands/config.ts +123 -0
  11. package/src/commands/continue.ts +40 -0
  12. package/src/commands/delete.ts +4 -4
  13. package/src/commands/doctor.ts +143 -0
  14. package/src/commands/finish.ts +363 -137
  15. package/src/commands/help.ts +29 -21
  16. package/src/commands/init.ts +99 -18
  17. package/src/commands/list.ts +6 -1
  18. package/src/commands/mcp.ts +239 -0
  19. package/src/commands/pr.ts +120 -0
  20. package/src/commands/schema.ts +99 -0
  21. package/src/commands/start.ts +33 -31
  22. package/src/commands/status.ts +70 -51
  23. package/src/commands/switch.ts +14 -19
  24. package/src/commands/sync.ts +160 -0
  25. package/src/commands/undo.ts +78 -0
  26. package/src/commands/version.ts +3 -15
  27. package/src/commands/viz.ts +18 -0
  28. package/src/dispatch.ts +21 -0
  29. package/src/errors.ts +55 -12
  30. package/src/flow.ts +157 -0
  31. package/src/git.ts +135 -8
  32. package/src/index.ts +24 -1
  33. package/src/interactive.ts +209 -0
  34. package/src/out.ts +11 -4
  35. package/src/package-scripts.ts +73 -0
  36. package/src/parse.ts +430 -0
  37. package/src/prompts.ts +89 -0
  38. package/src/recommend.ts +132 -0
  39. package/src/run-state.ts +165 -0
  40. package/src/tui/HubHome.tsx +391 -0
  41. package/src/tui/HubShell.tsx +193 -0
  42. package/src/tui/flows.tsx +229 -0
  43. package/src/tui/hub.ts +114 -0
  44. package/src/tui/prompts.tsx +207 -0
  45. package/src/tui/slash.ts +63 -0
  46. package/src/types.ts +62 -3
  47. package/src/ui.ts +132 -0
  48. package/src/version.ts +24 -0
  49. package/src/viz.ts +294 -0
package/AGENTS.md ADDED
@@ -0,0 +1,78 @@
1
+ # AGENTS.md — using gflows from coding agents
2
+
3
+ gflows is a **local Git branching workflow CLI** (main + dev + typed short-lived branches). Prefer gflows over inventing git-flow merges by hand.
4
+
5
+ ## Rules for agents
6
+
7
+ 1. **Non-interactive only** — never assume the TTY menu. Always pass explicit args.
8
+ 2. **Finish needs push polarity** — pass `-p` / `--push` or `-P` / `--no-push`. Use `-y` to accept the finish plan (delete branch defaults **on**; use `-N` to keep).
9
+ 3. **Do not finish empty branches** — if there are no commits beyond the merge target, finish exits `2`. Commit first.
10
+ 4. **Conflicts** — resolve files, then `gflows continue`. Or `gflows abort` / `gflows undo`.
11
+ 5. **Discover the API** — run `gflows schema` (JSON) or read this file + README.
12
+ 6. **MCP** — `gflows mcp` (stdio JSON-RPC) exposes status/doctor/list/start/sync/finish/schema tools.
13
+ 7. **Hub / viz** — bare `gflows` (TTY) opens an Ink fullscreen hub (`/` commands). Prompts use Clack. `gflows viz` prints the scrollback status panel.
14
+
15
+ ## Exit codes
16
+
17
+ | Code | Meaning |
18
+ |------|---------|
19
+ | 0 | Success |
20
+ | 1 | Usage / validation |
21
+ | 2 | Git / system |
22
+
23
+ ## Recipes
24
+
25
+ ```bash
26
+ # Setup
27
+ gflows init --no-push -y
28
+ # or with remote: gflows init -y
29
+
30
+ # Daily feature
31
+ gflows start feature my-thing
32
+ # … commit …
33
+ gflows sync --force
34
+ gflows pr # needs gh or glab
35
+ gflows finish feature -y -P # or -p to push
36
+
37
+ # Production bugfix
38
+ gflows start bugfix hotfix-login -o main
39
+ # … commit …
40
+ gflows finish bugfix -y -p # merges main, then main→dev
41
+
42
+ # Release
43
+ gflows bump up minor
44
+ # commit version files, or: gflows finish release --bump …
45
+ gflows start release v1.2.0
46
+ # … changelog / commits …
47
+ gflows finish release -y -p
48
+
49
+ # Stuck
50
+ gflows doctor --json
51
+ gflows continue
52
+ gflows abort
53
+ gflows undo
54
+ ```
55
+
56
+ ## Branch merge targets
57
+
58
+ | Type | Base | Finish merges into |
59
+ |------|------|--------------------|
60
+ | feature, chore, spike | dev | dev |
61
+ | bugfix | dev (or main with `-o main`) | dev, or main then dev if based on main |
62
+ | release | dev | main, then main→dev + tag |
63
+ | hotfix | main | main, then main→dev + tag |
64
+
65
+ ## Cursor MCP snippet
66
+
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "gflows": {
71
+ "command": "bun",
72
+ "args": ["run", "path/to/gflows/src/cli.ts", "mcp"]
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ Or after install: `bunx gflows mcp`.
package/CHANGELOG.md ADDED
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.1] - 2026-07-25
11
+
12
+ ### Added
13
+
14
+ - Fullscreen **Ink** TUI hub (`gflows` on TTY): bordered frame, tips / what’s next, actions, `❯` slash prompt, status bar
15
+ - Slash commands: `/init` `/start` `/sync` `/pr` `/finish` `/doctor` `/help` …
16
+ - In-hub `/` autocomplete (↑↓ select, Tab complete, Enter run)
17
+ - Interactive prompts via **@clack/prompts** (Inquirer removed)
18
+ - Legacy Clack menu fallback when TUI cannot run; `gflows viz` for scrollback panel
19
+ - `gflows init`: optional `package.json` script alias (`--script-alias g`, TTY prompt); docs recommend shell `alias g=gflows` for shortest DX
20
+ - Hub wizards (`/start`, `/finish`, `/sync`, `/list`) run **inside Ink** (fewer drop-outs); only git dispatch leaves the TUI
21
+
22
+ ### Fixed
23
+
24
+ - Hub no longer exits after dispatch (`stdin.ref` after Ink unmount; alternate screen)
25
+ - `/list` renders a styled in-hub branch view instead of plain stdout under a tall gap
26
+
27
+ ## [1.0.0] - 2026-07-24
28
+
29
+ ### Added
30
+
31
+ - Interactive hub: bare `gflows` in a TTY opens a guided menu
32
+ - `gflows sync` — update workflow branch from base (merge/rebase, stash-aware)
33
+ - `gflows pr` — open PR/MR via `gh` or `glab` against the correct base
34
+ - `gflows doctor`, `gflows config get|set`, `gflows schema`, `gflows mcp`
35
+ - Recovery: `gflows continue`, `gflows undo`, `gflows abort` with run-state under `.git/gflows/`
36
+ - Finish plan preview, `--squash`, `--preview`, `--bump`, empty/dirty finish guards
37
+ - Delete-after-finish defaults **on** (`-N` to keep); `-y` accepts the plan
38
+ - Bugfix-from-main finish merges to main then dev
39
+ - `--json` on status/list/doctor; hints go to stderr (stdout stays scriptable)
40
+ - `AGENTS.md` + `llms.txt` for AI agents
41
+ - Kebab-case long flags (`--dry-run`, `--no-ff`, `--no-delete`, …) bind correctly
42
+ - Merge `-m` / `--message` wired through to git merge
43
+
44
+ ### Fixed
45
+
46
+ - Documented flags that previously did not parse
47
+ - Help text incorrectly claimed start pushes by default
48
+ - Finish picker prefers the current workflow branch