@gkoreli/ghx 2.4.0 → 2.4.2

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 (2) hide show
  1. package/README.md +71 -10
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -146,21 +146,22 @@ go install github.com/gkoreli/ghx/v2/cmd/ghx@latest
146
146
  The sidecar drives an ACP-capable agent under the hood, and it reads GitHub
147
147
  through the authenticated [gh CLI](https://cli.github.com/) (`gh auth login`).
148
148
 
149
- ### 2. Configure the agent
149
+ ### 2. Configure the agent (optional — zero-config works)
150
150
 
151
151
  The sidecar speaks [Agent Client Protocol (ACP)](https://agentclientprotocol.com)
152
- to its underlying model. One command writes a working config using the
152
+ to its underlying model. **With no config at all, the pinned
153
153
  [claude-agent-acp](https://www.npmjs.com/package/@agentclientprotocol/claude-agent-acp)
154
- adapter:
154
+ adapter is the default** — if you have Node/npx and are logged into Claude Code,
155
+ `ghx sidecar ask` works out of the box. Write an explicit config only to pin a
156
+ different agent or model:
155
157
 
156
158
  ```bash
157
159
  ghx sidecar config init --claude-acp # writes ~/.ghx/config.json with the ACP adapter
158
160
  ```
159
161
 
160
- > Setup is the hardest step, so this is designed to be one command. Without
161
- > `--claude-acp`, `config init` auto-detects any ACP-capable agent already on
162
- > your PATH; a bare `claude` binary does **not** speak ACP on stdio and is
163
- > rejected on purpose (it would hang every turn — see
162
+ > Without `--claude-acp`, `config init` auto-detects any ACP-capable agent
163
+ > already on your PATH; a bare `claude` binary does **not** speak ACP on stdio
164
+ > and is rejected on purpose (it would hang every turn see
164
165
  > [ADR-0019](docs/adr/0019-sidecar-adoption-zero-cli-surface.md) D4).
165
166
 
166
167
  Re-running `config init --claude-acp` against an existing config shows a field
@@ -169,7 +170,8 @@ diff and refuses to overwrite without `--force`.
169
170
  ### 3. Verify
170
171
 
171
172
  ```bash
172
- ghx sidecar doctor # checks token, network, ghx binary, and the ACP handshake
173
+ ghx sidecar doctor # token, network, ghx binary, ACP handshake, report sink
174
+ ghx sidecar doctor --live # also run a REAL one-prompt turn through the agent
173
175
  ```
174
176
 
175
177
  `doctor` fails fast with an actionable message if the configured agent cannot
@@ -179,6 +181,13 @@ matches the running ghx version — a stale sink binary would silently degrade
179
181
  structured reports to a text fallback, so doctor fails loudly with fix-it text
180
182
  instead.
181
183
 
184
+ `--live` goes one step further: the plain handshake stops at ACP *initialize*,
185
+ which passes even on setups where a real turn then fails (auth typically
186
+ resolves lazily at prompt time). `--live` runs a full `session/new` + one tiny
187
+ prompt turn through the configured agent and, on failure, prints the failing
188
+ **stage** and the agent's **stderr tail** — the deterministic way to diagnose a
189
+ machine where `ask` produces nothing (see [ADR-0033](docs/adr/0033-sidecar-out-of-box-agent-config.md)).
190
+
182
191
  ### 4. Ask
183
192
 
184
193
  ```bash
@@ -226,13 +235,40 @@ most recent session. Everything it shows is the same file you can read by hand.
226
235
  Requires the viewer on PATH:
227
236
  `go install github.com/CtrlSpice/otel-desktop-viewer@latest`.
228
237
 
238
+ ### Troubleshooting
239
+
240
+ If an `ask` returns nothing useful, the failure is recorded, not lost
241
+ ([ADR-0033](docs/adr/0033-sidecar-out-of-box-agent-config.md)):
242
+
243
+ - **Per-session agent stderr.** The spawned agent's stderr is captured to
244
+ `~/.ghx/sessions/<session>/agent-stderr.log`. Under the always-on daemon it
245
+ no longer disappears into the daemon's own log. A failed turn also splices the
246
+ tail of that log — and its path — into the error the CLI prints.
247
+ - **Reproduce it deterministically.** `ghx sidecar doctor --live` runs a real
248
+ prompt turn and prints the failing stage plus the agent's stderr, even when the
249
+ plain handshake passes.
250
+ - **`this workspace has not been trusted`.** ghx already runs the agent in a
251
+ neutral, ghx-owned session directory (outside any git repo, no `.claude`
252
+ settings), so this warning should not appear. If it still does, the agent
253
+ picked up a git-repo workspace: trust it once (run the agent interactively
254
+ there and accept the dialog) or set
255
+ `projects["<dir>"].hasTrustDialogAccepted: true` in `~/.claude.json`. ghx will
256
+ never write that file for you.
257
+ - **"works from shell A, fails from shell B".** The daemon auto-spawns from the
258
+ **first** caller's environment, so a missing auth/proxy env var is a common
259
+ cause. `ghx sidecar sessions show <session>` lists the agent command, the
260
+ session's spawn cwd, and the **names** (never values) of the agent-relevant
261
+ environment variables present when it was created. If the wrong env was
262
+ inherited, `ghx sidecar daemon --stop` and re-run `ask` from a shell that has
263
+ the right variables.
264
+
229
265
  ### Delegating from a main agent (MCP)
230
266
 
231
267
  A main agent talks to the sidecar through a single MCP tool — one tool it cannot
232
268
  be tempted into step-driving:
233
269
 
234
270
  ```bash
235
- ghx serve --recon # exposes exactly one MCP tool: recon(question, repo, session?)
271
+ ghx serve --recon # exposes exactly one MCP tool: recon(question, repo?, session?)
236
272
  ```
237
273
 
238
274
  The recommended skill for agents is the concise recon skill (`ghx skill --recon`,
@@ -284,7 +320,7 @@ matching files. Same command, always useful output.
284
320
  ### Commands
285
321
 
286
322
  ```bash
287
- ghx --version # Health check / installed version
323
+ ghx --version # Health check / installed version (also: ghx version)
288
324
  ghx explore <owner/repo> # Compact branch + tree + README orientation
289
325
  ghx explore <owner/repo> --full # Complete legacy explore output
290
326
  ghx explore <owner/repo> <path> # Compact subdirectory listing
@@ -303,11 +339,36 @@ ghx search <owner/repo> "func main" # Repo-first code search, auto-quote
303
339
  ghx search <owner/repo> "router" --lang go # Narrow by language
304
340
  ghx search <owner/repo> "router" --glob "**/*.go" # Narrow by path glob
305
341
  ghx search "repo:gkoreli/ghx cobra.Command" # Advanced raw GitHub code-search query
342
+ ghx inspect <owner/repo> "routing middleware" # Concern-driven search + ranked files, maps, snippets
306
343
  ghx grep <owner/repo> "func main" # Grep-like repo search
307
344
  ghx grep <owner/repo> "RunE" --path internal/cli --limit 10
308
345
  ghx repos "<query>" # Repo search with README preview
309
346
  ghx tree <owner/repo> [path] # Full recursive tree
310
347
  ghx tree <owner/repo> [path] --depth N # Tree limited to N levels
348
+ ghx code "<js>" # Execute JS with access to all ghx tools
349
+ ghx code --list # List available tools with type stubs
350
+ ghx serve # Start the direct-tools MCP server (stdio)
351
+ ghx serve --http :8080 # Serve MCP over streamable HTTP
352
+ ghx serve --recon # Start the single-tool recon MCP service
353
+ ghx skill # Print the classic CLI skill
354
+ ghx skill --mcp # Print the classic MCP skill
355
+ ghx skill --recon # Print the concise recon skill
356
+ ghx sidecar config init --claude-acp # Write ~/.ghx/config.json for Claude ACP
357
+ ghx sidecar config show # Show resolved sidecar config
358
+ ghx sidecar doctor # Verify token, network, ghx binary, ACP, report sink
359
+ ghx sidecar doctor --live # Run a real one-prompt ACP turn for diagnosis
360
+ ghx sidecar ask --repo <owner/repo> "<q>" # Delegate one repo question to the sidecar
361
+ ghx sidecar ask "<q>" # Discovery question across GitHub
362
+ ghx sidecar ask --repo <o/r> --local "<q>" # Also allow tier-2 local analysis (codemap/ast-grep/repomap)
363
+ ghx sidecar daemon --status # Inspect the warm sidecar daemon
364
+ ghx sidecar daemon --stop # Stop the warm sidecar daemon
365
+ ghx sidecar sessions list # List persisted sidecar sessions
366
+ ghx sidecar sessions show <session> # Metadata + report history
367
+ ghx sidecar sessions ledger <session> # Accumulated evidence ledger JSON
368
+ ghx sidecar sessions reroute <s> <turn> <dest> # Move a mis-routed turn and rebuild ledgers
369
+ ghx sidecar view [session] # Local OTel viewer over session artifacts
370
+ ghx sidecar evals export --format sft --run <dir> --out <file> # Export committed eval episodes
371
+ ghx sidecar report-sink --out <path> # Internal report-sink MCP server used by ACP turns
311
372
  ghx tier2 codemap <owner/repo> # Tier-2 cross-file structure as JSON (local snapshot)
312
373
  ghx tier2 codemap <owner/repo> --context # Agent-ready JSON context envelope (--compact to shrink)
313
374
  ghx tier2 codemap <owner/repo> --importers <file> # Who imports a file (fan-in; needs ast-grep)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gkoreli/ghx",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Agent-first GitHub code exploration. GraphQL batching, code maps, codemode TypeScript sandbox, MCP server.",
5
5
  "bin": {
6
6
  "ghx": "npm/bin/ghx"
@@ -28,11 +28,11 @@
28
28
  "node": ">=16"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@gkoreli/ghx-darwin-arm64": "2.4.0",
32
- "@gkoreli/ghx-darwin-x64": "2.4.0",
33
- "@gkoreli/ghx-linux-arm64": "2.4.0",
34
- "@gkoreli/ghx-linux-x64": "2.4.0",
35
- "@gkoreli/ghx-win32-arm64": "2.4.0",
36
- "@gkoreli/ghx-win32-x64": "2.4.0"
31
+ "@gkoreli/ghx-darwin-arm64": "2.4.2",
32
+ "@gkoreli/ghx-darwin-x64": "2.4.2",
33
+ "@gkoreli/ghx-linux-arm64": "2.4.2",
34
+ "@gkoreli/ghx-linux-x64": "2.4.2",
35
+ "@gkoreli/ghx-win32-arm64": "2.4.2",
36
+ "@gkoreli/ghx-win32-x64": "2.4.2"
37
37
  }
38
38
  }