Repository navigation
feat(cli): add build list, build download and baseline download - #405
Merged
gregberge merged 1 commit intoOct 21, 2026
Merged
Conversation
There was no way to bulk export a project's screenshots: a script had to list builds through the API, then call `argos build snapshots --json` on each one to get the image URLs. - `argos build list` lists a project's builds, most recent first, with `--branch`, `--commit`, `--search` and `--limit`. - `argos build download <ref>` writes the screenshots a build captured to a directory (`./argos-build-<number>` by default, `-o` to change it). - `argos baseline download` writes the project's latest baseline: the screenshots of the newest build of the default branch (or `--branch`) that Argos can use as a baseline, for a `--build-name` and `--mode`. The API's `Build` carries no name or type, so the CLI cannot tell a baseline build apart. `baseline download` walks the branch's builds and asks `POST /baseline` for the newest of their commits with an eligible build, which applies Argos's own rules (complete, tests passed, not a subset, approved, not rejected). That endpoint only takes a project token, so a personal access token fails with a hint to use ARGOS_TOKEN. Failure screenshots are left out: Argos never compares them. Files are laid out by snapshot name, so screenshots uploaded from a directory come back under the same paths. A name keeps the image extension it has, since `argos upload` stores JPEGs as PNGs under their `.jpg` name, and gets one only when it has none (Storybook story names). `.` and `..` segments are dropped so every file stays inside the directory, and names that land on the same file get a ` (2)` suffix. The directory must be empty or not exist yet. Downloads run eight at a time, retry server and network errors, and the first file that fails cancels the rest. The build and diff fetch helpers move from `build snapshots` to `lib/build.ts`, unchanged, so the download commands can share them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
gregberge
deleted the
claude/arg-522-export-screenshots-baselines-15132f
branch
October 21, 2026 12:28
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves ARG-522: there was no one-shot way to export a project's screenshots and baselines. Until now a script had to list builds through the API, then run
argos build snapshots <build> --jsonon each one to get the image URLs.This adds three commands:
argos build list: a project's builds, most recent first. Supports--branch,--commit(full SHA),--search,--limitand--project.argos build download <ref>: writes the screenshots a build captured into a directory (./argos-build-<number>by default,-oto change it).--jsonreturns{ build, directory, files: [{ name, status, contentType, url, path }] }.argos baseline download: writes the project's latest baseline. That's the screenshots of the newest build on the default branch (or--branch) that Argos can use as a baseline, for one--build-name(default) and--mode(ci).How the baseline is found
The API's
Buildhas noname,typeormode, and a reference build's status is just its conclusion, so the CLI can't tell a baseline build apart on its own.baseline downloadlists the branch's builds newest first, a page at a time, and asksPOST /baselinefor the first of their commits that has an eligible build. That's the same rule Argos applies when it picks a baseline (complete, tests passed, not a subset, approved, not rejected). It stops after 10 pages (1,000 builds). Failure screenshots are left out, since Argos never compares them.POST /baselineonly accepts a project token, so with a personal access token (includingargos login) the command fails before writing anything and says to useARGOS_TOKEN. A backend endpoint that accepts personal tokens could lift that later without changing the command.How files are written
screenshots/nested/alicia.jpg).argos uploadstores JPEGs as PNG under their.jpgname, and changing the extension would break re-upload. A name with no image extension (Storybook story names) gets one from the content type..and..segments and leading slashes are dropped, and on Windows the characters it rejects are replaced.home/home.png,Home.png/home.png) get a(2)suffix. The output directory must be empty or not exist yet.Also:
build snapshotstolib/build.ts.argos-cliskill lists the new commands and which token each needs.Type of changes
enhancementChecklist
Optional checks:
argos-cliskill is updated, but the CLI reference on argos-ci.com still needs the new commandsFurther comments
What was tested locally:
argos-ci/argos-javascript, using a personalargos loginsession:build listwith each filter.build downloadon #44215 (26 Storybook screenshots) and #44213 (nested fixtures,.jpgnames kept).baseline downloadwith a personal token, which gets the hint.Not run locally:
baseline downloadactually downloading, which needs a project token.e2e/baseline.test.tscovers it in CI. It downloads with each matrix job'sargos-cli-e2e-node-<version>-<os>build name, which theuploade2e test also uses on everymainrun.🤖 Generated with Claude Code