argos-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Argos CLI

Argos CLI

Run
argos <command> --help
for the exact flags of any command. This skill covers only what
--help
can't: the token model, the output contract, and the command map.
运行
argos <command> --help
可查看任意命令的具体参数。本指南仅涵盖
--help
未提及的内容:令牌模型、输出约定以及命令映射。

Output contract (agents)

输出约定(面向Agent)

  • Pass
    --json
    whenever you parse stdout; commands print human-readable text otherwise.
  • Errors go to stderr as
    Error: <message>
    . Exit
    0
    = success,
    1
    = failure.
  • Never print token values.
  • 当你解析标准输出时,请始终传递
    --json
    参数;否则命令会输出人类可读的文本。
  • 错误信息会以
    Error: <message>
    的形式输出到stderr。退出码
    0
    表示成功,
    1
    表示失败。
  • 切勿打印令牌值。

Authentication

身份验证

A
<buildReference>
is a build number (e.g.
72652
) or a full build URL. With a number, add
--project owner/project
; a URL already contains it. A
<changeId>
is not a build ref: it comes from a diff's
change.id
and does not carry the account, so every
change
command needs
--project owner/project
(or
ARGOS_PROJECT
).
Two token types — pick by command:
CommandsTokenResolution order
build get
,
build snapshots
Project token
--token
ARGOS_TOKEN
review *
,
comment *
,
change *
,
analytics
,
create-project
Personal access token (PAT)
--token
ARGOS_TOKEN
argos login
upload
,
finalize
,
skip
,
deploy
CI / project token
--token
ARGOS_TOKEN
(or tokenless CI)
Project tokens read build data but cannot review, comment, or ignore changes — those need a PAT. If no suitable token is available, ask the user. For these actions, if no PAT exists, report the conclusion and evidence instead of acting.
argos login
is for interactive humans, not CI.
<buildReference>
是构建编号(例如
72652
)或完整的构建URL。如果使用编号,需添加
--project owner/project
参数;URL中已包含该信息。
<changeId>
不是构建引用:它来自差异的
change.id
,且不包含账户信息,因此所有
change
命令都需要
--project owner/project
(或
ARGOS_PROJECT
环境变量)。
有两种令牌类型,需根据命令选择:
命令令牌类型优先级顺序
build get
build snapshots
项目令牌
--token
ARGOS_TOKEN
环境变量
review *
comment *
change *
analytics
create-project
个人访问令牌(PAT)
--token
ARGOS_TOKEN
环境变量 ›
argos login
upload
finalize
skip
deploy
CI/项目令牌
--token
ARGOS_TOKEN
环境变量(或无令牌CI)
项目令牌可读取构建数据,但无法进行审核、评论或忽略变更——这些操作需要PAT。如果没有合适的令牌,请询问用户。对于这些操作,如果不存在PAT,请报告结论和依据,而非执行操作。
argos login
适用于交互式人工操作,不适用于CI环境。

Commands

命令

  • Inspect
    build get <ref>
    ·
    build snapshots <ref> [--needs-review] [--metrics-period 24h|3d|7d|30d|90d]
  • Review
    review list <ref>
    ·
    review create <ref> --event <approve|reject|comment> [--body <md>]
    ·
    review dismiss <ref> <reviewId>
  • Comment
    comment list <ref>
    ·
    comment create <ref> --body <md> [--reply-to <id>] [--diff <id>] [--draft]
    ·
    comment get|edit|delete|resolve|unresolve|subscribe|unsubscribe <ref> <id>
    ·
    comment react|unreact <ref> <id> <emoji>
  • Flakiness
    change ignore <changeId> --project owner/project
    ·
    change unignore <changeId> --project owner/project
  • Account
    analytics --account <slug>
    ·
    create-project <name> --account <slug>
    ·
    whoami
  • CI
    upload <dir>
    ·
    finalize
    ·
    skip
    ·
    deploy <dir>
  • Auth
    login
    ·
    logout
build snapshots --json
enriches each diff with
test.metrics
(flakiness:
stability
,
consistency
,
flakiness
, all 0–1) and, on a change,
change
(
id
,
ignored
,
occurrences
). High
occurrences
or
flakiness
flags a change worth ignoring; pass its
change.id
to
change ignore
.
  • 检查
    build get <ref>
    ·
    build snapshots <ref> [--needs-review] [--metrics-period 24h|3d|7d|30d|90d]
  • 审核
    review list <ref>
    ·
    review create <ref> --event <approve|reject|comment> [--body <md>]
    ·
    review dismiss <ref> <reviewId>
  • 评论
    comment list <ref>
    ·
    comment create <ref> --body <md> [--reply-to <id>] [--diff <id>] [--draft]
    ·
    comment get|edit|delete|resolve|unresolve|subscribe|unsubscribe <ref> <id>
    ·
    comment react|unreact <ref> <id> <emoji>
  • 测试不稳定处理
    change ignore <changeId> --project owner/project
    ·
    change unignore <changeId> --project owner/project
  • 账户
    analytics --account <slug>
    ·
    create-project <name> --account <slug>
    ·
    whoami
  • CI
    upload <dir>
    ·
    finalize
    ·
    skip
    ·
    deploy <dir>
  • 身份验证
    login
    ·
    logout
build snapshots --json
会为每个差异补充
test.metrics
(不稳定指标:
stability
consistency
flakiness
,取值范围0–1),以及变更相关的
change
字段(
id
ignored
occurrences
)。较高的
occurrences
flakiness
值表示该变更值得忽略;可将其
change.id
传递给
change ignore
命令。

Common flows

常见流程

Review a build (inspect with a project token, decide with a PAT):
bash
ARGOS_TOKEN=<project-token> argos build snapshots <ref> --needs-review --json
argos review create <ref> --token <pat> --event approve --json
审核构建(使用项目令牌检查,使用PAT执行操作):
bash
ARGOS_TOKEN=<project-token> argos build snapshots <ref> --needs-review --json
argos review create <ref> --token <pat> --event approve --json

regression: argos review create <ref> --token <pat> --event reject --body "..."

回归处理: argos review create <ref> --token <pat> --event reject --body "..."


Silence a flaky change (inspect with a project token, ignore with a PAT).
Ignored changes stop requiring review and are auto-approved on future builds:

```bash
ARGOS_TOKEN=<project-token> argos build snapshots <ref> --json   # read each diff's change.id + occurrences
argos change ignore <changeId> --token <pat> --project owner/project

忽略不稳定的变更(使用项目令牌检查,使用PAT执行忽略操作)。被忽略的变更将不再需要审核,且在未来构建中会自动通过:

```bash
ARGOS_TOKEN=<project-token> argos build snapshots <ref> --json   # 读取每个差异的change.id和occurrences
argos change ignore <changeId> --token <pat> --project owner/project

revert: argos change unignore <changeId> --token <pat> --project owner/project

撤销忽略: argos change unignore <changeId> --token <pat> --project owner/project


Upload screenshots in CI:

```bash
argos upload ./screenshots --token $ARGOS_TOKEN
Parallel builds:
bash
argos upload ./screenshots --parallel-nonce $ID --parallel-index $i --parallel-total $n
argos finalize --parallel-nonce $ID

在CI中上传截图:

```bash
argos upload ./screenshots --token $ARGOS_TOKEN
并行构建:
bash
argos upload ./screenshots --parallel-nonce $ID --parallel-index $i --parallel-total $n
argos finalize --parallel-nonce $ID