Skip to content

feat(cli): add void build logs command - #244

Merged
Brooooooklyn merged 8 commits into
mainfrom
feat/void-build-logs
Jul 2, 2026
Merged

Brooooooklyn merged 8 commits into
mainfrom
feat/void-build-logs

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

What

Adds a void build logs CLI command so project owners can view, follow, and download their container build logs directly — closing the gap where container build logs were previously admin-only.

void build logs [buildId]        # dump the current logs and exit (defaults to the latest build)
void build logs -f               # live-tail until the build reaches a terminal state
void build logs -o build.log     # write logs to a file instead of stdout
void build logs -p my-project    # target a specific project

How

  • PlatformClient: listBuilds(projectId, limit) + getBuildLogs(projectId, buildId, since) fronting the new owner-guarded platform routes (GET /projects/:id/builds, GET /projects/:id/builds/:buildId/logs).
  • build-args.ts: parseBuildArgs — -f/--follow, -o/--output <file>, -p/--project <name>, [buildId] positional; rejects unknown flags / a second positional / unknown subcommands.
  • build-cmd.ts: runBuildLogsCommand resolves the project + latest build, prints the first page, then either exits or enters a pure, injectable followBuildLogs loop that advances a lastSeq cursor and stops on terminal status.
    • github_actions builds have no in-platform log store — the command links out to their GitHub Actions run instead.
    • --output truncates once up front, then appends each page (safe for both dump and follow).
    • Transient errors (non-401/403/404) are retried on both the initial fetch and the follow loop; only auth/not-found errors exit.
  • Wired into the CLI entry (cli.ts) as a top-level build group + interactive menu entry, and documented in help.ts and docs/reference/cli.md.

Tests

  • build-args.test.ts (10), build-client.test.ts (4), build-logs-follow.test.ts (3) — 17 passing.
  • void package typecheck / fmt / lint all clean.

Notes

This is the framework (open-source) half of the feature. The platform half — the two owner-guarded routes it calls — is a separate PR on void-platform. The void-platform submodule pointer will be re-pointed to this PR's merge commit after it lands.

🤖 Generated with Claude Code


Note

Low Risk
Read-only CLI feature gated on existing auth; behavior depends on companion platform routes landing, but failure modes are localized to build log access with solid test coverage for follow/retry logic.

Overview
Adds void build logs so project owners can print, live-tail (-f), or save (-o) container build logs from the platform, defaulting to the latest build when no build id is given.

PlatformClient gains listBuilds and paginated getBuildLogs (via a since / lastSeq cursor) against owner-scoped RDS routes. build-cmd resolves project like deploy (--project, VOID_PROJECT, linked project), handles GitHub Actions builds by printing the external Actions URL instead of streaming, truncates --output once then appends during follow, and uses followBuildLogs with retries on transient errors (5xx, 429) while treating most 4xx (including 426 cli_outdated) as fatal.

The new build command group is registered in cli.ts, help.ts, and docs/reference/cli.md, with unit tests for arg parsing, client calls, and the follow loop.

Reviewed by Cursor Bugbot for commit 0dd7496. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_688b1352-8dc5-40e1-85ba-553792622f23)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78c4b88be6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/build-cmd.ts Outdated
Brooooooklyn and others added 8 commits July 2, 2026 16:51
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tput

Adversarial-review findings: followBuildLogs now retries transient poll
failures (fatal only on 401/403/404) instead of exiting the tail; --output
truncates the file once before the initial dump so re-downloads don't
concatenate stale logs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…etch

Confirm-closure finding: the first getBuildLogs(since=0) was outside the
retry loop, so a transient error on the first poll still killed --follow.
Hoist isFatal/onRetry and apply the same policy to the first fetch (fatal
only on 401/403/404; one-shot mode still exits on any error).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hile following

Reviewer (Codex #244) flagged that a permanent platform error like the
version gate's 426 cli_outdated would be retried forever under `void build
logs -f` (isFatal matched only 401/403/404). The gate isn't wired to the
build-logs routes today so it's unreachable, but harden defensively to match
the rest of the CLI, which always treats 426 as terminal: extract an exported
isFatalFollowError that classifies any 4xx except 429 (rate limit, transient)
as fatal. Surfaces the verbatim upgrade message and exits instead of looping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn force-pushed the feat/void-build-logs branch from 78c4b88 to 0dd7496 Compare July 2, 2026 08:51
@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_6d55c4c1-2514-49f8-b706-6fa11ac137dd)

@Brooooooklyn
Brooooooklyn merged commit ab38b96 into main Jul 2, 2026
7 checks passed
@Brooooooklyn
Brooooooklyn deleted the feat/void-build-logs branch July 2, 2026 09:04
cpojer pushed a commit that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant