cypress-cloud-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCypress Cloud CLI
Cypress Cloud CLI
Use directly to investigate Cypress Cloud. Execute the commands, inspect their JSON, and
report conclusions supported by the returned data. Do not send the user to the Cloud UI when the CLI
can answer the question.
cy-cloud直接使用来调查Cypress Cloud。执行命令、检查其JSON输出,并根据返回的数据得出结论。当CLI可以回答问题时,不要引导用户前往Cloud UI。
cy-cloudStart safely
安全启动
The published binary requires Node.js 22.21.0 or newer.
Run these checks only on first use, when the environment is unknown, or after an installation or
authentication error. If already worked in this session, invoke the investigation command
directly instead of spending another turn rechecking the setup.
cy-cloudbash
node --version
cy-cloud status
cy-cloud --helpAssume is already installed and available on . Run it from the user's current
workspace; do not locate, clone, build, or depend on the cloud-cli source repository. If the command
is unavailable, stop and report the missing prerequisite. The user can install it with:
cy-cloudPATHbash
npm install -g @cypress/cloudIf unauthenticated, ask the user to choose an authentication method:
bash
cy-cloud login # interactive OAuth
cy-cloud login --token "$PAT" # persist a Personal Access TokenFor CI or an existing environment, takes precedence over stored credentials
and writes no credential file.
CYPRESS_CLOUD_TOKENNever print, echo, read back, or commit tokens. Never inspect
or ; use .
~/.config/cy-cloud/auth.jsoncypress.env.jsoncy-cloud statusThe organization must have the Cypress Cloud CLI integration enabled. A response saying it is not
enabled requires action from an organization administrator; it cannot be fixed with another CLI command.
已发布的二进制文件要求Node.js 22.21.0或更高版本。
仅在首次使用、环境未知或安装/认证出错时运行这些检查。如果当前会话中已正常工作,请直接调用调查命令,不要再次检查设置。
cy-cloudbash
node --version
cy-cloud status
cy-cloud --help假设已安装并在中可用。从用户当前工作区运行它;不要查找、克隆、构建或依赖cloud-cli源代码仓库。如果命令不可用,请停止并报告缺失的前置条件。用户可以通过以下命令安装:
cy-cloudPATHbash
npm install -g @cypress/cloud如果未认证,请让用户选择认证方式:
bash
cy-cloud login # 交互式OAuth
cy-cloud login --token "$PAT" # 持久化个人访问令牌对于CI或现有环境,优先级高于存储的凭据,且不会写入凭据文件。
CYPRESS_CLOUD_TOKEN切勿打印、回显、读取或提交令牌。切勿检查或;请使用。
~/.config/cy-cloud/auth.jsoncypress.env.jsoncy-cloud status组织必须启用Cypress Cloud CLI集成。如果返回未启用的响应,则需要组织管理员采取行动;无法通过其他CLI命令修复。
Discover instead of guessing
主动探索而非猜测
Every command supports:
bash
cy-cloud --help
cy-cloud <command> --help
cy-cloud <command> --schemaTreat as authoritative for available commands, per-command as
authoritative for arguments, and as the intended response contract. Use them before
constructing a query when a command, flag, or field is uncertain. Do not memorize a command
inventory from this skill; the installed CLI may be newer or older than these instructions.
Validate the actual response too: can return a fractional , and
can be a fractional epoch even when the schema declares an integer. Treat
those values as numbers and report the schema mismatch if it matters; do not discard or round the
data.
cy-cloud --help--help--schemarun getdurationreplay info.failedAtSuccessful data commands write JSON to stdout. Parse that JSON directly; do not install a JSON
tool to run this skill. Replay download progress is written to stderr, so never combine stderr with
stdout before parsing JSON:
bash
cy-cloud replay timeline --testId <uuid> --attempt <failedAttemptNumber> 2>/dev/nullIf a command fails, rerun without suppressing stderr. Argument-validation errors can appear on
stdout; command execution errors appear on stderr. Both exit with status 1.
Cloud-backed fetches may be blocked by security sandboxes even when local commands such as
succeed. Run Cloud data commands with network access allowed. If a fetch fails with a sandbox or
network denial, retry that same command with broader network permission before diagnosing a CLI,
authentication, or Cloud problem.
statusReplay downloads are cached on disk. Confirm the location with ()
and run Cloud commands so that directory can be written and still exists later in this session. An
ephemeral sandbox that cannot persist it will re-download replay data or fail cache validation,
including on otherwise local commands. Do not relocate the cache into the user's project.
cy-cloud cache info.locationCloud API calls are rate limited per user. Prefer considered, methodical requests: reuse
identifiers already in a URL or prior response, skip org and project discovery when an ID is
known, and do not page further than the question requires. After the first replay download for a
test, and run against the local cache and do not count against
that limit, so those follow-up queries can be chatty. If a command reports an exceeded rate
limit, stop issuing Cloud-backed requests and report the limit; do not retry in a tight loop.
replay inforeplay timeline每个命令都支持:
bash
cy-cloud --help
cy-cloud <command> --help
cy-cloud <command> --schema将视为可用命令的权威来源,将每个命令的视为参数的权威来源,将视为预期响应契约。当对命令、标志或字段不确定时,在构造查询前先使用这些命令。不要依赖本技能中的命令清单;已安装的CLI可能比本说明更新或更旧。同时也要验证实际响应:可能返回小数形式的,即使架构声明为整数,也可能是小数时间戳。将这些值视为数字,如果架构不匹配影响结果则报告该问题;不要丢弃或四舍五入数据。
cy-cloud --help--help--schemarun getdurationreplay info.failedAt成功的数据命令会将JSON写入标准输出。直接解析该JSON;无需安装JSON工具来运行本技能。Replay下载进度会写入标准错误,因此在解析JSON前切勿合并标准错误与标准输出:
bash
cy-cloud replay timeline --testId <uuid> --attempt <failedAttemptNumber> 2>/dev/null如果命令失败,请重新运行且不抑制标准错误。参数验证错误可能出现在标准输出;命令执行错误出现在标准错误。两者都会以状态码1退出。
即使本地命令(如)成功,安全沙箱也可能阻止基于Cloud的获取操作。运行允许网络访问的Cloud数据命令。如果获取操作因沙箱或网络拒绝而失败,请在诊断CLI、认证或Cloud问题前,使用更广泛的网络权限重试同一命令。
statusReplay下载会缓存到磁盘。使用确认位置(),并运行Cloud命令以确保该目录可写入且在本次会话后期仍存在。无法持久化缓存的临时沙箱会重新下载Replay数据或缓存验证失败,即使是本地命令也会如此。不要将缓存迁移到用户的项目中。
cy-cloud cache info.locationCloud API调用按用户限制速率。优先考虑深思熟虑、有条理的请求:重用URL或先前响应中已有的标识符,当已知ID时跳过组织和项目发现,不要超出问题所需的分页范围。在首次下载测试的Replay后,和会针对本地缓存运行,不计入速率限制,因此这些后续查询可以更频繁。如果命令报告速率限制超出,请停止发出基于Cloud的请求并报告限制;不要在循环中重试。
replay inforeplay timelineIdentifiers and pagination
标识符与分页
For , use the project identifier already present in a Cloud URL; both the short slug and
the project UUID are accepted by project/run lookups and run-scoped spec/test lists. Do not perform
organization and project discovery merely to replace a UUID with a slug. is the
per-project run number. and are UUIDs. Attempt numbers are 1-indexed, matching
Cypress Cloud.
projectIdrunNumberspecIdtestIdCloud list responses have ; request more pages when the question is not limited to the
first page.
.pagination对于,使用Cloud URL中已有的项目标识符;短别名和项目UUID都可用于项目/运行查询以及运行范围内的测试用例/测试列表。不要仅仅为了将UUID替换为别名而执行组织和项目发现。是每个项目的运行编号。和是UUID。尝试编号从1开始,与Cypress Cloud一致。
projectIdrunNumberspecIdtestIdCloud列表响应包含;当问题不限于第一页时,请求更多页面。
.paginationRoute by task
按任务路由
Read only the references required for the current task:
- Find orgs, projects, runs, specs, or tests, or open a Cloud URL: read investigation.md.
- Inspect attempts, flakes, or failure screenshots: read investigation.md.
- Query Test Replay: read investigation.md and test-replay.md.
- Diagnose why a recorded test failed: read investigation.md, test-replay.md, and diagnosis.md.
仅阅读当前任务所需的参考资料:
- 查找组织、项目、运行记录、测试用例或测试,或打开Cloud URL: 阅读investigation.md。
- 检查尝试记录、不稳定测试或失败截图: 阅读investigation.md。
- 查询Test Replay: 阅读investigation.md和test-replay.md。
- 诊断录制测试失败的原因: 阅读investigation.md、test-replay.md和diagnosis.md。
Cache and common recovery
缓存与常见恢复方法
bash
cy-cloud cache info
cy-cloud cache cleanup
cy-cloud cache clearUse for normal maintenance. Use only when replay resolution appears
stale or corrupted because it forces future replay downloads. If replay re-downloads every
command, the cache directory is not persisting; retry with a sandbox that can write to the
location reported by .
cache cleanupcache clearcache infoCommon outcomes:
- Missing expected fields: inspect that command's .
--schema - JSON parse failure: ensure stderr was not merged into stdout.
- Cache validation or write errors from the sandbox: retry so the cache directory is writable and persistent; do not copy the cache into the project.
- reporting
cy-cloud versiondoes not by itself mean the installation is broken or outdated. Compare"status": "Unknown"andversion; upgrade only when those values or an explicit compatibility error indicate it.latestVersion - Exceeded rate limit: stop Cloud-backed requests and report the limit; do not retry in a loop. Cached replay queries are exempt once the download has succeeded.
- Replay-specific errors: read test-replay.md.
bash
cy-cloud cache info
cy-cloud cache cleanup
cy-cloud cache clear使用进行常规维护。仅当Replay解析结果看起来过时或损坏时才使用,因为它会强制未来重新下载Replay数据。如果每次命令都重新下载Replay,则缓存目录未被持久化;请使用可写入报告位置的沙箱重试。
cache cleanupcache clearcache info常见问题及处理:
- 缺少预期字段:检查该命令的。
--schema - JSON解析失败:确保未将标准错误合并到标准输出中。
- 沙箱导致的缓存验证或写入错误:重试以确保缓存目录可写入且持久;不要将缓存复制到项目中。
- 报告
cy-cloud version本身并不意味着安装损坏或过时。比较"status": "Unknown"和version;仅当这些值或明确的兼容性错误表明需要升级时才进行升级。latestVersion - 超出速率限制:停止基于Cloud的请求并报告限制;不要在循环中重试。缓存的Replay查询在下载成功后不受限制。
- Replay特定错误:阅读test-replay.md。