@ipul-labs/forge 1.16.0 → 1.16.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.
- package/package.json +1 -1
- package/bin/README.md +0 -210
package/package.json
CHANGED
package/bin/README.md
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
# `forge-agent` — CLI
|
|
2
|
-
|
|
3
|
-
> Type an issue, accept the suggested fix, and watch it merge to production. One command.
|
|
4
|
-
|
|
5
|
-
`forge-agent` is the headless half of [Forge](../README.md). Same orchestrator the web UI uses, no browser required.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g forge-agent
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Or run from a checkout without installing:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
node bin/forge-agent.js <command>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
You'll need:
|
|
22
|
-
|
|
23
|
-
- **Node.js 20+**
|
|
24
|
-
- **`claude` CLI** installed and authenticated (`claude auth login`)
|
|
25
|
-
- A **GitLab / GitHub / Azure DevOps** personal access token
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## First-time setup
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
forge-agent init # interactive wizard — writes .env + ~/.forge/config.json
|
|
33
|
-
forge-agent doctor # confirm node, git, claude CLI, token, and config are all ready
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`init` walks you through:
|
|
37
|
-
|
|
38
|
-
1. `FORGE_TOKEN` (a generated default — accept with Enter)
|
|
39
|
-
2. `PORT` (only matters if you also want the web UI)
|
|
40
|
-
3. SCM provider (gitlab / github / azuredevops, arrow keys)
|
|
41
|
-
4. Primary repo, then **add another?** (loop to add secondaries — needed for cross-repo features)
|
|
42
|
-
5. SCM token (masked input)
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## The headline command
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
forge-agent ship <iid>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Walks an issue from "open ticket" to "deployed in production" in one command, pausing for `y/N` at every step that changes shared state:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
ship <iid>
|
|
56
|
-
├─ analyze (or load cached if you've already analysed)
|
|
57
|
-
├─ review proposal (per-file diff + summary + divergence warnings)
|
|
58
|
-
├─ ?accept → continue, refuse, or refine with feedback
|
|
59
|
-
├─ validate (lint / typecheck / test against the proposed contents)
|
|
60
|
-
├─ ?apply → branch + commit + open MR
|
|
61
|
-
├─ watch CI
|
|
62
|
-
├─ ?ci-fix (only if the pipeline fails — re-analyse with logs, push to same branch)
|
|
63
|
-
├─ ?merge → merge to main
|
|
64
|
-
├─ watch deploy (post-merge pipeline)
|
|
65
|
-
└─ ?close issue
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**Resumable.** If you abort or the process dies, re-run `forge-agent ship <iid>` and it picks up at the next gate (state lives in `~/.forge/sessions/`).
|
|
69
|
-
|
|
70
|
-
**Confirm-by-default.** Cursor on every gate defaults to *no*. Pass `--yes` (or set `FORGE_YES=1`) for unattended mode.
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
forge-agent ship 42 # interactive, all gates
|
|
74
|
-
forge-agent ship 42 --all-repos # cross-repo (web-app + api + …)
|
|
75
|
-
forge-agent ship 42 --yes # unattended, no prompts
|
|
76
|
-
forge-agent ship 42 --auto # arm auto-merge instead of merging now
|
|
77
|
-
forge-agent ship 42 --skip-validate # skip the auto-validate before apply
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Discover what to work on
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
forge-agent issues # latest open issues, sorted by recency
|
|
86
|
-
forge-agent issues --label feature # filter by label
|
|
87
|
-
forge-agent issues --mine # filter by author (FORGE_USER || USER)
|
|
88
|
-
forge-agent issues --json | jq . # pipe-friendly
|
|
89
|
-
forge-agent issue 42 # full description, labels, URL
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Drive each phase by hand
|
|
95
|
-
|
|
96
|
-
`ship` is a thin orchestrator — every phase is also a standalone command. Useful when you want to inspect, iterate, or only do part of the flow.
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
forge-agent analyze 42 --all-repos # produce + cache a fresh analysis
|
|
100
|
-
forge-agent show # re-render the most recent analysis
|
|
101
|
-
forge-agent show 42 # ...for a specific issue
|
|
102
|
-
forge-agent refine --feedback "use Resend instead of SendGrid"
|
|
103
|
-
forge-agent validate # lint/typecheck/test the proposal
|
|
104
|
-
forge-agent apply --validate # gate apply on green validation
|
|
105
|
-
forge-agent watch # poll the MR pipeline
|
|
106
|
-
forge-agent ci-fix # re-analyse with failed-job logs, push to same branch
|
|
107
|
-
forge-agent merge # confirm + merge
|
|
108
|
-
forge-agent merge --auto # arm auto-merge instead
|
|
109
|
-
forge-agent resolution-check # ask the model: did this MR actually fix the issue?
|
|
110
|
-
forge-agent close # confirm + close the issue
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
`<iid>`-less commands resolve via the **HEAD pointer** — the most recently touched session. Like `git`'s HEAD: whatever you analysed last is what `show`/`validate`/`apply`/`watch`/`merge`/`close` operate on unless you pass an explicit `<iid>`.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Sessions (`~/.forge/sessions/`)
|
|
118
|
-
|
|
119
|
-
Each issue you work on gets a directory:
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
~/.forge/sessions/<repo>/<iid>/
|
|
123
|
-
analysis.json last cached analyzeIssue result
|
|
124
|
-
state.json { phase, branch, mrIid, mrUrl, lastPipelineStatus, ... }
|
|
125
|
-
events.ndjson append-only audit log
|
|
126
|
-
~/.forge/sessions/HEAD "<repo>/<iid>" — the most recently touched session
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Inspect and clean:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
forge-agent session list # table of all sessions, HEAD marked *
|
|
133
|
-
forge-agent session list --json
|
|
134
|
-
forge-agent session show # full state of HEAD
|
|
135
|
-
forge-agent session show 42 # ...for a specific issue
|
|
136
|
-
forge-agent session clean 42 # remove one session
|
|
137
|
-
forge-agent session clean --all # wipe everything
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Override the location with `FORGE_SESSIONS_PATH` (handy for CI or test isolation).
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Common workflows
|
|
145
|
-
|
|
146
|
-
### Ship a small fix, fully unattended
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
forge-agent ship 42 --yes
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Don't do this on prod the first time. Watch a couple of runs interactively first.
|
|
153
|
-
|
|
154
|
-
### Drive review explicitly
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
forge-agent analyze 42 --all-repos # produce
|
|
158
|
-
forge-agent show # review on the same screen later
|
|
159
|
-
forge-agent refine --feedback "..." # iterate
|
|
160
|
-
forge-agent ship 42 # pick up where you left off
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### Run from CI
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
FORGE_YES=1 forge-agent ship 42
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
`--json` is available on `analyze`, `issues`, `issue`, `repos list`, `session list/show`, `watch`, and `validate` — pipe-safe outputs that bypass Ink.
|
|
170
|
-
|
|
171
|
-
### Recover from a failed step
|
|
172
|
-
|
|
173
|
-
Just re-run the same command. State is on disk; it picks up where it left off.
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
forge-agent ship 42 # if it died mid-flow, this resumes
|
|
177
|
-
forge-agent ci-fix # if CI failed, fix it without re-running ship
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Doctor & troubleshooting
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
forge-agent doctor
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Sequential checklist — `node`, `git`, `claude`, `FORGE_TOKEN`, config file, frontend build. Exits non-zero if any check fails.
|
|
189
|
-
|
|
190
|
-
If `analyze` is timing out (5-minute Claude CLI cap), narrow the scope:
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
forge-agent analyze 42 --secondary group/api # explicit secondary instead of --all-repos
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
If `apply` says "no repos to validate against", check `forge-agent repos list` and your session's `primary` field.
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Reference
|
|
201
|
-
|
|
202
|
-
- [`docs/cli.md`](../docs/cli.md) — full command reference, every flag
|
|
203
|
-
- [`docs/cli-ship-workflow.md`](../docs/cli-ship-workflow.md) — design + status of the end-to-end ship workflow (per-phase delivery, decisions, risks)
|
|
204
|
-
- [`../README.md`](../README.md) — the broader Forge project (web UI, server, multi-provider details)
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## License
|
|
209
|
-
|
|
210
|
-
MIT — same as the rest of Forge.
|