@botiverse/hands-cli

中文文档
0.5.43发布于 2026/11/08MITTypeScriptES Module构建来源已验证近 30 天下载 2697

Hands CLI — manage apps, builds, releases from the terminal.

原始使用文档
文档目录6 节
  1. Install
  2. Quickstart
  3. Direct API access ( hands api )
  4. CI mode
  5. How auth works (v1)
  6. Local logs

@botiverse/hands-cli

Hands CLI — manage apps, builds, releases from the terminal.

Status: alpha. The npm package is public as @botiverse/hands-cli; v1 ships login, logout, whoami, apps create/list/get/client-key, builds list/get, and builds publish-version, builds publish-android, builds publish-ios, builds testflight-groups, builds testflight-publish, builds testflight-status, builds publish-ohos, and builds publish-electron. Other commands listed in docs/cli-reference.md land incrementally as backend endpoints become available.

Install

npm install -g @botiverse/hands-cli
hands --help

# Or run without installing globally:
npm exec --package @botiverse/[email protected] -- hands --help

# Local repo development:
pnpm --filter @botiverse/hands-cli build
pnpm --filter @botiverse/hands-cli start -- whoami

Quickstart

# 1. Log in. The CLI prints a URL you must open in a browser.
hands login

# 2. Verify who you are.
hands whoami

# 3. Create or list apps in your current Hands organization.
hands apps create --slug hands-example-web --name "Hands Example Web" --platform web
hands apps list

# Read the public SDK client key explicitly (app admin only).
hands apps client-key hands-example-web

# 4. List builds for an app (by slug or id).
hands builds list myapp-android

# 5. Publish an Android APK release.
hands builds publish-android raft-android \
  --channel main \
  --apk ./app-release.apk \
  --version-name 1.0.3 \
  --version-code 1000300

For a Node app whose artifacts remain on an external CDN, register one immutable target declaration at a time:

hands builds publish-version raft-computer \
  --version-name 0.72.13 \
  --target darwin-arm64 \
  --source-url https://cdn.raft.build/computer/0.72.13/darwin-arm64 \
  --raw-sha256 "$RAW_SHA256" --raw-size "$RAW_SIZE" \
  --gzip-sha256 "$GZIP_SHA256" --gzip-size "$GZIP_SIZE" \
  --node-version 22.23.1

This records external byte evidence; it does not upload the artifact or activate a release. Repeating the same declaration is idempotent. Changing an immutable version or target field returns a conflict.

Direct API access (hands api)

Call any Hands endpoint directly, over the same server-side RBAC and audit a dedicated subcommand uses — a scripting affordance, not a permission bypass:

hands api GET /api/apps --param platform=android
hands api PATCH /api/apps/<appId>/releases/<releaseId>/shares/<shareId> --data '{"expires_at":null}'
hands api PATCH /api/apps/<appId>/releases/<releaseId>/shares/<shareId> --data @body.json
hands api GET /api/apps/<appId>/feedback/<ticketId>/attachments/<attachmentId> --output attachment.bin
hands --json api GET /api/apps                                               # body only

Path params are raw — <appId> and the other ids are resource UUIDs, not slugs (hands api does not resolve slugs). Same-origin /api/* only (a relative path or a same-origin absolute URL; cross-origin, //protocol-relative, and ../-escape are rejected). Redirects are never followed, so the bearer never leaves the Hands origin. Honors the global --api and --json flags. Full flag reference: https://hands.build/docs/cli-reference/.

CI mode

export HANDS_API=https://hands.build
export HANDS_AUTH_TOKEN=...       # Hands JWT or an app deploy token
hands whoami
hands builds list myapp-android

How auth works (v1)

Raft OAuth uses a browser redirect. Hands converts the successful login into a signed JWT, so hands login asks you to:

  1. Open the printed URL in any browser.
  2. Sign in with Raft.
  3. Copy the JWT shown on the Hands CLI callback page.
  4. Paste it back into the CLI.

The JWT is saved to $XDG_CONFIG_HOME/quiver/auth.json (mode 0600). For CI, pass it via HANDS_AUTH_TOKEN or HANDS_BEARER_TOKEN. The legacy QUIVER_* aliases remain accepted for existing automation.

v2 will swap this for a true headless flow (Raft Device Flow or a --token-stdin service-user mode). See publish-tasks.md P3.4.x.

Local logs

The CLI writes best-effort, redacted JSONL logs under $XDG_STATE_HOME/hands/logs (or ~/.local/state/hands/logs). Logging failures never change command output or exit status. Override the directory with HANDS_LOG_DIR.

Create a gzip bundle only when you have a signed, unexpired collect policy and its Ed25519 public key:

hands logs collect \
  --policy ./collect-policy.json \
  --public-key ./hands-log-policy-public.pem \
  --output ./hands-logs.json.gz

Policy signature, version, expiry, downgrade state, redaction, daily size, per-collection size, concurrency, and network budgets are enforced locally. Rejected collection stays fail-closed and writes an audit log without changing the CLI process exit behavior.

版本与发布记录

@botiverse/hands-cli 共发布 40 个版本,首次发布于 2026/07/09;过去 12 个月发布了 40 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.43latest2026/11/08今天
0.5.422026/11/071 天前
0.5.412026/11/035 天前
0.5.402026/11/025 天前
0.5.392026/11/025 天前
0.5.382026/11/026 天前

关于 @botiverse/hands-cli 的常见问题

@botiverse/hands-cli 是什么?

Hands CLI — manage apps, builds, releases from the terminal.

如何安装 @botiverse/hands-cli?

在项目目录运行 npm install @botiverse/hands-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 hands、quiver,可以用 npx hands 直接运行。

@botiverse/hands-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@botiverse/hands-cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@botiverse/hands-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@botiverse/hands-cli 可以商用吗?

@botiverse/hands-cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@botiverse/hands-cli 的下载量有多少?

根据 npm 官方下载统计,@botiverse/hands-cli 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,697 次,日均约 90 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@botiverse/hands-cli 还在维护吗?

最新版本 0.5.43 发布于 2026/11/08(今天);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/07/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。