Argos Command Line Interface (CLI)
Use the Argos CLI to upload screenshots, inspect builds, and create build reviews from scripts, local workflows, or AI agents.
You can access @argos-ci/cli through our npm package. The source code is available on our GitHub repository.
Installation
- npm
- yarn
- pnpm
- bun
npm i --save-dev @argos-ci/cli
yarn add --dev @argos-ci/cli
pnpm add --save-dev @argos-ci/cli
bun add --dev @argos-ci/cli
Authentication
Your configuration requirements vary depending on the command you run.
For CI uploads, set ARGOS_TOKEN as an environment variable, usually as a CI secret.
You can also specify the token with the --token=<your-repository-token> argument. However, for security reasons, we recommend using an environment variable instead.
For local review commands, sign in once with the browser-based login flow:
- npm
- yarn
- pnpm
- bun
npm exec -- argos login
yarn run argos login
pnpm exec -- argos login
bun x argos login
argos login authorizes the CLI and stores a user token on your machine. This token is used by commands that need to act as a user, such as creating a build review.
Do not use argos login in CI. CI uploads should use ARGOS_TOKEN, --token, or tokenless authentication when supported by your CI integration.
Upload Command
Use the upload command to upload screenshots stored in your ./screenshots directory.
- npm
- yarn
- pnpm
- bun
npm exec -- argos upload ./screenshots
yarn run argos upload ./screenshots
pnpm exec -- argos upload ./screenshots
bun x argos upload ./screenshots
Debug mode
You can enable debug mode by setting the DEBUG environment variable.
- npm
- yarn
- pnpm
- bun
DEBUG=@argos-ci/core npm exec -- argos upload ./screenshots
DEBUG=@argos-ci/core yarn run argos upload ./screenshots
DEBUG=@argos-ci/core pnpm exec -- argos upload ./screenshots
DEBUG=@argos-ci/core bun x argos upload ./screenshots
Build Commands
Use build commands to fetch build metadata, fetch snapshot diffs, and create a review on a build.
Get build metadata
Use build get to fetch status, branch, commit, stats, and the build URL.
- npm
- yarn
- pnpm
- bun
npm exec -- argos build get <buildNumber>
yarn run argos build get <buildNumber>
pnpm exec -- argos build get <buildNumber>
bun x argos build get <buildNumber>
You can also pass an Argos build URL directly:
- npm
- yarn
- pnpm
- bun
npm exec -- argos build get https://app.argos-ci.com/team/project/builds/72652
yarn run argos build get https://app.argos-ci.com/team/project/builds/72652
pnpm exec -- argos build get https://app.argos-ci.com/team/project/builds/72652
bun x argos build get https://app.argos-ci.com/team/project/builds/72652
Use --json when another tool needs to parse the response:
- npm
- yarn
- pnpm
- bun
npm exec -- argos build get https://app.argos-ci.com/team/project/builds/72652 --json
yarn run argos build get https://app.argos-ci.com/team/project/builds/72652 --json
pnpm exec -- argos build get https://app.argos-ci.com/team/project/builds/72652 --json
bun x argos build get https://app.argos-ci.com/team/project/builds/72652 --json
Fetch snapshot diffs
Use build snapshots to fetch snapshot diffs for a build.
- npm
- yarn
- pnpm
- bun
npm exec -- argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --json
yarn run argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --json
pnpm exec -- argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --json
bun x argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --json
Add --needs-review to only return snapshots that need a review decision:
- npm
- yarn
- pnpm
- bun
npm exec -- argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --needs-review --json
yarn run argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --needs-review --json
pnpm exec -- argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --needs-review --json
bun x argos build snapshots https://app.argos-ci.com/team/project/builds/72652 --needs-review --json
Each snapshot diff includes the status, score, diff mask URL, baseline file, current file, and metadata provided by the SDK.
Submit a build review
Use build review to approve a build or request changes.
- npm
- yarn
- pnpm
- bun
npm exec -- argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion approve
yarn run argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion approve
pnpm exec -- argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion approve
bun x argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion approve
To reject the visual changes:
- npm
- yarn
- pnpm
- bun
npm exec -- argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion request-changes
yarn run argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion request-changes
pnpm exec -- argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion request-changes
bun x argos build review https://app.argos-ci.com/team/project/builds/72652 --conclusion request-changes
When you pass a build number instead of a full URL, also pass the project path:
- npm
- yarn
- pnpm
- bun
npm exec -- argos build review 72652 --project team/project --conclusion approve
yarn run argos build review 72652 --project team/project --conclusion approve
pnpm exec -- argos build review 72652 --project team/project --conclusion approve
bun x argos build review 72652 --project team/project --conclusion approve
Project tokens and personal access tokens
Uploads and build reads can use a project token.
Creating a build review requires a personal access token because the review is attributed to an Argos user and checked against that user's project permissions.
To create a personal access token manually, go to your personal account settings, open Tokens, then click Generate new token.
A personal settings tokens page
For build review, authentication is resolved in this order:
--token <token>ARGOS_TOKEN- token stored by
argos login
Project tokens can inspect build data, but they cannot create reviews. If ARGOS_TOKEN contains a project token, use argos login locally or pass a personal access token with --token.
AI Agent Skills
The argos-javascript repository includes skills that help AI agents use Argos CLI commands and review pull requests with Argos build data:
argos-cli: use Argos CLI commands, flags, authentication, and output formats.argos-pr-review: review a pull request with an Argos build as visual evidence.
See Review builds with AI agents to install and use the skills in a pull request review workflow.
Help Command
To view a list of available options, use the argos help command.
- npm
- yarn
- pnpm
- bun
npm exec -- argos help upload
yarn run argos help upload
pnpm exec -- argos help upload
bun x argos help upload