跳到主要内容

workspace health

workspace health 请求 SteamHarness Server 的 /health 接口。该命令不需要 token,适合在登录、上传或下载前确认 server 是否可达。

命令格式​

pnpm exec steamharness workspace health [--server <url>]

参数​

参数说明
--server <url>可选。未传时按配置优先级解析 server URL。

server URL 优先级​

顺序来源
1--server <url>
2STEAMHARNESS_SERVER_URL
3CLI 登录态文件
4渠道默认地址(dev:http://localhost:7126;alpha、main 使用对应的部署站点)

输出​

情况输出
server 可达server /health 返回的 JSON。
server 返回非零 errCode输出 JSON,退出码为 1。
网络或解析失败输出错误信息,退出码为 1。

示例​

pnpm exec steamharness workspace health
pnpm exec steamharness workspace health --server http://localhost:7126

常见用途​

场景说明
发布前检查确认 server 已启动且 URL 正确。
排查登录失败区分 server 不可达和 token 无效。