@gh-symphony/cli 0.0.17 → 0.0.19

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 (32) hide show
  1. package/README.md +105 -9
  2. package/dist/{chunk-EFMFGOWM.js → chunk-6CI3UUMH.js} +282 -57
  3. package/dist/chunk-C7G7RJ4G.js +146 -0
  4. package/dist/{chunk-MHIWAIVD.js → chunk-GKENCODJ.js} +141 -53
  5. package/dist/{project-557FE2GD.js → chunk-H2YXSYOZ.js} +108 -92
  6. package/dist/{chunk-TF3QNWNC.js → chunk-M3IFVLQS.js} +246 -212
  7. package/dist/{chunk-IWR4UQEJ.js → chunk-RN2PACNV.js} +350 -523
  8. package/dist/chunk-TILHWBP6.js +638 -0
  9. package/dist/{chunk-6HBZC3BE.js → chunk-XN5ABWZ6.js} +23 -5
  10. package/dist/{chunk-76QPITKI.js → chunk-Y6TYJMNT.js} +1 -1
  11. package/dist/{config-cmd-AZ7POMAA.js → config-cmd-DNXNL26Z.js} +3 -1
  12. package/dist/doctor-IYHCFXOZ.js +1126 -0
  13. package/dist/index.js +157 -19
  14. package/dist/init-KZT6YNOH.js +33 -0
  15. package/dist/{logs-6LNGT2GF.js → logs-6JKKYDGJ.js} +1 -1
  16. package/dist/project-DNALEWO3.js +22 -0
  17. package/dist/{recover-LVBI2TGH.js → recover-C3V2QAUB.js} +3 -3
  18. package/dist/repo-HDDE7OUI.js +321 -0
  19. package/dist/{run-WITYAYFZ.js → run-XI2S5Y4V.js} +3 -3
  20. package/dist/setup-K4CYYJBF.js +431 -0
  21. package/dist/{start-JUFKNL3N.js → start-M6IQGRFO.js} +5 -5
  22. package/dist/{status-3WK5BWRZ.js → status-QSCFVGRQ.js} +2 -2
  23. package/dist/{stop-AA3AP5M6.js → stop-7MFCBQVW.js} +2 -2
  24. package/dist/upgrade-F4VE4XBS.js +165 -0
  25. package/dist/{version-YVM2A25J.js → version-Y5RYNWMF.js} +1 -1
  26. package/dist/worker-entry.js +39 -11
  27. package/dist/workflow-TBIFY5MO.js +497 -0
  28. package/package.json +4 -4
  29. package/dist/chunk-JO3AXHQI.js +0 -130
  30. package/dist/chunk-TH5QPO3Y.js +0 -67
  31. package/dist/init-EZXQAXZM.js +0 -17
  32. package/dist/repo-R3XBIVAX.js +0 -121
package/README.md CHANGED
@@ -8,10 +8,15 @@ The following tools must be installed before using the CLI:
8
8
 
9
9
  - **[Node.js](https://nodejs.org/)** (v24+) with npm
10
10
  - **[Git](https://git-scm.com/)**
11
- - **[GitHub CLI (`gh`)](https://cli.github.com/)** — authenticated with required scopes:
12
- ```bash
13
- gh auth login --scopes repo,read:org,project
14
- ```
11
+ - One GitHub auth source with required scopes (`repo`, `read:org`, `project`):
12
+ - **[GitHub CLI (`gh`)](https://cli.github.com/)**:
13
+ ```bash
14
+ gh auth login --scopes repo,read:org,project
15
+ ```
16
+ - Or `GITHUB_GRAPHQL_TOKEN` for CI or minimal shells:
17
+ ```bash
18
+ export GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token
19
+ ```
15
20
 
16
21
  ## 1. Install Package
17
22
 
@@ -25,6 +30,15 @@ Verify the installation:
25
30
  gh-symphony --version
26
31
  ```
27
32
 
33
+ Validate the machine and repo prerequisites before first use:
34
+
35
+ ```bash
36
+ gh-symphony doctor
37
+ gh-symphony doctor --fix
38
+ gh-symphony doctor --json
39
+ GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token gh-symphony doctor --json
40
+ ```
41
+
28
42
  Enable shell completion:
29
43
 
30
44
  ```bash
@@ -44,19 +58,34 @@ autoload -Uz compinit && compinit
44
58
  Navigate to the repository you want to orchestrate, then run:
45
59
 
46
60
  ```bash
47
- gh-symphony init
61
+ gh-symphony workflow init
62
+ gh-symphony workflow init --dry-run
63
+ gh-symphony workflow validate
64
+ gh-symphony workflow preview
48
65
  ```
49
66
 
50
67
  The interactive wizard will:
51
68
 
52
- 1. Authenticate via `gh` CLI
69
+ 1. Authenticate via `GITHUB_GRAPHQL_TOKEN` or fall back to `gh` CLI
53
70
  2. Let you select a **GitHub Project** to bind
54
71
  3. Map project status columns to workflow phases (active / wait / terminal)
55
72
  4. Generate `WORKFLOW.md` and supporting files in the repository
56
73
 
74
+ Token-only interactive setup is supported:
75
+
76
+ ```bash
77
+ export GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token
78
+ gh-symphony workflow init
79
+ ```
80
+
81
+ Use `--dry-run` to preview the generated write plan first. The preview reports
82
+ whether `WORKFLOW.md`, `.gh-symphony/context.yaml`,
83
+ `.gh-symphony/reference-workflow.md`, and runtime skill files would be created,
84
+ updated, or left unchanged, and then exits without modifying the repository.
85
+
57
86
  ### Customizing Agent Behavior
58
87
 
59
- `gh-symphony init` generates skill files under `.codex/skills/` (or `.claude/skills/` for Claude Code). These skills define how the AI agent handles commits, pushes, pulls, and project status transitions.
88
+ `gh-symphony workflow init` generates skill files under `.codex/skills/` (or `.claude/skills/` for Claude Code). These skills define how the AI agent handles commits, pushes, pulls, and project status transitions.
60
89
 
61
90
  You can further customize the agent's behavior by editing `WORKFLOW.md` — this is the policy layer that controls what the agent does at each workflow phase.
62
91
 
@@ -104,25 +133,54 @@ gh-symphony project add
104
133
 
105
134
  The interactive wizard will:
106
135
 
107
- 1. Authenticate via `gh` CLI
136
+ 1. Authenticate via `GITHUB_GRAPHQL_TOKEN` or fall back to `gh` CLI
108
137
  2. Let you select a **GitHub Project**
109
138
  3. Optionally limit processing to issues assigned to the authenticated user
110
139
  4. Optionally customize advanced settings for repository filtering and workspace root directory
111
140
  5. Write project configuration to `~/.gh-symphony/`
112
141
 
142
+ Token-only non-interactive setup:
143
+
144
+ ```bash
145
+ GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token \
146
+ gh-symphony workflow init --non-interactive --project PVT_xxx --output WORKFLOW.md
147
+
148
+ GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token \
149
+ gh-symphony project add --non-interactive --project PVT_xxx --workspace-dir ~/.gh-symphony/workspaces
150
+ ```
151
+
152
+ Token-only project registration is also supported:
153
+
154
+ ```bash
155
+ export GITHUB_GRAPHQL_TOKEN=ghp_your_classic_token
156
+ gh-symphony project add
157
+ ```
158
+
113
159
  ### Project Management
114
160
 
115
161
  ```bash
162
+ gh-symphony doctor # Validate local prerequisites, auth, config, WORKFLOW.md, and runtime command
163
+ gh-symphony doctor --fix # Apply safe fixes and guide/launch follow-up recovery commands
116
164
  gh-symphony project list # List all configured projects
117
165
  gh-symphony project remove <id> # Remove a project
166
+ gh-symphony repo sync # Add newly linked repositories from the GitHub Project
167
+ gh-symphony repo sync --dry-run # Preview linked repository drift
168
+ gh-symphony repo sync --prune # Remove local repositories no longer linked
118
169
  ```
119
170
 
171
+ Use `gh-symphony repo sync` when the GitHub Project board has gained or lost
172
+ linked repositories since the project was first added locally. Default sync is
173
+ additive; `--prune` switches to strict alignment, and `--json` prints the added,
174
+ removed, unchanged, and final repository sets.
175
+
120
176
  ## 4. Run the Orchestrator
121
177
 
122
178
  ### Foreground
123
179
 
124
180
  ```bash
125
181
  gh-symphony start
182
+ gh-symphony start --once # Run startup cleanup + one orchestration tick, then exit
183
+ gh-symphony project start --once # Same one-shot flow for an explicit project
126
184
  ```
127
185
 
128
186
  ### Background (daemon)
@@ -132,6 +190,8 @@ gh-symphony start --daemon # Start in background
132
190
  gh-symphony stop # Stop the daemon
133
191
  ```
134
192
 
193
+ Use `start --once` for the first real managed-project run or a CI smoke check. It reuses the configured GitHub Project binding and `WORKFLOW.md` and performs exactly one poll/reconcile/dispatch cycle instead of entering the long-running orchestration loop. `--daemon --once` is rejected because the modes conflict. If you add `--http`, the dashboard/API remains available after that one-shot tick completes, and the process stays up until you interrupt it with `Ctrl+C`.
194
+
135
195
  ### Monitor
136
196
 
137
197
  ```bash
@@ -154,17 +214,52 @@ gh-symphony recover # Recover stalled runs
154
214
  gh-symphony recover --dry-run # Preview what would be recovered
155
215
  ```
156
216
 
217
+ ## Diagnostics
218
+
219
+ `gh-symphony doctor` validates the most common first-run prerequisites in one pass. `gh-symphony doctor --fix` extends that flow with safe remediation and guided follow-up:
220
+
221
+ - creates missing config/runtime/workspace directories
222
+ - launches `gh auth login` or `gh auth refresh` when a TTY is available, otherwise prints the exact command to run
223
+ - launches `gh-symphony init` when `WORKFLOW.md` is missing or invalid
224
+ - launches `gh-symphony project add` when managed project setup or GitHub Project binding must be repaired
225
+ - prints concrete runtime install guidance when the configured command is missing on `PATH`
226
+
227
+ The diagnostic checks cover:
228
+
229
+ - the active GitHub auth source (`GITHUB_GRAPHQL_TOKEN` first, otherwise `gh`) and required scopes
230
+ - Node.js runtime version against the documented minimum (`v24+`) and the current `process.version`
231
+ - Git installation availability on `PATH`, including `git --version` when available
232
+ - GitHub authentication via `GITHUB_GRAPHQL_TOKEN` or `gh`, including required scopes
233
+ - managed project selection plus GitHub Project binding resolution
234
+ - config/runtime/workspace path writability
235
+ - repository `WORKFLOW.md` presence and parse validity
236
+ - runtime command availability on `PATH`
237
+
238
+ Use JSON output for scripts and CI smoke checks. `--fix --json` includes a remediation section where each step is reported as `applied`, `skipped`, or `manual`.
239
+
240
+ ```bash
241
+ gh-symphony doctor --json
242
+ gh-symphony doctor --fix --json
243
+ gh-symphony start --once
244
+ ```
245
+
246
+ JSON output includes the resolved auth source as `env` or `gh`.
247
+
157
248
  ## Command Reference
158
249
 
159
250
  ```
160
251
  Setup:
161
- init Interactive repository setup wizard
252
+ workflow init Interactive repository setup wizard
253
+ workflow validate Parse and strictly validate WORKFLOW.md
254
+ workflow preview Render the final worker prompt from a sample issue
255
+ doctor Run diagnostics and optional first-run remediation
162
256
  config show Show current configuration
163
257
  config set Set a configuration value
164
258
  config edit Open config in $EDITOR
165
259
 
166
260
  Orchestration:
167
261
  start Start the orchestrator (foreground)
262
+ start --once Run a single orchestration tick and exit
168
263
  start --daemon Start the orchestrator (background)
169
264
  stop Stop the background orchestrator
170
265
  status Show orchestrator status
@@ -177,6 +272,7 @@ Project Management:
177
272
  project add Add a new project (interactive wizard)
178
273
  project list List all configured projects
179
274
  project remove Remove a project
275
+ repo sync Refresh repositories from the linked GitHub Project
180
276
 
181
277
  Global Options:
182
278
  --config <dir> Config directory (default: ~/.gh-symphony)