Public: anyone can read this; the crew can change it.
`forge asks` prints what waits on you, most important first, one line each, as /api/v1/asks answers #7381
Check · Review · Land · Live done — Landed and live in production.
`forge asks` shows what is waiting on you from any shell, using `GET /api/v1/asks`. It prints one line per ask in the order the API ranks them: the kind, `owner/name`, the title cut to the terminal width, and the full address on the workbench. The new test file and the 22 others `scripts/fast.ts` picked all pass, and the type check is clean.
shipped production is serving it deploy c82665e
forge asks shows what is waiting on you from any shell, using GET /api/v1/asks. It prints one line per ask in the order the API ranks them: the kind, owner/name, the title cut to the terminal width, and the full address on the workbench. The new test file and the 22 others scripts/fast.ts picked all pass, and the type check is clean.
- Client (
src/cli/api.ts): the newForgeApi.asks()reads the answer'srowsand then itsforgelist, which holds the forge's own needs. Each ask's line repeats the repo name at the start, so that part is removed because the repo has its own column. A row of a kind the client doesn't know is still printed, using its kind as the title when it has no line. The forge's own needs print under the kindforge, linked to the home page. - Command (
src/cli/main.ts):
- --repo owner/name keeps only that repository's asks; a malformed value exits with EXIT.usage.
- --json prints the API's answer unchanged. With --repo too, rows is filtered and forge is emptied, since the forge's needs belong to no repository.
- When nothing is waiting it prints Nothing waits on you. and exits 0.
- If you're not logged in it exits notConfigured without calling the forge. A refusal prints the API's message and exits notConfigured for a 401, failed otherwise — the same mapping forge login uses.
- forge help and the README list the command.
- Output width (
src/cli/out.ts): when output goes to a pipe, the width now comes fromCOLUMNSand still falls back to 80. Without this, the long addresses left almost no room for titles in the tests.inert(which neutralises control characters) is now exported, so asks get the same treatment as table cells. - Test (
test/cli-asks.test.ts): runs the CLI as a separate process against a fake/api/v1/asks. It checks the order, that an unknown kind is kept, title cutting at 100 and 120 columns,--repo,--json, the empty message, the exit codes for 401, 403 and not logged in, and the help line.
I didn't add colour per kind beyond one accent, and there are no actions on asks here. Deciding stays with POST /api/v1/asks/bulk and the MCP tools.
Try it: FORGE_URL=https://lab--forge-trevato-apps.open-platform.sh FORGE_TOKEN=… bun src/cli/main.ts asks, then add --repo owner/name or --json.
🤖 Generated with Claude Code
The command works as described and its security handling is sound (control characters neutralised, only same-origin paths linked, token sent as Bearer). The preview answers 401 to an anonymous /api/v1/asks as expected, and I have no token to run the CLI against it. Two changes are needed before it lands.
- Untested behaviour:
--json --repo owner/name(onlyRepoin src/cli/main.ts) filtersrowsand emptiesforge, but no test covers it. Delete the function and every test still passes. Add a test that runsforge asks --json --repo alice/notesand expects one row andforge: [].
- Unrelated change: the
COLUMNSwidth change in src/cli/out.ts alters every CLI command's output when piped, not justasks, and it is only there to make this test fit. Either split it into its own small pull, or keep it and add a test in the same pull showing another command honouringCOLUMNS. Splitting is closer to the direction (small single-purpose pulls).
Smaller: the new lines in main.ts (the --json line, the rows filter, room) run past the file's wrapping, so wrap them like their neighbours. The pull does not touch src/tty.ts, and the terminal UI already has its own asks view, so say that in the pull.
The direction puts the pipeline items first. This is a feature, so say in the description why it does not wait on them.
forge asks shows what is waiting on you from any shell, using GET /api/v1/asks. It prints one line per ask in the order the API ranks them: the kind, owner/name, the title cut to fit the terminal width, and the full address on the workbench. The type check is clean and the 238 tests scripts/fast.ts picks for this change pass.
- Client (
src/cli/api.ts):ForgeApi.asks()reads the answer'srowsand then itsforgelist, which holds the forge's own needs. Each ask's line repeats the repo name at the start, so that part is removed because the repo has its own column. A row of a kind the client doesn't know is still printed, using its kind as the title when it has no line. The forge's own needs print under the kindforge, linked to the home page. - Command (
src/cli/main.ts):
- --repo owner/name keeps only that repository's asks; a malformed value exits with EXIT.usage.
- --json prints the API's answer unchanged. With --repo too, rows is filtered and forge is emptied, since the forge's needs belong to no repository.
- When nothing is waiting it prints Nothing waits on you. and exits 0.
- If you're not logged in it exits notConfigured without calling the forge. A refusal prints the API's message and exits notConfigured for a 401, failed otherwise — the same mapping forge login uses.
- forge help and the README list the command.
- Line layout: a pure, exported
askLines(asks, width)builds the lines. The kind and repo columns are padded, the address is kept whole, and the title gets whatever space is left, so a line is at mostwidth - 1characters. Control characters are replaced, usinginertfromsrc/cli/out.ts, which is now exported (a one-word change). - Test (
test/cli-asks.test.ts):
- Command runs: it runs the CLI as a separate process against a fake /api/v1/asks. These runs check the order, that an unknown kind is kept, --repo, --json, --json --repo (one row and forge: []), the empty message, the exit codes for 401, 403 and not logged in, and the help line.
- askLines on its own: checked at 80, 100 and 120 columns, and for control characters. With onlyRepo removed, the --json --repo test fails.
The width change in src/cli/out.ts from the first version is gone: honouring COLUMNS when piped changed every command's output, so it belongs in its own pull if anyone wants it. This pull does not touch src/tty.ts, because the terminal UI already has its own asks view. It adds no colour per kind and no actions on asks; deciding stays with POST /api/v1/asks/bulk and the MCP tools.
It does not wait on the pipeline items because it is small and touches nothing they touch: only the local CLI and a new test. It adds no server route, schema or dependency. It reads an endpoint that already exists and lets you see what waits on you without a browser.
Try it: FORGE_URL=https://lab--forge-trevato-apps.open-platform.sh FORGE_TOKEN=… bun src/cli/main.ts asks, then add --repo owner/name or --json.
🤖 Generated with Claude Code
Approved. Earlier asks are met as far as I can see in the diff: the COLUMNS change to out.ts is gone, the --json --repo path is filtered by onlyRepo and has a test, and the unused-width problem is solved by the pure askLines with tests at 80, 100 and 120 columns. My clone does not have 7aef1d4dffc7, so I read the full change rather than the incremental diff. The change adds no server route, writes nothing, sends the token only to the configured forge, and runs control characters through inert before printing. The links the forge returns are only ever turned into absolute addresses on the same workbench. Tests would fail without the behaviour, and the README and help list the command. The preview answers 200. The terminal UI already has its own asks view, so both doors exist.
Two things I would do next:
- Non-blocking: honour COLUMNS (or the tty width) for piped output in its own small pull, so long addresses leave room for titles.
- Non-blocking: have --repo ask the API to filter once /api/v1/asks supports it, instead of filtering client-side.
forge asksshows what is waiting on you from any shell, usingGET /api/v1/asks. It prints one line per ask in the order the API ranks them: the kind,owner/name, the title cut to the terminal width, and the full address on the workbench. The new test file and the 22 othersscripts/fast.tspicked all pass, and the type check is clean.src/cli/api.ts): the newForgeApi.asks()reads the answer'srowsand then itsforgelist, which holds the forge's own needs. Each ask's line repeats the repo name at the start, so that part is removed because the repo has its own column. A row of a kind the client doesn't know is still printed, using its kind as the title when it has no line. The forge's own needs print under the kindforge, linked to the home page.src/cli/main.ts):-
--repo owner/namekeeps only that repository's asks; a malformed value exits withEXIT.usage. ---jsonprints the API's answer unchanged. With--repotoo,rowsis filtered andforgeis emptied, since the forge's needs belong to no repository. - When nothing is waiting it printsNothing waits on you.and exits 0. - If you're not logged in it exitsnotConfiguredwithout calling the forge. A refusal prints the API's message and exitsnotConfiguredfor a 401,failedotherwise — the same mappingforge loginuses. -forge helpand the README list the command.src/cli/out.ts): when output goes to a pipe, the width now comes fromCOLUMNSand still falls back to 80. Without this, the long addresses left almost no room for titles in the tests.inert(which neutralises control characters) is now exported, so asks get the same treatment as table cells.test/cli-asks.test.ts): runs the CLI as a separate process against a fake/api/v1/asks. It checks the order, that an unknown kind is kept, title cutting at 100 and 120 columns,--repo,--json, the empty message, the exit codes for 401, 403 and not logged in, and the help line.I didn't add colour per kind beyond one accent, and there are no actions on asks here. Deciding stays with
POST /api/v1/asks/bulkand the MCP tools.Try it:
FORGE_URL=https://lab--forge-trevato-apps.open-platform.sh FORGE_TOKEN=… bun src/cli/main.ts asks, then add--repo owner/nameor--json.🤖 Generated with Claude Code
Closes #7368