gflows 0.1.17 → 1.0.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/AGENTS.md +78 -0
- package/CHANGELOG.md +40 -0
- package/README.md +279 -502
- package/llms.txt +22 -0
- package/package.json +30 -23
- package/src/cli.ts +21 -364
- package/src/commands/abort.ts +39 -0
- package/src/commands/bump.ts +10 -10
- package/src/commands/completion.ts +14 -4
- package/src/commands/config.ts +123 -0
- package/src/commands/continue.ts +40 -0
- package/src/commands/delete.ts +4 -4
- package/src/commands/doctor.ts +143 -0
- package/src/commands/finish.ts +363 -137
- package/src/commands/help.ts +29 -20
- package/src/commands/init.ts +99 -18
- package/src/commands/list.ts +6 -1
- package/src/commands/mcp.ts +238 -0
- package/src/commands/pr.ts +120 -0
- package/src/commands/schema.ts +98 -0
- package/src/commands/start.ts +33 -31
- package/src/commands/status.ts +70 -51
- package/src/commands/switch.ts +50 -20
- package/src/commands/sync.ts +160 -0
- package/src/commands/undo.ts +78 -0
- package/src/commands/version.ts +3 -15
- package/src/commands/viz.ts +18 -0
- package/src/dispatch.ts +21 -0
- package/src/errors.ts +55 -12
- package/src/flow.ts +157 -0
- package/src/git.ts +135 -8
- package/src/index.ts +24 -1
- package/src/interactive.ts +209 -0
- package/src/out.ts +11 -4
- package/src/package-scripts.ts +73 -0
- package/src/parse.ts +430 -0
- package/src/prompts.ts +89 -0
- package/src/recommend.ts +132 -0
- package/src/run-state.ts +165 -0
- package/src/tui/HubHome.tsx +343 -0
- package/src/tui/HubShell.tsx +186 -0
- package/src/tui/flows.tsx +140 -0
- package/src/tui/hub.ts +89 -0
- package/src/tui/prompts.tsx +207 -0
- package/src/types.ts +63 -4
- package/src/ui.ts +132 -0
- package/src/version.ts +24 -0
- 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,40 @@
|
|
|
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
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Fullscreen **Ink** TUI hub (`gflows` on TTY): bordered frame, tips / what’s next, actions, `❯` slash prompt, status bar
|
|
13
|
+
- Slash commands: `/init` `/start` `/sync` `/pr` `/finish` `/doctor` `/help` …
|
|
14
|
+
- Interactive prompts via **@clack/prompts** (Inquirer removed)
|
|
15
|
+
- Legacy Clack menu fallback when TUI cannot run; `gflows viz` for scrollback panel
|
|
16
|
+
- `gflows init`: optional `package.json` script alias (`--script-alias g`, TTY prompt); docs recommend shell `alias g=gflows` for shortest DX
|
|
17
|
+
- Hub wizards (`/start`, `/finish`, `/sync`) run **inside Ink** (fewer Clack drop-outs); only git dispatch leaves the TUI
|
|
18
|
+
|
|
19
|
+
## [1.0.0] - 2026-07-24
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Interactive hub: bare `gflows` in a TTY opens a guided menu
|
|
24
|
+
- `gflows sync` — update workflow branch from base (merge/rebase, stash-aware)
|
|
25
|
+
- `gflows pr` — open PR/MR via `gh` or `glab` against the correct base
|
|
26
|
+
- `gflows doctor`, `gflows config get|set`, `gflows schema`, `gflows mcp`
|
|
27
|
+
- Recovery: `gflows continue`, `gflows undo`, `gflows abort` with run-state under `.git/gflows/`
|
|
28
|
+
- Finish plan preview, `--squash`, `--preview`, `--bump`, empty/dirty finish guards
|
|
29
|
+
- Delete-after-finish defaults **on** (`-N` to keep); `-y` accepts the plan
|
|
30
|
+
- Bugfix-from-main finish merges to main then dev
|
|
31
|
+
- `--json` on status/list/doctor; hints go to stderr (stdout stays scriptable)
|
|
32
|
+
- `AGENTS.md` + `llms.txt` for AI agents
|
|
33
|
+
- Kebab-case long flags (`--dry-run`, `--no-ff`, `--no-delete`, …) bind correctly
|
|
34
|
+
- Merge `-m` / `--message` wired through to git merge
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Documented flags that previously did not parse
|
|
39
|
+
- Help text incorrectly claimed start pushes by default
|
|
40
|
+
- Finish picker prefers the current workflow branch
|