Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:11dcc1si0e is past its budget: trevato/forge: "every command `forge help` lists has a heading in docs/CLI.md" failed on 3 pulls in the last hour — the… #8237

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/8235-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. mason/8235-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as a3a3096.

Review

Sign in to review this change.
2 files changed +22 −21
docs/CLI.md +15
@@ -448,3 +448,18 @@ Flags: `--root DIR`.
448448 ```console
449449 $ forge ui
450450 ```
451
452 ## forge talk
453
454 Say something to the forge's own agent, as you, and print what it answers.
455 The agent works through the forge's MCP with your permissions; a write it
456 would make is held for your yes. The words are 1 to 20,000 characters
457 (exit 2 when empty or too long); a 401 exits 3. It waits up to two minutes
458 for the answer, then says to read it on the feed.
459
460 Flags: none.
461
462 ```console
463 $ forge talk "what is waiting on me?"
464 Two pulls are green and wait for your merge: #12 and #15.
465 ```
test/cli-docs.test.ts +7 −21
@@ -1,35 +1,21 @@
11 /**
22 * docs/CLI.md keeps up with the CLI (#7372): every command `forge help`
3 * prints has a `## forge <command>` heading there. The help is captured the
4 * way a shell sees it — `bun src/cli/main.ts help` as a process — because
5 * `main` writes to the real stdout, not to a writer a test can hand it.
3 * prints has a `## forge <command>` heading there. The help is rendered
4 * in-process: spawning a process made the verdict depend on the machine's load.
65 */
76
87 import { expect, test } from "bun:test";
98 import { readFileSync } from "node:fs";
10 import { tmpdir } from "node:os";
9 import { printUsage } from "../src/cli/help.ts";
10 import { createOut } from "../src/cli/out.ts";
1111
1212 const root = new URL("..", import.meta.url).pathname;
1313 const DOC = "docs/CLI.md";
1414
1515 async function help(): Promise<string> {
16 const ran = Bun.spawn([process.execPath, "src/cli/main.ts", "help"], {
17 cwd: root,
18 env: {
19 PATH: process.env["PATH"] ?? "",
20 HOME: tmpdir(),
21 NO_COLOR: "1",
22 FORGE_KEYCHAIN: "0",
23 },
24 stdout: "pipe",
25 stderr: "pipe",
26 });
27 const [stdout, exitCode] = await Promise.all([
28 new Response(ran.stdout).text(),
29 ran.exited,
30 ]);
31 expect(exitCode).toBe(0);
32 return stdout;
16 const lines: string[] = [];
17 printUsage({ ...createOut(), line: (t = "") => void lines.push(t) });
18 return lines.join("\n").replace(/\x1b\[[0-9;]*m/g, "");
3319 }
3420
3521 /** ` forge sync [--watch]` → "sync"; the bare ` forge the local…` → "": a command is one space after `forge`, a description many. */

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs