Skip to content
Login

CLI Reference ​

For publishing and installing self-contained Node CLI binaries, see Ship a Node CLI.

@botiverse/hands-cli is the command-line client for Hands. Use it from local scripts or CI to inspect apps, upload Android builds, and publish releases.

Install ​

Install it globally:

bash
npm install -g @botiverse/hands-cli

Or run it without a permanent install:

bash
npm exec --package @botiverse/hands-cli@0.5.15 -- hands --help

In CI, pin a version so release scripts stay reproducible.

Authentication ​

The CLI reads a Hands API server and bearer token from environment variables:

bash
export HANDS_API=https://hands.build
export HANDS_BEARER_TOKEN=<deploy-token>

If HANDS_API is unset, the CLI defaults to https://hands.build. HANDS_AUTH_TOKEN is also accepted as an alias for HANDS_BEARER_TOKEN.

With a deploy token, hands whoami prints the token's name, app, role and permissions (--json returns them under deploy_token, with account: null), so a pipeline can check its credential before it acts. Commands that take an app slug resolve the token's own app from it, so hands releases show, cancel and restore work with a deploy token restricted to one app.

Legacy QUIVER_* names still work: every variable is read as HANDS_<name> first, then QUIVER_<name>, so existing CI keeps working unchanged.

Use app-scoped deploy tokens for CI. Mint them with hands deploy-tokens create (below) or in the app's Settings page, choose the minimum role required, and store the raw token in your CI secret store.

Raft Agent Login sessions are not exported to this CLI. raft integration login authenticates raft integration invoke; it does not populate HANDS_AUTH_TOKEN. An admin agent that needs to bootstrap CI should use hands login and hands deploy-tokens create, write the returned one-time token directly to the CI secret store, and then let the CLI consume that deploy token.

Deploy Tokens ​

App-scoped tokens for CI to publish (publisher) or read (viewer). Managing them requires app admin; if you lack it, the CLI prints an actionable error (which role you need, who can grant it, and that an admin can do it for you).

bash
# Mint a publisher token for CI (printed ONCE — capture it immediately)
hands deploy-tokens create raft-android --name github-ci --role publisher

# Optional expiry, and machine-readable output for scripting
hands deploy-tokens create raft-android --name github-ci --expires-in-days 90 --json

# List an app's tokens (metadata only, never the secret)
hands deploy-tokens list raft-android

# Revoke by id
hands deploy-tokens revoke raft-android <tokenId>

The created token is what you set as HANDS_BEARER_TOKEN in CI. The server stores only a hash, so a lost token can only be revoked and re-minted, never recovered.

GitHub Actions without a stored token (trusted publishers) ​

An app admin can trust a GitHub workflow to publish an app. A matching run exchanges its GitHub OIDC token for a one-hour deploy token, so no Hands secret lives in the repository.

bash
# Trust botiverse/raft-deck's desktop.yml on main and desktop-v* tags
hands trusted-publishers add raft-deck --repository botiverse/raft-deck \
  --workflow .github/workflows/desktop.yml --ref refs/heads/main 'refs/tags/desktop-v*'

hands trusted-publishers list raft-deck
hands trusted-publishers remove raft-deck <publisherId>   # tokens it minted stop working

In the workflow:

yaml
permissions:
  id-token: write
  contents: read
steps:
  - run: npm install -g @botiverse/hands-cli
  - run: hands github-oidc-login --app raft-deck
  - run: hands builds publish-electron raft-deck ...   # uses HANDS_BEARER_TOKEN

hands github-oidc-login masks the token and exports it as HANDS_BEARER_TOKEN for later steps; the step that runs it does not see the variable, so publish in a separate step (--print writes the token to stdout instead). The output names the app, role and expiry, and prints no part of the token. The run must come from the named repository and workflow file, on a ref matching one of the patterns (* matches within one path segment), and in the GitHub environment when one is set. Only push, workflow_dispatch, release and schedule runs match: events such as pull_request_target, workflow_run and issue_comment report the default branch while acting on outside input, so they are refused. The workflow path is case-sensitive. add looks up the repository's numeric id on GitHub (set GH_TOKEN for a private repository); the repository and owner ids are otherwise pinned on the first accepted run, so a deleted and re-created repository or owner of the same name is refused. Prefer a protected GitHub environment (--environment). Third-party actions and reusable workflows that the trusted job calls run with the same identity, so treat them as trusted code. Each GitHub token can be exchanged once, and every exchange is in the app's audit log with the run id, commit and ref. The same settings are under App settings › Access › Trusted publishers.

Signing (Android, macOS, iOS) ​

Hands holds signing keys and certificates for an organization, encrypted, and signs files for the apps they are granted to. Keys never reach CI: the CLI uploads the unsigned file, Hands signs it (macOS: also notarizes with Apple and staples the ticket) and the CLI downloads the signed file, checking its SHA-256.

Org admins manage identities under Organization › Signing, or with the CLI. The upload forms for Apple certificates list where each file comes from: the certificate signing request from Keychain Access, the certificate in the Apple Developer site, the .p12 export from Keychain Access, and the App Store Connect API key. Instead of entering an API key again, an identity can use a copy of the key that an app in the same organization already holds for TestFlight; the form lists those apps by key ID.

Hands can also make the Apple key itself, so nothing goes through Keychain Access. For iOS, "New Apple Distribution certificate" has App Store Connect issue the certificate directly (the API key needs the Admin role). Developer ID certificates can only be created by the Account Holder on the Apple Developer site, so "New Developer ID certificate" gives a certificate request to download, take there, and answer with the issued .cer. The private key never leaves Hands. Certificates that expire within 30 days are flagged on the page.

bash
# A new Android key created inside Hands (RSA 4096, valid 30 years)
hands signing identities generate-android "Deck release" --common-name "Raft Deck" --organization Botiverse
# ...or an existing keystore (PKCS12); passwords from the environment
HANDS_KEYSTORE_PASSWORD=... hands signing identities upload-android "Raft release" release.p12 --alias release
# A Developer ID Application certificate, with an App Store Connect API key for notarization
HANDS_P12_PASSWORD=... hands signing identities upload-apple "Developer ID" devid.p12 \
  --notary-key-id ABC123 --notary-issuer-id <issuer> --notary-key AuthKey_ABC123.p8
# ...or reuse the API key an app in the organization already holds for TestFlight
HANDS_P12_PASSWORD=... hands signing identities upload-apple "Developer ID" devid.p12 --notary-from-app raft-ios
# An Apple Distribution certificate for iOS: with an API key (App Manager or Admin role)
# Hands manages the App Store provisioning profile; or upload profiles with --profile
HANDS_P12_PASSWORD=... hands signing identities upload-apple-ios "Apple Distribution" dist.p12 --asc-from-app raft-ios
# Or let Hands make the Apple key, so no Keychain Access or .p12 export is needed.
# iOS in one step (API key with the Admin role; App Store Connect issues the certificate):
hands signing identities generate-apple-ios "Apple Distribution" --asc-from-app raft-ios
# Developer ID (only the Account Holder can create it, on the Apple Developer site):
hands signing identities request-apple "Developer ID" devid.certSigningRequest --kind developer-id --notary-from-app raft-ios
hands signing identities complete-request <requestId> developerID_application.cer

hands signing identities grant <identityId> raft-deck-android
hands signing identities list
hands signing identities backup <identityId> deck-release.p12   # generated keys only, once

In CI (after hands github-oidc-login, or with any publisher token for the app):

bash
hands sign app-release-unsigned.apk --app raft-deck-android            # signed in place; --out to write elsewhere
hands sign app-release.aab --app raft-deck-android
hands sign "dist/mac-arm64/Raft Deck.app" --app raft-deck --notarize --entitlements entitlements.mac.plist
hands sign build/Deck.ipa --app raft-deck-ios --entitlements ios/Deck/Deck.entitlements

APKs are signed with apksigner (v1–v4 schemes as applicable; native libraries aligned to 16 KB pages), AABs with jarsigner. A macOS .app (directory or .app.zip) is signed with hardened runtime and a secure timestamp, then optionally notarized; package it into a dmg or zip after signing.

An iOS .ipa is built unsigned (CODE_SIGNING_ALLOWED=NO) and re-signed with an Apple Distribution identity and an App Store provisioning profile, ready for TestFlight and the App Store. When the identity has an App Store Connect API key, Hands reads the bundle ID from the app, then reuses an active App Store profile for that App ID and certificate that has more than a week left, or creates a new one. The App ID must exist with the capabilities the app uses; hands signing app-id registers it (see below), a signing run never does. Without an API key, Hands uses the uploaded profile that covers the bundle ID. --entitlements takes the app's entitlements file from the Xcode project ($(AppIdentifierPrefix) is expanded); every entry must be allowed by the profile, and a missing capability fails the job with its name. application-identifier, the team identifier and get-task-allow = false come from the profile. Apps with extensions (PlugIns, watch apps, App Clips) are not supported yet. A key generated in Hands can be downloaded once as a backup; after that Hands is its only holder. Every identity change and signing job is in the audit log with the file hashes and the key fingerprint.

Apple App IDs ​

bash
hands signing app-id raft-deck-ios build.raft.deck --entitlements ios/App/App/App.entitlements          # show what would change
hands signing app-id raft-deck-ios build.raft.deck --entitlements ios/App/App/App.entitlements --apply  # make the changes

Registers the iOS App ID with Apple and turns on the capabilities the entitlements file asks for (for example Associated Domains for com.apple.developer.associated-domains, Push Notifications for aps-environment), using the App Store Connect key of the Apple Distribution identity granted to the app. It needs app admin, so a person or an agent with that role can run it; CI deploy tokens cannot. Without --apply nothing changes. Capabilities come from the entitlements only, never from the command line. Capabilities that need another Apple object the API cannot assign (App Groups, iCloud containers, Merchant IDs, Pass Type IDs) are turned on and listed as manual steps. After a change, App Store profiles Hands made for the App ID are removed so the next signing creates one with the new capabilities. Agents call the same thing as the register-apple-app-id action. Every change is in the audit log.

Org Access Tokens ​

Read-only, fine-grained tokens for one organization: pick the apps (or --all-apps, which also covers apps created later) and the scopes (app:read, feedback:read). A token can select apps the org owns or co-owns as an owner server (an app whose owner-server grant names the org's Raft server); --all-apps covers both. Access to a co-owned app ends as soon as the co-ownership is removed. Co-owned apps count only on tokens created by an org member whose own Raft account is on the co-owning server, the same rule that gives members access to those apps, and they leave the token if that creator leaves the org. The token works only on /api/apps/<appId>/... for apps it covers. Managing them requires org admin from a signed-in session; --org defaults to your current org.

app:read grants everything an app viewer can read, including builds and their public share links, members, audit logs and read-only Google Play calls through Hands; feedback:read grants only feedback tickets (including internal notes, marked internal). Prefer feedback:read alone when that is all a consumer needs. A token covers at most 200 apps and can be valid for at most 3650 days.

bash
# Feedback reader for two apps (printed ONCE — capture it immediately)
hands org-tokens create --name feedback-sync --scope feedback:read --app raft-android raft-ios

# Every app in the org, both scopes, 90-day expiry
hands org-tokens create --org <orgId> --name dashboard --scope app:read feedback:read --all-apps --expires-in-days 90

hands org-tokens list [--include-revoked]
hands org-tokens revoke <tokenId>

Basic Commands ​

Show the installed version:

bash
hands version

Create an app in the current Hands organization (requires org member or higher):

bash
hands apps create \
  --slug hands-example-web \
  --name "Hands Example Web" \
  --platform web \
  --description "Hands web app example"

--platform is one of android, ios, ohos, electron, node, web, or desktop. A desktop app may record what it is built with in --runtime (jvm, electron, native, tauri, or other); the runtime is descriptive only. See Ship a desktop app.

List apps visible to the current token. The list contains exactly the apps you can open: every app of the current organization, plus apps in other organizations reached through an app role or an additional owner server you belong to.

bash
hands apps list

Read the app's public SDK client key explicitly (requires app admin; this does not rotate the key or return any deploy token):

bash
hands apps client-key hands-example-web

Set the app's App Store Connect API key, used for TestFlight upload, App Store and iOS profiles (requires app admin). --from-app reuses the key another app of the organization holds and needs admin of both apps; the key is never returned:

bash
hands apps asc-key raft-deck-ios --from-app raft-ios
hands apps asc-key raft-deck-ios --key-id ABC123 --issuer-id <issuer> --p8 AuthKey_ABC123.p8
hands apps asc-key raft-deck-ios   # show the current key id

List builds for an app:

bash
hands builds list raft-android

Build contents and version diff ​

See what a build's APK or IPA contains: size by category, known SDKs, libraries (Java/Kotlin packages with estimated sizes, native libraries per ABI, iOS frameworks with versions), permissions and components:

bash
hands builds inventory raft-android <build-id>
hands builds inventory raft-android <build-id> --libraries 50   # list more libraries
hands builds inventory raft-android <build-id> --json

Compare a build with the previous build of the same product type (the next lower version code), or with a given build: total and per-category size change, SDKs and libraries added, removed or resized (by size impact), added or removed permissions, services, receivers, providers, activities, background modes and entitlements, and the files that grew most:

bash
hands builds diff raft-android <build-id>
hands builds diff raft-android <build-id> --against <other-build-id>
hands builds diff raft-android <build-id> --json

Inventories are computed when an APK or IPA is uploaded. For older builds, --refresh computes it from the stored package (requires publisher); diff prints this command when one side has no inventory yet:

bash
hands builds inventory raft-android <build-id> --refresh

For R8-obfuscated Android builds, the inventory uses the build's R8 mapping (mapping.txt) to restore class names before grouping Java/Kotlin packages, and prints (names restored with the R8 mapping: N classes mapped, M not in the mapping); --json has the same counts in inventory.mapping. A mapping attached after the APK (hands builds attach-symbols <app> <build-id> mapping.txt) recomputes the inventory. When the dex looks obfuscated and no mapping was applied, the output asks you to upload mapping.txt (inventory.dex.obfuscated is true).

Register External Node / CLI Bytes ​

For an app created with platform node, builds publish-version records one externally hosted target without copying it into Hands storage:

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

Run the command once per target. Hands stores the URL, raw/gzip hashes and sizes, Node version, and provenance under one app/version build. An identical declaration replays successfully; changing version-level or target-level immutable fields returns a conflict. This command does not upload bytes or activate a release/channel pointer.

Publish Hands-hosted CLI Binaries ​

builds publish-cli-binary uploads one or more platform binaries directly to Hands storage and creates one release only after every declared artifact has been verified:

bash
hands builds publish-cli-binary raft-computer \
  --version-name 1.0.33 \
  --channel main \
  --target darwin-arm64 --binary ./raft-computer-darwin-arm64 \
  --target linux-x64 --binary ./raft-computer-linux-x64

--target and --binary pair by position. Optional --runner and --sha256sums values also repeat once per target when used.

The command creates a pending build with its complete artifact slot set frozen, streams each file to a short-lived single-object upload URL, and asks Hands to verify the exact SHA-256 digest and byte size. Hands marks the build succeeded and creates the release only after every frozen slot is ready. Interrupted runs can replay the same declaration: pending assets retain their declared digest and size, while ready assets return no upload URL. The client never receives an R2 bucket credential.

Hosted release URLs under /dl/:slug/releases/:releaseId/:file redirect to a short-lived, object-scoped R2 download URL when R2 signing is configured. The channel URL /dl/:slug/:channel/:file first redirects to an immutable release URL. Download clients must follow redirects (for example, curl -L) and verify the declared digest as before. Keep the Hands release URL for future downloads; the final R2 URL expires. A HEAD request receives a URL signed for HEAD, while GET receives one signed for GET. Redirects are Cache-Control: no-store; this does not promise CDN caching of object bytes. Self-hosted instances without R2 signing continue to stream through Hands.

Publish Android ​

Use builds publish-android to upload an APK and create a release. Per the release policy, CI should pass --draft so a human or agent reviews the changelog before the release goes live.

Only a signed-in person can create an active release. When an agent session or a deploy token runs any builds publish-* command without --draft, the CLI stops before uploading anything and asks for --draft; publish the draft afterwards with hands releases publish.

bash
hands builds publish-android raft-android \
  --apk ./androidApp-release.apk \
  --channel preview \
  --version-name 1.0.0 \
  --version-code 1000000 \
  --changelog-file ./changelog.txt \
  --draft

Package id, SDK levels, and the launcher icon are extracted from the APK automatically on the server — no extra flags needed.

--arch names the APK's ABI and defaults to arm64-v8a. A device asks for the APK of its own ABI and falls back to an APK registered without one. For a universal APK that carries native code for every ABI, pass --arch universal: Hands then serves it to every device, including x86_64 emulators. With --generate-deltas, an ABI-specific APK gets patches from earlier APKs of the same ABI and from universal APKs, and a universal APK gets patches from earlier APKs of any ABI, so switching between universal and arm64-v8a releases keeps patches small. When a version shipped as more than one APK, each one (up to 3) gets its own patch, and every patch records the sha256 of the APK it applies to (from_sha256). For a hand-made patch, --delta-patch <version_code>@<source_apk_sha256>=<path> records it too.

When the app requires human approval for agent releases, hands releases publish from a deploy token or agent session does not publish: Hands answers HTTP 202 with "status": "pending_approval" and an approval_request_id, and the release stays a draft until an app or org admin approves it. Check status in the --json output.

Add support artifacts when available:

bash
hands builds publish-android raft-android \
  --apk ./androidApp-release.apk \
  --mapping ./mapping.txt \
  --symbols ./native-symbols.zip \
  --metadata ./metadata.json \
  --channel preview \
  --version-name 1.0.0 \
  --version-code 1000000

Public update checks only use the installable artifact. Mapping files, native symbols, and metadata stay available through authenticated admin APIs.

To add symbols to an existing build, use hands builds attach-symbols <app> <build-id> <file> --kind <kind>. Kinds are proguard-mapping, native-symbols, and dsym; the command also infers the kind from the filename. A native-symbol archive uses the build's Android, HarmonyOS, or iOS product type to select its platform and requires an explicit --platform if the product type is unknown. Attachments are add-only and do not replace an existing asset in the same slot.

Google Play tracks ​

--track takes Google Play's own track ids: internal (internal testing), alpha (closed testing, or the closed track configured for the app), beta (open testing) and production. The earlier names closed and open are still accepted. A staged rollout (--rollout-percent below 100) works on production and beta:

bash
hands releases play-promote raft-android <release> --track beta \
  --rollout-percent 20 --note "1.28.0 preview to open testing"

Google Play: upload now, send for review later ​

Google Play reviews one set of changes at a time. While another release of the app is in review, hands releases play-promote fails at stage=commit_edit: Hands commits every Play edit with changesInReviewBehavior=ERROR_IF_IN_REVIEW and never cancels a review in progress. To get the next release onto Play anyway, split upload from review:

bash
# 1. Upload: bundle, track release, release notes and mapping/symbols are saved
#    on Play with changesNotSentForReview=true, NOT sent for review
hands releases play-promote raft-android <release> --track production \
  --rollout-percent 100 --note "upload 1.17.0" --changes-not-sent-for-review

# 2. After the other review finishes: send the pending changes for review
hands releases play-send-for-review raft-android <release> --track production \
  --note "1.16.1 review done"
  • Both need the app publisher role and use the same per-package Play edit lock as promote and hands store-listing push.
  • The promotion receipt records review: {requested: false, changes_not_sent_for_review: true} (plain promote: requested: true). If the server could not confirm the flag (an older Play adapter), the receipt says requested: null, reason: "not_acknowledged" and the CLI warns: the release may have been sent for review.
  • play-send-for-review only works for a release Hands promoted to that track. It checks that Play holds the accepted AAB (sha256) and that the track carries its versionCode, then commits an edit without changesNotSentForReview. Its receipt (play-promotion / send-for-review) records the release lifecycle before and after, e.g. RELEASE_LIFECYCLE_STATE_NOT_SENT_FOR_REVIEW -> RELEASE_LIFECYCLE_STATE_IN_REVIEW. Google does not document that such a commit submits changes saved earlier; if the lifecycle did not move to in review, send it for review in Play Console.
  • If another change is still in review, either step fails with edit_in_review / play_edit_in_review and nothing is retried; wait and run it again. An answer Hands cannot classify fails with edit_state_unknown: check Play Console first.

API: POST /api/apps/:appId/releases/:releaseId/distributions/play/promote with changes_not_sent_for_review: true, and POST /api/apps/:appId/releases/:releaseId/distributions/play/send-for-review with {track, expected_revision, approval: {note}} (see OpenAPI).

On a later promotion of the same release, Hands can omit a mapping upload when an earlier successful receipt confirms the exact file and Play still holds the same AAB. The new receipt cites the earlier receipt as historical evidence; Play does not offer a mapping readback, so this does not verify its current contents. Without that evidence, Hands continues to attempt the upload. To explicitly replace the mapping, use play-upload-symbols below.

Google Play: what is in review ​

Before promoting, read what Play holds on every track of the app:

bash
hands play review-status raft-android

It prints what is in review now (track and versionCodes), the production versionCode, and each track's releases with their state: IN_REVIEW, APPROVED_NOT_PUBLISHED, NOT_APPROVED, PUBLISHED, DRAFT. Google allows these reads only about 12 times per app per hour (one per track), so by default each track shows the last answer Play gave Hands (the hourly poll or anyone's live read) and when it was read; --live reads Play now and stores the answer for everyone. Before a promotion, Hands still reads live. If a live read fails, the last stored answer is shown with the reason. If Hands has no stored answer for a track and the live read fails, the command shows the last states the poll observed for it, with the time of each observation, and says so. It then also reads what the track holds right now through a Play edit (the same API promotions use, nothing is changed) and shows each release's status (draft, inProgress with its rollout percentage, halted, completed) and versionCodes under "On the track now". That read carries no review state: completed does not mean approved or published. --json gives the same as JSON (track_contents). Viewer role is enough.

A live read is paid for from the app's shared read quota (see the next section). When that has no room left, Hands does not call Google for the track; it shows the stored answer as for a failed read, with play_quota_exceeded and a quota line saying how many reads were used, when the quota resets, and whether Hands' own budget or Google said it is used up (quota.source is hands_budget or google in --json).

Google Play: read quota ​

Google allows tracks.releases.list (reading a track's releases and their review state) about 12 times per app per hour, measured on 2026-11-22; the count resets around minute :10 of each hour. Several parts of Hands use those reads: the hourly poll, play review-status --live, the stats page, the in-review check before a promotion with --cancel-in-review, and play-send-for-review (which reads the track twice to record the release state before and after). Hands keeps one count per app for all of them, so one caller cannot use up what another needs:

  • the check before a promotion can use all 12;
  • reads a person or agent asked for (review-status --live, the stats page's first read of a track) can use up to 8, leaving 4 for promotions;
  • the hourly poll can use up to 4 (one read per track), and when it has no room it skips the app and reads it again just after the reset.

play-send-for-review is counted after it runs; Hands cannot hold it back. When Google itself answers that the quota is used up, Hands makes no further reads for that app until the reset, because Google's count can include reads Hands did not make. A promotion whose in-review check cannot finish because of the quota fails closed (review_state_unreadable) and its error carries reset_at.

See what is used and what is left:

bash
hands quota raft-android
text
QUOTA                             SCOPE           USED  GATE  INTERACTIVE  BACKGROUND  RESETS
google_play tracks.releases.list  build.raft.app  5/12  7     3            0           2026-11-22T14:10:00.000Z

GATE, INTERACTIVE and BACKGROUND are the reads left for the promotion check, for requested reads, and for the poll. --json prints the API answer (GET /api/apps/:appId/quota): quotas[] with key, service, operation, scope, scope_key, limit, used, remaining.{gate,interactive,background}, reset_at, exhausted_until and source. Only quotas that apply to the app are listed: an Android app with a verified Google Play connection. Viewer role is enough; the command never calls Google.

App Store Connect quota ​

Apple allows each App Store Connect API key a number of requests per rolling hour (3,600 by default) and reports what is left on every response. That count includes calls made with the same key outside Hands, so Hands records what Apple reports rather than counting its own calls. For an app with an ASC key, hands quota adds a line:

text
app_store_connect API key ABC123DEFG: 3412/3600 requests left in Apple's rolling hour (reported 2026-11-23T19:40:00.000Z).

In --json it is a quotas[] entry with window: "rolling_hour", limit, remaining and observed_at (limit and remaining are null when Apple has not reported in the last hour). The scheduled App Store Analytics import waits while less than 10% is left, or for 5 minutes after Apple refuses for quota (HTTP 429, exhausted_until), and tries again 30 minutes later. Requests people and agents make are not held back; when Apple refuses one, its error carries what Apple said.

Google Play: when a Play write gets no response ​

A Play write can finish on Google Play after the CLI has given up waiting (fetch failed). The CLI then reports no response from Hands and does not retry. Before running the command again, check hands releases receipts <app> <release> and hands releases play-status <app> <release>, and compare them with Play Console.

  • After a client disconnect, the server keeps running the write for a short grace period, so a commit that lands shortly afterward still gets its receipt. If the request is cancelled before that, Play can be ahead of Hands: there is no receipt and play-status shows the earlier track.
  • A retry returns edit_conflict while the original request is still running. If that request was cancelled, its per-package Play edit lock expires after 30 minutes, and Play writes for the package then work again.

Google Play: backfill mapping / native symbols for a live version ​

hands releases play-promote only accepts a versionCode above the track maximum, so it cannot attach a mapping to a version that is already on Play. play-upload-symbols uploads the release build's sealed R8/ProGuard mapping (proguard) and/or native debug symbols zip (nativeCode) for its versionCode, which must already be on Google Play. It never changes a track, rollout, bundle or release notes.

bash
# Dry run (the default): opens a temporary Play edit, checks the versionCode,
# deletes the edit and prints what would be uploaded. It does not upload files.
hands releases play-upload-symbols raft-android <release> --note "backfill mapping"

# Upload and commit (only the mapping in this example)
hands releases play-upload-symbols raft-android <release> --kinds proguard \
  --note "backfill mapping" --commit
  • Needs the app publisher role as a signed-in human or agent; deploy tokens are refused. Uses the same per-package Play edit lock as promote.
  • --kinds defaults to the mapping and any native archive declared with the Android release bundle. A generic native archive added with builds attach-symbols is selected only when --kinds nativeCode is explicit; such an archive may cover only part of the app. Promotion also excludes generic native attachments and records attached_native_requires_explicit_selection when no bundle-declared archive is present.
  • Uploading a native archive replaces that version's existing Play native symbols. Before explicitly selecting one, check that it covers every native library and ABI you intend to symbolicate; otherwise you may lose coverage. Hands cannot read the existing Play symbol file back to compare it.
  • If explicit native selection finds different native archives on the build, it fails with symbols_ambiguous instead of choosing one. --kinds proguard is unaffected. A build with no selected files fails with no_symbols, or with native_symbols_selection_required when only a generic native attachment exists.
  • Play must already hold this versionCode with the release's AAB, otherwise the upload fails with version_not_on_play. Play can still reject the file even when the AAB is present; inspect the returned error and do not assume a retry will succeed.
  • The adapter attempts to delete an uncommitted Play edit on failure. A lost response or failed cleanup can leave the result uncertain, including whether a commit completed. Inspect Play and the Hands receipt before retrying; uploading again replaces the file of the same type for that versionCode.
  • --commit writes a receipt (play-promotion / upload-symbols); the dry run writes none and leaves the release revision unchanged. Opening its temporary Play edit can invalidate an existing edit made by the same Google user, even without a commit.

API: POST /api/apps/:appId/releases/:releaseId/distributions/play/upload-symbols with {mode?: "dry_run" | "commit", kinds?, expected_revision, approval: {note}} (see OpenAPI).

Google Play: release notes for a version already on a track ​

play-promote sends the release changelog as Play release notes ("What's new"), but only when it promotes. When a version was promoted without a changelog (or with the wrong one), promote cannot fix it: it refuses a versionCode that is not above the track maximum, and a completed release cannot be halted on Play. play-release-notes replaces the notes of the track release that already carries the release's versionCode, and changes nothing else.

bash
# 1. Write the reviewed, localized changelog (keys map to Play languages:
#    zh/zh-cn -> zh-CN, en -> en-US, ja -> ja-JP, ...; at most 500 characters each)
hands releases update raft-android <release> \
  --changelog-file zh=play/zh-CN.md --changelog-file en=play/en.md --changelog-file ja=play/ja.md

# 2. Put those notes on the production release (track defaults to production)
hands releases play-release-notes raft-android <release> --note "add 1.23 notes"
  • Uses the same changelog-to-Play mapping as promote (Markdown ** stripped, unmapped keys skipped and listed, over 500 characters refused). A changelog that yields no Play language fails the release_notes gate with no_release_notes before any Play call.
  • The release's notes become exactly the mapped list; languages not in the changelog are removed from that release. versionCodes, status, rollout fraction, country targeting and other releases on the track stay as Play returned them, and a readback after the commit checks that.
  • The commit is ERROR_IF_IN_REVIEW and sends the change for review. While another change for the app is in review it fails with edit_in_review; wait for the review to finish and run it again. Hands never cancels a review.
  • Only for a release Hands promoted to that track (not_promoted_to_track otherwise). Needs the publisher role as a signed-in human or agent and the per-package Play edit lock. Writes a play-promotion / release-notes receipt; play-status (track, rollout) is unchanged.

API: POST /api/apps/:appId/releases/:releaseId/distributions/play/release-notes with {track, expected_revision, approval: {note}} (see OpenAPI).

Google Play Store Listing ​

Update the Play store listing text (app name, short and full description, promotional video) and graphics (screenshots, feature graphic, icon) through Hands instead of editing Play Console by hand. Hands holds the app's Google credential; the CLI never sees it. Requires the app publisher role and a verified, enabled Google Play binding.

bash
# Export the live listing in the format push accepts
hands store-listing pull raft-android --out listing.json

# Dry run (the default): Hands opens one Play edit, applies the text,
# runs Google's edits.validate, deletes the edit and prints the plan
hands store-listing push raft-android --listing listing.json

# Publish the same change
hands store-listing push raft-android --listing listing.json --commit

# Only some languages from the file
hands store-listing push raft-android --listing listing.json --locales en-US,ja-JP --commit

# Audit trail
hands store-listing receipts raft-android

listing.json is keyed by Play language tag, with Google's Listing field names:

json
{
  "en-US": { "title": "Raft", "shortDescription": "Chat with your agents", "fullDescription": "…" },
  "zh-CN": { "title": "Raft", "shortDescription": "…", "fullDescription": "…" },
  "ja-JP": { "title": "Raft", "shortDescription": "…", "fullDescription": "…", "video": "https://www.youtube.com/watch?v=…" }
}

Google's list form { "listings": [ { "language": "en-US", "title": "…" } ] } is accepted too. Listing pulls and dry runs open temporary Play edits; creating one can invalidate an existing edit by the same Google user, even without a commit.

  • Languages must be Play store listing tags, spelled exactly as Play lists them: en-US, zh-CN, zh-TW, zh-HK, ja-JP, ko-KR, es-ES, fr-FR, de-DE, pt-BR, iw-IL (Hebrew), es-419, fil, … (86 tags, from Play Console Help "Translate and localize your app"). zh-Hans, en, or en-us are rejected with a suggestion (zh-Hans (did you mean zh-CN?)) before any Play call.
  • Limits (Play Console Help "Create and set up your app"): title 30, shortDescription 80, fullDescription 4,000 characters, counted per character for CJK and Latin alike. Over-long text is rejected (listing_field_too_long), never truncated.
  • Fields you leave out keep their current Play value. A language that is not on Play yet needs title, shortDescription and fullDescription. video: "" clears the video.
  • Languages on Play that are not in the file are left untouched unless you pass --delete-unlisted-languages (the app's default language is never deleted; the flag cannot be combined with --locales).
  • In review: Hands commits with changesInReviewBehavior=ERROR_IF_IN_REVIEW and never cancels another change that is in review. If one is, the push fails with code play_edit_in_review and nothing is committed; wait for the review, then push again. Hands recognises this from Google's structured error reason first and its message second. If Google's answer matches neither (for example a localized message), or a commit returns an unexpected response, the push fails with play_edit_state_unknown and is never reported as done: check the app in Play Console before pushing again.
  • --changes-not-sent-for-review (with --commit) sends changesNotSentForReview=true: for apps whose changes must be sent for review manually, the edit is added to the pending changes and you send it for review in Play Console. Without it, such an app fails with play_changes_not_sent_for_review.

Store listing images ​

--images <dir> replaces screenshots and graphics in the same Play edit as the text (text first, so a new language exists before its images). Use it alone or together with --listing; dry run by default, --commit to publish.

bash
# The designer export layout works as-is
hands store-listing push raft-android --listing listing.json --images ./shots/play
hands store-listing push raft-android --listing listing.json --images ./shots/play --commit

Two directory layouts are accepted (files are uploaded in filename order, numeric-aware, so 01-…, 02-…, … 10-…):

text
<dir>/<device>/<language>/NN-name.png      device first (designer export)
<dir>/<language>/<imageType>/NN-name.png   language first
Device folderPlay imageTypeRule checked before any Play call
phonephoneScreenshots2-8, JPEG or 24-bit PNG (no alpha), sides 320-3840 px, long side ≤ 2× short side
tablet-7sevenInchScreenshots1-8, same screenshot rules
tablet-10tenInchScreenshots1-8, same screenshot rules
tvtvScreenshots1-8, same screenshot rules
wearwearScreenshots1-8, 1:1, at least 384×384
feature-graphicfeatureGraphicexactly 1, 1024×500, JPEG or 24-bit PNG
iconiconexactly 1, 512×512, 32-bit PNG (with alpha), ≤ 1024 KB
tv-bannertvBannerexactly 1, 1280×720, JPEG or 24-bit PNG

Every image is at most 15,728,640 bytes (Google's upload limit) and one push carries at most 24 MiB of images; split larger sets with --locales. Google's appImageTypeUnspecified is rejected as image_type_not_supported.

Language folders are Play tags (en-US, zh-CN, …) or one of the explicit aliases en→en-US, zh-Hans→zh-CN, zh-Hant→zh-TW, ja→ja-JP, ko→ko-KR. A default folder applies to every target language (from --listing, the other language folders, or --locales) that has no folder of its own for that image type.

Each listed (language, imageType) set replaces what Play has (edits.images.deleteall, then upload in order); a set Play already holds byte-for-byte (same sha256 sequence) is skipped. Image types you do not list are left untouched. Hands checks that every uploaded file matches its declared sha256 (fail closed). Google's own Image.sha256 is recorded next to it with sha256_match: true|false|null; a difference is listed in image_warnings and does not fail the push. A commit is read back (image count must match). --ai-generated-state <aiGeneratedStateNotAiGenerated| aiGeneratedStateAiGeneratedDeveloperAttested|aiGeneratedStateUnspecified> is passed to Google's aiGeneratedState for every image. The receipt records each image's sha256, Google's sha256 and whether they match, size, type, pixel size and Google image id.

Every push that reaches Google writes an immutable receipt: who, when, edit id, dry run or commit, the per-language plan, and a sha256 + length of each field. API: GET|POST /api/apps/:appId/distributions/play/store-listing, GET /api/apps/:appId/distributions/play/store-listing/receipts (see OpenAPI).

Publish iOS / TestFlight ​

CI should upload the signed IPA exported by macOS/Xcode, not an unsigned intermediate IPA. Hands stores the IPA and dSYM; Apple signing certificates, profiles, and passwords stay in the CI secret boundary. The separate App Store Connect API key used for server-side upload/distribution stays encrypted in Hands and is never copied to CI or an agent.

Use builds publish-ios after xcodebuild archive and xcodebuild -exportArchive:

bash
hands builds publish-ios raft-ios \
  --ipa ./build/Raft.ipa \
  --dsym ./build/Raft.dSYM.zip \
  --channel main \
  --version-name 1.0.0 \
  --version-code 1000000 \
  --changelog-file zh=./changelog.zh.md \
  --changelog-file en=./changelog.en.md \
  --source-commit "$GITHUB_SHA" \
  --ci-provider github-actions \
  --ci-run-id "$GITHUB_RUN_ID" \
  --ci-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
  --export-method app-store \
  --appstore-build-number 42 \
  --draft

--version-code must match the value the app reports (CFBundleVersion), or iOS crashes will not symbolicate against the right dSYM. The --dsym file is a .dSYM.zip of the archive's *.dSYM bundles; without it, iOS crashes for that version show only raw frames. --export-method, --appstore-build-number, and --testflight-status are recorded as build metadata. publish-ios creates the Hands build/release; it does not itself upload to Apple or activate TestFlight testing.

Since CLI 0.5.49 the .ipa, dSYM archive and metadata file go straight to storage through presigned uploads (up to 5 GiB each), so an IPA larger than 100 MiB no longer fails with HTTP 413. The build stays pending until every file is verified by SHA-256 and size; a mismatch leaves it pending with no release.

An app publisher then starts the server-side upload through the Hands console, API, or CLI (hands builds testflight-upload raft-ios <hands-build-id>, since CLI 0.5.60). It needs the app's App Store Connect key (hands apps asc-key) and the App Store Connect app record for the bundle ID. Poll the returned Apple Build Upload id with the upload-status API until COMPLETE or FAILED (response.state.state; Apple errors/warnings/infos remain alongside it). This stage only uploads and processes the binary: it never assigns a beta group, notifies testers, activates the Hands release, or submits an App Store production release.

After Apple exposes the exact build as VALID, list stable beta group ids:

bash
hands builds testflight-groups raft-ios <hands-build-id>

Distribute to internal testers:

bash
hands builds testflight-publish raft-ios <hands-build-id> \
  --distribution internal \
  --group-id 11111111-2222-3333-4444-555555555555 \
  --what-to-test en-US="Verify login and Activity." \
  --what-to-test zh-Hans="验证登录和活动页。" \
  --wait

External distribution uses the same processed build, but submits TestFlight Beta App Review. --notify-testers enables Apple's automatic notification after approval; for an already-approved build without auto-notify pending, Hands sends the official build beta notification immediately.

bash
hands builds testflight-publish raft-ios <hands-build-id> \
  --distribution external \
  --group-id aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee \
  --what-to-test-file en-US=./testflight.en.txt \
  --what-to-test-file zh-Hans=./testflight.zh.txt \
  --notify-testers \
  --json > testflight-publish-receipt.json

Preserve that mutation response: notification=sent or already_sent is the notification operation receipt. Do not add --wait to this receipt-producing call. With --wait --json, the CLI prints the later polled GET status instead of the original POST response, so notification and operation_id are not preserved.

External review can take longer than a normal CLI session. Inspect the live state separately:

bash
hands builds testflight-status raft-ios <hands-build-id> \
  --distribution external \
  --json

When --wait is useful and the POST operation receipt is not part of the acceptance contract, tune its bounded poll contract with --poll-interval-seconds and --timeout-seconds (defaults: 15 and 3600). Terminal failure/rejection/expiry states fail the command. External mode requires an existing or supplied What to Test localization; selected group ids must all match the requested internal/external mode.

To take a build out of TestFlight (for example one stuck in Beta App Review, which blocks review of any newer build of that version), expire it. Without --commit the command only shows the exact App Store Connect build it would expire and the command to run; --commit sends the confirmed version, build number and ASC build id, and --asc-build-id refuses if App Store Connect now resolves a different build. It needs Hands app admin. Apple keeps the build record; testers can no longer install it.

bash
hands builds testflight-expire raft-ios <hands-build-id>
hands builds testflight-expire raft-ios <hands-build-id> \
  --asc-build-id <asc-build-id-from-preview> \
  --commit

Notification values are not_requested, scheduled, sent, and already_sent. Only sent/already_sent, paired with a fresh exact-build external_build_state=IN_BETA_TESTING, prove notification completion. If the first response is scheduled, wait for that exact testing state, replay the same publish without --wait to preserve already_sent, then fresh-read the status again. VALID, group assignment, BETA_APPROVED, and auto_notify_enabled=false are not notification receipts.

Hands follows Apple's role boundary: uploading the IPA and TestFlight group distribution require Hands app publisher. The stored App Store Connect key must have an Apple role permitted for the requested operation (external testing: Account Holder, Admin, or App Manager; internal testing also permits Developer or Marketing). Apple limits beta builds to 90 days and permits at most one build of a version in Beta App Review at a time.

Official Apple references:

Public external TestFlight beta (since CLI 0.5.86) ​

Prepare an app for a public external beta without the App Store Connect web UI. These commands work on the app (no Hands build needed) and find the App Store Connect app through the main channel's bundle id. Reads need app viewer; beta group and review-detail writes need app admin; beta-description set needs app publisher. Every write is audited, then read back from Apple, and the command fails (READBACK_MISMATCH) unless Apple returns what was asked for.

bash
# 1. Beta groups: list, create an external group with a public link, adjust it
hands testflight beta-groups list raft-ios
hands testflight beta-groups create raft-ios --name "Public Beta" \
  --public-link --public-link-limit 1000 --feedback
hands testflight beta-groups update raft-ios <group-id> --no-public-link-limit-enabled

# 2. Beta App Review Detail (reviewer contact, demo account, notes).
#    The password comes only from stdin or a named environment variable.
printf %s "$DEMO_PASSWORD" | hands testflight review-detail set raft-ios \
  --contact-first-name Ada --contact-last-name Lovelace \
  --contact-phone "+1 555 0100" --contact-email beta@example.com \
  --demo-account-name demo@example.com --demo-account-password-stdin \
  --demo-account-required --notes-file ./review-notes.txt
hands testflight review-detail set raft-ios --demo-account-password-env DEMO_PASSWORD
hands testflight review-detail get raft-ios

# 3. Beta App localizations: description plus feedback email and URLs
hands testflight beta-description set raft-ios \
  --description en-US="A private collaboration app" \
  --feedback-email en-US=beta@example.com \
  --marketing-url en-US=https://example.com \
  --privacy-policy-url en-US=https://example.com/privacy
hands testflight beta-description get raft-ios
  • beta-groups create always creates an external group and refuses a name that another group of the app already uses (case-insensitive, HTTP 409). --public-link-limit takes 1-10000 and also turns the limit on. Apple may fill in the https://testflight.apple.com/join/... link a moment after the link is enabled; if it is missing, list the groups again.
  • beta-groups update refuses public link options on an internal group (Apple allows public links only on external groups) and a group id that belongs to another App Store Connect app.
  • review-detail get never shows the demo password, only whether one is set. Hands never returns, logs or audits it; the audit records field names only.
  • beta-description set changes only the given locales and fields. A locale that does not exist on Apple yet needs --description (or --description-file); URLs must be https://.
  • None of these commands adds a build to a group or submits a build for Beta App Review; use hands builds testflight-publish --distribution external.

API:

ActionRequest
List beta groupsGET /api/apps/<appId>/testflight-beta-groups
Create external groupPOST /api/apps/<appId>/testflight-beta-groups {name, public_link_enabled?, public_link_limit?, public_link_limit_enabled?, feedback_enabled?}
Update groupPATCH /api/apps/<appId>/testflight-beta-groups/<groupId> (same fields, all optional)
Read review detailGET /api/apps/<appId>/testflight-beta-review-detail
Update review detailPUT /api/apps/<appId>/testflight-beta-review-detail {contact_first_name?, contact_last_name?, contact_phone?, contact_email?, demo_account_name?, demo_account_password?, demo_account_required?, notes?}
Read beta localizationsGET /api/apps/<appId>/testflight-beta-app-description
Update beta localizationsPUT /api/apps/<appId>/testflight-beta-app-description {descriptions?: {locale: text}, localizations?: {locale: {feedback_email?, marketing_url?, privacy_policy_url?}}}

TestFlight crash reports and screenshot feedback ​

Pull what testers submitted from TestFlight, using the app's stored App Store Connect key (app viewer is enough). Pulling never changes anything on Apple's side.

bash
# crashes: newest 20 for one build, each crash log saved as .ips
hands testflight crashes raft-ios --build 11200001 --download ./crashes
# screenshot feedback: tester text, device, build, screenshots
hands testflight feedback raft-ios --build 11200001 --download ./shots
# pin the marketing version too, JSON for scripts
hands testflight crashes raft-ios --build 11200001 --app-version 1.12.0 --json

Only crashes a tester chose to share from the TestFlight prompt are available from Apple's API. Unshared crashes appear only in Xcode Organizer, so an empty list does not prove the build never crashed. Some shared crashes have no log on Apple's side (CRASH_LOG_NOT_AVAILABLE). Screenshot URLs are signed by Apple and expire (expires_at). Tester emails are not returned.

These commands find the App Store Connect app through the main channel's bundle id. If it is not set, they fail with BUNDLE_ID_NOT_CONFIGURED; set it with hands channels update raft-ios main --bundle-id <bundle id>. Hands does not fall back to the bundle id in an uploaded build's metadata.

Closing (separate, explicit step). After triage, close the item on Apple's side. This calls Apple's official TestFlight feedback API, and Apple's only resolution for a submission is delete: the crash or screenshot feedback is removed from TestFlight feedback in App Store Connect. Needs app publisher or the feedback:triage permission.

bash
hands testflight close raft-ios crash <crashId>
hands testflight close raft-ios feedback <feedbackId>

API:

ActionRequest
List crashesGET /api/apps/<appId>/testflight-crashes?build=&version=&limit=
Crash logGET /api/apps/<appId>/testflight-crashes/<id>/log (text/plain)
List screenshot feedbackGET /api/apps/<appId>/testflight-feedback?build=&version=&limit=
Close crashDELETE /api/apps/<appId>/testflight-crashes/<id>
Close screenshot feedbackDELETE /api/apps/<appId>/testflight-feedback/<id>

For raw CI drafts, a single --changelog-file ./changelog.txt is still valid. For reviewed notes, prefer repeatable lang=file entries such as --changelog-file zh=zh.md --changelog-file en=en.md.

App Store release ​

hands app-store drives an App Store submission through Hands. Every command that writes to Apple is a dry run unless --commit is passed. Details, the prepare decision table, and the screenshot size table: iOS releases & TestFlight.

bash
hands app-store status raft-ios --version-name 1.17.0
# create, reuse, or rename the version (a withdrawn 1.12.0 becomes 1.17.0)
hands app-store prepare raft-ios --version-name 1.17.0 --build <asc-build-id> [--commit]
# listing text: { "en-US": { "description": "...", "keywords": "...", "promotionalText": "...",
#                 "whatsNew": "...", "supportUrl": "...", "marketingUrl": "..." } }
# a locale new to the version needs description, keywords and supportUrl
hands app-store localizations push raft-ios --version-name 1.17.0 --file listing.json [--commit]
# screenshots: shots/<locale>/<display_type>/NN.png, e.g. shots/en-US/APP_IPHONE_67/01.png
hands app-store screenshots push raft-ios --version-name 1.17.0 --dir shots [--locales en-US,ja] [--commit]
# read-only readiness check; exits 1 when any error is found
hands app-store preflight raft-ios --version-name 1.17.0 [--json]
hands app-store submit raft-ios --version-name 1.17.0 [--commit]
hands app-store withdraw raft-ios --version-name 1.17.0 [--commit]
# after approval (PENDING_DEVELOPER_RELEASE): release -- irreversible
hands app-store release raft-ios <asc-version-id> --version-name 1.17.0 [--build <asc-build-id>] [--commit]

screenshots push --commit exits non-zero unless every set is ok: code SCREENSHOTS_FAILED if any set failed (or was not attempted after an auth or other run-wide error), else SCREENSHOTS_PENDING if Apple was still processing uploaded screenshots. For pending sets, run the dry run again later: if every set is unchanged, files and order are confirmed; if a set shows reorder or replace, run --commit again.

preflight is read-only (viewer role; Hands sends only GET requests to Apple). It prints findings grouped as errors, warnings and info, each with the check, locale / display type, Apple resource path (the same path Apple names in a refused submit's associated errors) and a fix. It exits 1 when there is any error. submit without --commit runs it too and prints its errors.

--release-type MANUAL|AFTER_APPROVAL on prepare is applied to a created, reused or renamed version; without it an existing version keeps Apple's release type.

release refuses unless --version (and --build, when given) match what Apple holds for that version. It prints Released only when Apple reads back READY_FOR_SALE; otherwise it reports Release requested with Apple's current state (Apple releases asynchronously). An already-live version is an error (ALREADY_RELEASED), not a success.

The CLI is a dry run unless --commit for every command. On the API, prepare defaults to mode: "commit" for backward compatibility (its writes are reversible), while listing text, screenshots and release have no default mode (they overwrite live store content or cannot be undone).

--version-id <asc-version-id> can replace --version on the push commands. Screenshot files are ordered by name, numeric-aware (2- before 10-). A push of screenshots identical to Apple's (same MD5s, same order) writes nothing. A refused or failed push prints the per-set or per-locale plan before the error; --json prints the full response.

HarmonyOS signing managed by Hands ​

Hands can set up HarmonyOS (5 and later) signing through AppGallery Connect, the way it does for iOS: it makes the ECDSA P-256 key itself (the key never leaves Hands), has AGC issue the debug or release certificate, registers debug devices and issues the app's profiles. It uses an app's stored AGC credential (PUT /api/apps/<appId>/agc-credentials). A Developer Center service account is developer-level, so another ohos app of the organization can use the same one: hands api PUT /api/apps/<appId>/agc-credentials --data '{"from_app":"raft-ohos"}' copies it (you need the admin role on both apps). A service account is recommended, created in the HarmonyOS Developer Center with a role that may manage certificates and profiles. The app's package name is its main channel's bundle id.

bash
# Org admin: a release identity, using raft-deck-ohos's AGC credential
hands api POST /api/orgs/<orgId>/harmony-signing/identities \
  --data '{"name":"Raft Deck release","kind":"release","agc_from_app":"raft-deck-ohos"}'

# App admin: find or create the AGC app for the package name
hands api POST /api/apps/<appId>/harmony-signing/agc-app

# Debug devices (UDID, type 4 = phone) and the profile
hands api POST /api/apps/<appId>/harmony-signing/devices --data '{"devices":[{"name":"Mate 60","udid":"<udid>","type":4}]}'
hands api GET  /api/apps/<appId>/harmony-signing/devices
hands api POST /api/apps/<appId>/harmony-signing/profiles --data '{"identity_id":"<id>"}'
hands api POST /api/apps/<appId>/harmony-signing/profiles --data '{"identity_id":"<debug id>","device_ids":["<device id>"]}'

A new profile replaces the app's earlier profile of the same kind. AGC's own error text is passed through (code: "agc_request_failed").

Then CI builds unsigned packages and Hands signs them with the app's current profile and its identity (Huawei's hap-sign-tool, SHA256withECDSA; the signed package is verified before it is returned):

bash
hands sign entry-default-unsigned.hap --app raft-deck-ohos --out entry-default.hap
hands sign raft-deck-unsigned.app --app raft-deck-ohos --type app --out raft-deck.app
hands sign entry-default-unsigned.hap --app raft-deck-ohos --kind debug   # debug profile

--no-sign-code turns code signing off. A deploy token with the publisher role can sign (POST /api/apps/<appId>/harmony-signing/jobs, upload, then .../jobs/<jobId>/sign). The signed .app and .hap then go to hands builds publish-ohos as before.

Publish HarmonyOS / OHOS ​

Use builds publish-ohos after CI has assembled and signed the App Pack. The command stores both distribution paths on one build: .app for AppGallery and the standalone signed .hap for user sideloading.

bash
hands builds publish-ohos raft-ohos \
  --app ./raft-ohos-1.0.0-1000000.app \
  --hap ./raft-ohos-entry-1.0.0-1000000.hap \
  --symbols ./ohos-symbols-1.0.0-1000000.tar.gz \
  --metadata ./ohos-release-metadata.json \
  --channel main \
  --version-name 1.0.0 \
  --version-code 1000000 \
  --source-commit "$GITHUB_SHA" \
  --ci-provider github-actions \
  --ci-run-id "$GITHUB_RUN_ID" \
  --ci-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
  --draft

Both .app and .hap are installable assets with distinct file types and distribution metadata. Public update consumers can request filetype=app or filetype=hap; authenticated build views expose both files individually. Signing certificates, profiles, P12 files, and passwords remain in CI and are never uploaded to Hands.

AppGallery invitation testing (OHOS) ​

Hands can push a build's signed .app to AppGallery Connect as an invitation test (Huawei App Testing, releaseType=6). Store listing submission and phased release are not automated yet; do those in AppGallery Connect. The app needs AGC Service Account credentials (Settings → AppGallery) and the channel bundle_id set to the HarmonyOS package name.

CLI (0.5.30+, app admin role). agc upload, agc status, agc listing copy-to-test and agc submit also accept the publisher role, so a CI deploy token (for example a GitHub OIDC trusted publisher) can run them; groups, testers and listing edits stay admin:

bash
hands agc groups raft-ohos
hands agc upload raft-ohos <buildId> --package-name build.raft.mobile \
  --test-desc "1.12.0 (11200003)" --wait
hands agc submit raft-ohos <submissionId> --group <groupId>
hands agc status raft-ohos <submissionId> --events   # or: <buildId> --build

Test groups and testers (CLI 0.5.90+, app admin role). Groups are external by default; internal groups need Huawei to enable AppTest invitations for the app. Testers are added by Huawei account, email or phone (86-<phone> for external groups; 0086<phone> plus --uid for internal groups) and removed by the tester id that testers prints:

bash
hands agc group-create raft-ohos --name "Deck testers"   # prints the group id
hands agc tester-add raft-ohos <groupId> alice@example.com 86-13800000000
hands agc testers raft-ohos <groupId>
hands agc tester-remove raft-ohos <groupId> <testerId>
hands agc groups raft-ohos --internal
hands agc group-delete raft-ohos <groupId>

To see the metadata AppGallery holds for the app or a test version (languages, device types, files, audit state), read-only; values under secret-named keys such as the reviewer test password are redacted (CLI 0.5.91+):

bash
hands agc app-info raft-ohos                              # store listing (release type 1)
hands agc app-info raft-ohos --submission <submissionId>  # invitation-test version

To fill in the store-listing draft (store text, icon and screenshots per language and device type) without the AGC console (CLI 0.5.92+). Huawei checks these before it accepts an invitation-test or store review ("version multidevice info is empty" means they are missing). Nothing is submitted for review:

bash
hands agc listing language raft-ohos --lang zh-CN --name "Raft" \
  --description-file desc-zh.txt --brief "One-line summary" --new-features "What's new"
hands agc listing icon raft-ohos icon-1024.png --lang zh-CN               # phone (device type 4)
hands agc listing screenshots raft-ohos s1.png s2.png s3.png --lang zh-CN  # portrait, display order
hands agc listing screenshots raft-ohos t1.png t2.png --lang zh-CN --device-type 19 --landscape

Description, brief and new features must differ from each other (Hands checks the fields sent together; AppGallery checks against what it already holds). Images are PNG or JPEG, up to 5 MB each and 24 MB per command; HarmonyOS apps use a 1024×1024 icon. Each command prints what AppGallery holds for that language afterwards; hands agc app-info shows the full listing.

App-level store information (developer and contacts, filing, distribution countries, encryption and AI declarations, categories) goes into the draft with listing info (CLI 0.5.96+). --from copies identity, contact, filing and distribution fields from another app you administer; --set sets any supported field, with JSON values where they parse. The review test account is not handled by Hands.

bash
hands agc listing info raft-deck-ohos --from raft-ohos --dry-run   # list the fields only
hands agc listing info raft-deck-ohos --from raft-ohos \
  --set harmonyChildType=10000000 --set kindMainTag=15000007 --set 'kindSubTags=[15000005]'

An invitation-test version keeps its own copy of this metadata, and a new app's test version starts empty. Copy the draft into a test version before submitting it (CLI 0.5.95+), and again after editing the listing. From CLI 0.5.97 this also copies the privacy policy links (privacyPolicy, privacyRightsUrl) set with listing info, and from 0.5.98 the release countries (publishCountry); Huawei checks both on the test version:

bash
hands agc listing copy-to-test raft-ohos --submission <submissionId>
hands agc submit raft-ohos <submissionId> --group <groupId>

To start over with a new test version for the same build (the attempt must not have been submitted for review yet; Hands stops tracking the old one):

bash
hands agc upload raft-ohos <buildId> --package-name build.raft.mobile --fresh --wait

Huawei adds one tester per request; tester-add reports each account and exits non-zero when any failed (accounts already added stay added).

upload reuses an open attempt for the build. After failed, rejected, or stopped, it starts a new attempt (a new AGC test version); the earlier submission keeps its history. A failed response can leave a provider operation uncertain, so inspect the submission and Huawei before trying another upload. hands agc market-status may also record a terminal package state and enqueue a notification; it is not automatically replayed after a 401.

The same flow over the admin API with hands api:

bash
APP=/api/apps/<appId>
# 1. Upload the build's .app and create the test version (reuses an open attempt).
hands api POST $APP/builds/<buildId>/agc-invitation-test \
  --data '{"package_name":"build.raft.mobile","test_desc":"1.12.0 (11200003)"}' --json
# 2. Poll until state is "ready" (Huawei compiles the package, ~1-3 min).
hands api GET $APP/agc-submissions/<submissionId> --json
# 3. List groups, then submit to one or more of them.
hands api GET $APP/agc-test-groups --json
hands api POST $APP/agc-submissions/<submissionId>/submit \
  --data '{"group_id":"<groupId>"}' --json
# 4. Re-read for Huawei's review outcome.
hands api GET $APP/agc-submissions/<submissionId> --json

submit requires an explicit group_id/group_ids when the app has more than one test group; with exactly one group it uses that group. Every GET of a submission re-reads Huawei while the outcome is still open. If a package has finished compiling, that GET can also bind the package to the test version in Huawei. The CLI does not replay this status request after a 401; if the outcome is uncertain, inspect the submission and Huawei before retrying. The stored state follows AppGallery:

Hands stateHuawei test releaseState
processingpackage still compiling (successStatus 1)
readycompiled and bound; 7 准备提交 / 11 撤销审核
testing_review4 正在审核 / 12 预审中
testing_scheduled3 待生效
testing_active0 正在测试
rejected1 审核不通过 / 13 预审不通过 (provider_state.audit_opinion has Huawei's reason)
stopped2 / 10 已失效
failedupload error, or Huawei could not compile the package (successStatus 2); upload again to retry

The raw release_state, audit_opinion, and test window are kept in provider_state. If Huawei cannot be reached the response still returns the stored submission plus sync_error.

Publish Electron (generic provider) ​

Hands can host Electron apps that use electron-updater with the generic provider:

ts
autoUpdater.setFeedURL({
  provider: "generic",
  url: "https://hands.build/electron/raft-desktop/main"
});

Hands hosts electron-builder output as-is. Use builds publish-electron to upload the files from dist/ as build assets on a desktop-installer build/release (legacy name electron-installer also works), then create a draft release for review:

bash
hands builds publish-electron raft-desktop \
  --channel main \
  --version-name 1.2.3 \
  --version-code 10203 \
  --platform win32 \
  --arch x64 \
  --metadata dist/latest.yml \
  --installer "dist/Raft Setup 1.2.3.exe" \
  --blockmap "dist/Raft Setup 1.2.3.exe.blockmap" \
  --changelog-file ./changelog.txt \
  --draft

--metadata, --installer, and --blockmap are repeatable. For multi-platform Electron apps, run the command once per platform/channel so each release has a clear platform/arch pair. The command preserves original filenames through variant and metadata_json.filename, which lets relative URLs inside latest*.yml resolve unchanged.

Required files depend on target OS:

TargetRequired files
Windows NSISlatest.yml, installer .exe, optional .exe.blockmap
macOSlatest-mac.yml, signed .zip for auto-update, optional .dmg for downloads, .blockmap files if generated
Linuxlatest-linux.yml, AppImage or other configured target, .blockmap files if generated

CI systems that need custom orchestration can also call the build, asset, and release APIs directly. Register the original filenames using the same fields:

Fileplatformarchfiletypeartifact_kindFilename field
latest.ymlwin32x64 or nullymlelectron-metadatavariant or metadata_json.filename
latest-mac.ymldarwinarm64 or x64ymlelectron-metadatavariant or metadata_json.filename
latest-linux.ymllinuxx64 or arm64ymlelectron-metadatavariant or metadata_json.filename
Raft Setup 1.2.3.exewin32x64exeinstallablemetadata_json.filename
Raft Setup 1.2.3.exe.blockmapwin32x64blockmapelectron-blockmapmetadata_json.filename

Keep the same draft-first policy as Android: CI creates a draft Electron release, then a human or agent reviews release notes and explicitly publishes. macOS update artifacts must be signed before upload; hands sign --notarize (see Signing) signs and notarizes the .app before it is packaged.

macOS update patches ​

hands electron make-patches makes binary patches from the newest releases on the channel to a new version, verifies each one by applying it, and lists them in the new latest-mac.yml:

bash
hands electron make-patches raft-deck \
  --version-name 0.1.8 \
  --dir release \
  --update-feed release/latest-mac.yml

It needs unzip, diff and Node 22.19+ or 24.6+. It exits 2 when the newest base fails, and then writes no patches. Options, output (patches.json with the build asset slots) and publishing are in Electron update patches.

Changing a published release's update metadata ​

An app admin can replace the latest*.yml a draft or active Electron release serves, without re-publishing, for example to switch delta patches off or to stage a rollout:

bash
hands releases electron-metadata list raft-desktop <releaseId>
hands releases electron-metadata get raft-desktop <releaseId> latest-mac.yml > latest-mac.yml
# edit, then:
hands releases electron-metadata set raft-desktop <releaseId> latest-mac.yml --from latest-mac.yml
hands releases electron-metadata revert raft-desktop <releaseId> latest-mac.yml

What clients install cannot change: version, every files entry and the top-level path and sha512 must match the build's own file exactly, and each patches entry (a file name, or an object with url, path or file) must name a file in the same build. Other fields, such as a rollout percentage, may change. Each replacement is kept and recorded in the audit log; revert serves the previous replacement again, and after the last one the build's own file. /electron/... serves metadata with a 60-second cache, so a change is public within a minute.

Publish a desktop app ​

builds publish-desktop publishes one target of a desktop app, whatever its runtime. It uploads each regular file of the bundle once per app, by SHA-256 (files Hands already holds from an earlier version are reused), then the manifest, the full archive and the optional installer, and creates the release:

bash
hands builds publish-desktop raft-desktop \
  --target darwin-arm64 \
  --channel main \
  --version-name 1.4.0 \
  --version-code 1004000 \
  --bundle build/Raft.app \
  --archive build/Raft-1.4.0-darwin-arm64.zip \
  --installer build/Raft-1.4.0.dmg \
  --notes-file notes.md \
  --draft
OptionMeaning
--target <os-arch>darwin-arm64, darwin-x64, win32-x64, win32-arm64, linux-x64, or linux-arm64 (required)
--version-name <semver>Version name (required)
--version-code <int>Non-negative integer the app reports when it checks for updates (required)
--bundle <path>The .app directory or install directory (required)
--archive <zip>Full archive of the same bundle, the update fallback (required)
--installer <file>Installer for first installs; its file type comes from the extension
--channel <slug>Channel, default main
--notes <text> / --notes-file <path>Release notes
--product-type <type>Default desktop-installer
--force-updateMark the release as a forced update
--draftCreate a draft release (required for agents and deploy tokens)
--jsonPrint the result as JSON

The command refuses a bundle with a symlink that is absolute or points outside it, and stops before creating a build if Hands refuses an uploaded file. It prints how many files the bundle has, how many were uploaded and their size, and how many were reused.

Run it once per target with the same --version-name and --version-code. The first run creates the build and the release; each later run adds its target to that build and keeps the release (a target already on it is not replaced). Agents and deploy tokens add targets only while the release is a draft. The manifest format, multi-target rules, the update check and the file route are described in Ship a desktop app.

Review and Publish (draft flow) ​

CI creates drafts; publishing is an explicit step after changelog review:

bash
# inspect the draft (status, rollout, changelog)
hands releases show raft-android <release-id>

# write the reviewed changelog; repeatable [lang=]file entries
hands releases update raft-android <release-id> \
  --changelog-file zh=changelog.zh.md \
  --changelog-file en=changelog.en.md

# make it live
hands releases publish raft-android <release-id>

Bilingual changelogs are stored per language; clients receive the language matching their locale (zh normalizes to zh-CN; plain single-value changelogs are served as-is).

Exact device-group rollout ​

Create a named group, add stable installation ids reported by the Hands update SDK, then bind a draft release to that group:

bash
hands device-groups create raft-android --name "Artin test devices"
hands device-groups add-member raft-android <group-id> \
  --device-id <installation-device-id> --label "Huawei test tablet"
hands device-groups update raft-android <group-id> \
  --name "Artin test tablets" --description "Physical acceptance devices"
hands releases update raft-android <release-id> --device-group <group-id>
hands releases publish raft-android <release-id> --device-group <group-id>

The final publish remains an explicit authorization step. The CLI first reads release detail, canonicalizes every stored scope, and sends the complete set as expected_scopes together with that detail's expected_revision. The update command also fresh-reads and sends the revision before PATCH. Empty, duplicate, malformed, or unsupported scope state is rejected locally without a publish request. A repeatable --device-group asserts the exact stored device-group subset. Activation returns 409 if any scope or revision drifts between the detail read and the guarded server transition. Only exact group members receive the release; other devices fall back to the prior active release. List groups with hands device-groups list <app> and remove members with device-groups remove-member. Rename or change the operator note with device-groups update. Do not use IMEI or hardware serial numbers.

Percentage rollout with mandatory groups ​

One release can combine a percentage-gated full:all scope with device groups whose members are always included:

bash
hands releases update raft-android <release-id> \
  --full \
  --rollout-percent 25 \
  --always-include-group <acceptance-group-id> \
  --always-include-group <qa-group-id>

hands releases publish raft-android <release-id> \
  --device-group <acceptance-group-id> \
  --device-group <qa-group-id>

--always-include-group is repeatable and implies full:all; --full by itself resets the scope to full only. --rollout-percent accepts integers from 0 through 100, with 100 stored as an unrestricted full rollout. The legacy update form --device-group <id> still replaces the scope with one exact group-only rollout and cannot be combined with the full-rollout options.

There is one non-cancelled release owner per app/channel/product/release-type/version code. The publish commands preflight that coordinate before creating a build or uploading assets. Cancelling disables the old release and frees the version for a corrected upload while preserving its build, assets, and audit history. Restore reactivates an old release only while no replacement owns the version. A rare conflict that wins after CLI preflight marks the new build failed, writes the conflict identity to provenance, and includes the build ID in the terminal error. For Android releases that already reached devices, publish the correction with a higher version code so clients can update.

bash
hands releases share raft-android <release-id> --password <pw>   # password optional
hands releases shares raft-android <release-id>                   # list
hands releases update-share raft-android <release-id> <share-id> --ttl-seconds 1209600
hands releases revoke-share raft-android <release-id> <share-id>

--password can also come from HANDS_SHARE_PASSWORD (legacy QUIVER_SHARE_PASSWORD still works) to keep it out of shell history. Share URLs are printed once at creation; tokens are stored hashed.

Feedback Tickets ​

Agents can triage feedback and crash tickets entirely from the CLI (viewer role for read, publisher for changes):

bash
hands feedback list raft-android --status open --kind crash
hands feedback list raft-android --kind crash --crash-type system_kill
hands feedback list raft-ios --build-scope external
hands feedback show raft-android <ticket-id>
hands feedback update raft-android <ticket-id> --status in_progress --assignee me
hands feedback comment raft-android <ticket-id> "已复现,修复中"
hands feedback update raft-android <ticket-id> --status resolved
hands feedback update raft-android <ticket-id> --status closed --closure-reason completed
hands feedback update raft-android <ticket-id> --closure-reason duplicate --duplicate-of <canonical-ticket-id>

A comment the reporter can see reaches their app only when the ticket was filed from an app connected to Hands (a reporter integration). The comment answer says what happened in reporter_event: queued (the reporter's app is notified), no_reporter_channel (nobody can be notified; reply where they reported it), reporter_inactive (the integration was removed) or internal. hands feedback comment and the console both say so when the reporter is not notified.

hands feedback list shows in-app (SDK) tickets only. TestFlight crashes and screenshot feedback come from Apple and use hands testflight crashes and hands testflight feedback; an empty list prints these commands.

--assignee none unassigns. Closing a ticket requires --closure-reason (completed, not_planned, cannot_reproduce, or duplicate), plus --duplicate-of <ticket-id> for duplicates; no_longer_needed appears only on tickets the reporter closed themselves. All subcommands accept --json for scripting. For iOS apps that enable external report separation, --build-scope accepts standard, external, or all; the default includes configured and unknown origins. Bundle IDs are client-reported and do not verify identity.

Noise rules for crash reports ​

An app can close crash and error reports it knows are noise, for example a vendor's background kill, without hard-coding them in Hands. A rule matches on what a report carries and either closes the ticket as not_planned (close) or leaves it open but out of real-time crash alerts (mute). The report is always stored, and the ticket's metadata names the rule (hands_rule). Native crashes, ANRs and Java exceptions (including system exits that report them, exit reasons 4, 5 and 6) never match unless the rule is added with --no-protect. Rules start disabled, apply to new reports only, and the first enabled rule that matches decides.

bash
# What would it match? Changes nothing.
hands feedback rules preview raft-android --days 30 \
  --match '{"exit_reason_codes":[2],"exit_statuses":[9],"exit_importance_min":200,"foreground":false,"device_brands":["huawei"]}'

hands feedback rules add raft-android --name "Huawei background SIGKILL" --action close --match @rule.json
hands feedback rules list raft-android
hands feedback rules enable raft-android <rule-id>
hands feedback rules disable raft-android <rule-id>
hands feedback rules delete raft-android <rule-id>

# Mark a rule whose matches are confirmed user-started cleanup (e.g. swipe-up
# clean); the daily background kill summary lists them separately.
hands feedback rules set-category raft-android <rule-id> user_cleanup
hands feedback rules set-category raft-android <rule-id> none

Conditions (all given ones must hold): kinds, signatures and device_models (exact, or a prefix ending in *), crash_types, exit_reason_codes, exit_statuses, exit_importance_min / exit_importance_max, exit_descriptions (the Android exit description, whole string, case-sensitive), foreground, channels, device_brands (brand or manufacturer, any case), version_code_min / version_code_max. A rule needs at least one condition besides kinds. The preview scans the newest 5000 crash and error tickets of up to the last 90 days and returns the count, how many are still open, the crash groups and examples. Viewers can list rules; previewing and changing them needs the role that triages tickets (publisher or feedback:triage). API: GET/POST /api/apps/:appId/feedback/rules, PATCH/DELETE /api/apps/:appId/feedback/rules/:ruleId, POST /api/apps/:appId/feedback/rules/preview.

App Webhooks ​

App admins can subscribe an endpoint to one app's events without org-admin rights. The server pins these webhooks to the app; org-wide webhooks (all apps) remain org-admin-only and are not listed here.

bash
# Secret generated and printed once:
hands webhooks create my-app --url https://example.com/hands --events release:new,build:failed
# Or bring your own secret (never on argv):
printf %s "$HOOK_SECRET" | hands webhooks create my-app --url https://example.com/hands --secret-stdin
hands webhooks list my-app
hands webhooks deliveries my-app <webhook-id>
hands webhooks update my-app <webhook-id> --disable
printf %s "$NEW_SECRET" | hands webhooks update my-app <webhook-id> --secret-stdin
# Or let Hands generate the new secret (printed once):
hands webhooks rotate-secret my-app <webhook-id>
# Send one signed `ping` now, also while disabled; exits 1 if the endpoint fails:
hands webhooks test my-app <webhook-id>
hands webhooks delete my-app <webhook-id>

release:new payloads carry release_id, app_id, build_id, channel_id plus version_name, version_code, app_slug and channel (slug), so a consumer can link the pinned public page https://hands.build/apps/<app_slug>/v/<version_name> without an API call.

Omitting --events subscribes to all events. Deliveries carry X-Hands-Signature: sha256=<hex> (HMAC-SHA256 of the raw body with the secret). REST: /api/apps/:appId/webhooks (list/create), /api/apps/:appId/webhooks/:id (PATCH/DELETE), /api/apps/:appId/webhooks/:id/deliveries, POST /api/apps/:appId/webhooks/:id/rotate-secret and POST /api/apps/:appId/webhooks/:id/test; org-wide webhooks have the same routes under /api/orgs/:orgId/webhooks/:id (org admin).

A new secret applies at once to every delivery, retries still pending included, so update the endpoint right after rotating. A test delivery is recorded with the webhook's deliveries as event ping, is attempted once with no retries, and carries {"webhook_id", "sent_by", "message"} as its payload.

Direct API Access (hands api) ​

A power-user / scripting affordance for calling a Hands API endpoint directly, over the same server-side RBAC, audit, and per-endpoint guards a dedicated subcommand uses. It is not a permission bypass and not a generic-SQL escape hatch — every write still hits the same server route.

bash
# GET with repeatable query params
hands api GET /api/apps --param platform=android

# PATCH with an inline JSON body. NOTE: path params are raw — <appId> is the app
# UUID, not a slug: `hands api` passes the path through and does not resolve slugs.
hands api PATCH /api/apps/<appId>/releases/<releaseId>/shares/<shareId> \
  --data '{"expires_at":null}'

# ...or read the same body from a file with @path
hands api PATCH /api/apps/<appId>/releases/<releaseId>/shares/<shareId> \
  --data @body.json

# Binary / same-origin streaming response: write the raw bytes to a file
hands api GET /api/apps/<appId>/feedback/<ticketId>/attachments/<attachmentId> \
  --output attachment.bin

# Machine-readable: print only the response body (no status line)
hands --json api GET /api/apps
  • Raw path params. <appId> and the other ids are the resource UUIDs, not slugs — hands api passes the path through verbatim and does not resolve slugs the way the dedicated subcommands do.
  • No automatic 401 replay. A direct API request is sent once, even for GET: some reads create provider edits. Managed-agent credentials are still refreshed proactively before sending. If a 401 or lost response leaves the outcome uncertain, inspect current state before retrying.
  • Same-origin /api/* only. <path> is resolved against the active Hands API base (honoring the root --api flag). A relative path or a same-origin absolute URL is accepted; cross-origin absolute URLs, //protocol-relative hosts, and ../ traversal that escapes the origin are rejected — so the Authorization bearer never leaves the Hands origin.
  • Redirects are never followed. A 3xx is reported, not chased; following a redirect off-origin would leak the bearer.
  • Auth + RBAC unchanged. Reuses your existing CLI login/token; the server enforces the same role checks as any other call.
  • Flags: --param key=value (repeatable), --data <json|@file>, --output <file> (required for binary). Both the global --api and --json flags are honored.

Stats over a date range ​

hands stats <app> covers the last 30 days (--days N, up to 365). To name the range instead, give UTC days, both inclusive (at most 365 days; --to defaults to today):

bash
hands stats raft-android --from 2026-11-01 --to 2026-11-07 --json

The answer names the range in from and to. For direct installs it adds:

  • direct.daily: devices that reported to Hands on each day ([{date, active_devices}]);
  • direct.active_devices_range: distinct devices over the whole range;
  • direct.by_country: distinct devices per country (ISO code from the network at the device's first report that day; unknown when not known);
  • direct.recorded_since: the first day with daily data. Hands records it from 2026-11-24; earlier days are empty.

These follow the range exactly, with --channel too. The other direct-install counts (direct.devices, by_version, by_channel) count back from now, because Hands keeps only each device's latest report for them. Store daily metrics (stores.*.daily, totals) follow the range, and stores.app_store.by_territory splits the App Store counts by territory. Google Play has no country split yet.

App Store analytics reports ​

Apple produces App Store analytics reports (installs, deletions, sessions, active devices) only after an analytics report request exists for the app, and requests can only be created through the API. An app admin starts them once:

bash
hands api POST /api/apps/<appId>/stats/app-store/analytics-report-requests

Hands resolves the App Store Connect app from the main channel's bundle id and creates an ONGOING request (daily from now on) and a ONE_TIME_SNAPSHOT request (history). Requests that already exist are reused, so running it again is safe; an ONGOING request Apple stopped for inactivity is replaced. The response lists each request and whether it was created. Apple usually delivers the first reports within one to two days. The App Store Connect API key needs a role that can read analytics, such as Admin.

Once reports exist, Hands downloads them on its own: a scheduled job checks each app with an App Store Connect key every few hours and reads each new daily report once. An app admin can run the same bounded read immediately:

bash
hands api POST /api/apps/<appId>/stats/app-store/ingest

hands stats <app> then shows an App Store Analytics line with totals for the window and a table of the most recent days; hands stats <app> --json (or GET /api/apps/<appId>/stats) returns them as stores.app_store.daily, stores.app_store.totals, stores.app_store.analytics_ingest and stores.app_store.analytics_note. These come from Hands' own storage, so they are included with --no-live too.

FieldApple reportMeaning
downloads_first_timeApp Downloads StandardFirst-time downloads (Download Type = First-time download)
downloads_redownloadApp Downloads StandardRedownloads by people who had the app before. Updates and restores are not counted
installations / deletionsApp Store Installation and Deletion StandardInstall and delete events
sessionsApp Sessions StandardApp sessions
active_devicesApp Sessions StandardSum of Apple's Unique Devices over the report's rows

What these numbers can and cannot tell you:

  • They undercount. Installation, deletion, session and device figures only include people who agreed to share analytics with app developers, and Apple drops rows that fall below its privacy thresholds (small territories, rare versions). Expect them to be lower than the totals App Store Connect shows.
  • They lag. Apple publishes a day's report one to two days later, so the most recent days are missing at first.
  • active_devices is an estimate. A device that appears in more than one row of a day (for example, on two app versions) is counted more than once, and the value cannot be added across days. totals therefore gives the highest daily value, active_devices_peak_daily, instead of a sum. For exact active devices of builds that include the Hands SDK, use direct.devices.
  • A missing value is null, not 0: no report covered that metric on that day.
  • If Apple changes a report's columns, Hands records a warning (for example missing_column Unique Devices) in analytics_ingest.warnings and leaves that metric empty rather than guessing. Reports with a missing required column or an unrecognised value are counted in analytics_ingest.instances_incomplete and read again every six hours, so they fill in by themselves once Hands supports the new layout. Reports that could not be downloaded (instances_failed) are retried on the same schedule. A report larger than Hands reads at once (more than 50 files or 32 MiB compressed for one day) is counted in instances_over_limit, with the reason in last_error_code; it is also checked again every six hours.
  • Each downloaded file is checked against the checksum Apple publishes for it and rejected if it does not match. If Apple sends no checksum, or one in a format Hands cannot check, the file is used and the warning checksum_missing or checksum_unverified is shown.

Google Play statistics reports ​

Play Console exports monthly statistics CSVs to a Google-owned Cloud Storage bucket. Hands reads the installs and store performance overview files of the app's package:

  • stats/installs/installs_<package>_<YYYYMM>_overview.csv
  • stats/store_performance/store_performance_<package>_<YYYYMM>_overview.csv

Two things must be in place:

  1. The app can read reports. For a Google-account connection, choose "Authorize statistics reports" under Statistics reports on the Google Play integration page. This is a separate, read-only authorization (devstorage.read_only): if your organization makes it expire, only statistics stop, and publishing keeps working. Until it is granted, Hands tries the publishing connection. For a service account, grant it access to download reports in Play Console.
  2. An app admin sets the reports bucket once. Copy the Cloud Storage URI from Play Console > Download reports > Statistics; it looks like gs://pubsite_prod_rev_<digits>/ (older developer accounts: gs://pubsite_prod_<digits>/). Either the gs:// URI or the bare bucket name is accepted:
bash
hands api PUT /api/apps/<appId>/google-play/stats-bucket --data '{"stats_bucket":"pubsite_prod_rev_0123456789"}'
hands api GET /api/apps/<appId>/google-play/stats-bucket
hands api PUT /api/apps/<appId>/google-play/stats-bucket --data '{"stats_bucket":null}'   # stop reading

Hands then downloads the files on its own: a scheduled job checks each app with a verified, enabled Google Play connection and a bucket every few hours. An app admin can run the same bounded read immediately:

bash
hands api POST /api/apps/<appId>/stats/google-play/ingest

hands stats <app> then shows a Play statistics line with totals for the window and a table of the most recent days; --json (or GET /api/apps/<appId>/stats) returns stores.google_play.daily, stores.google_play.totals, stores.google_play.reports_ingest and stores.google_play.reports_note. These come from Hands' own storage, so they are included with --no-live too.

FieldPlay columnMeaning
user_installs / user_uninstallsDaily User Installs / UninstallsGoogle accounts that installed / removed the app that day
device_installs / device_uninstallsDaily Device Installs / UninstallsDevices that installed / removed the app that day
device_upgradesDaily Device UpgradesDevices that updated the app
install_events / update_events / uninstall_eventsInstall / Update / Uninstall eventsEvery event, repeats included
active_device_installsActive Device InstallsDevices with the app installed that were online recently (point in time)
total_user_installsTotal User InstallsCumulative Google accounts that ever installed (point in time)
store_listing_visitors / store_listing_acquisitionsStore listing visitors / acquisitionsFrom the store performance report

totals sums the daily counts over the window, gives the latest active_device_installs_latest (with its date) and total_user_installs_latest instead of a sum, and store_listing_conversion_rate as acquisitions divided by visitors over the window.

What these numbers can and cannot tell you:

  • They lag 3 to 7 days. Google rewrites the current month's file daily, and recent days can be missing or change. Hands reads each file version once and a newer version replaces that month's numbers, so they are never counted twice.
  • Definitions differ from the Play Console Statistics page, which applies its own filters and recent definitions; expect small differences.
  • A missing value is null, not 0.
  • Columns are mapped by exact name. If a column Hands expects is missing (for example after Google renames it), the metric stays empty, the file counts in reports_ingest.files_incomplete with a missing_column warning, and it is read again later (after 6 hours, doubling up to 4 days) or as soon as Google writes a new version. Columns Hands does not know are listed as unknown_column warnings. Rows whose date does not parse or falls outside the file's month are counted as invalid_rows and keep the file incomplete.
  • Each file is checked against the MD5 that Cloud Storage lists for it and rejected (md5_mismatch) if it differs. Files larger than 2 MiB are not read (files_over_limit).
  • If Google answers 403 or 404 for the bucket, reports_ingest.last_error_code is play_reports_bucket_forbidden or play_reports_bucket_not_found and reports_ingest.hint explains what to check. Hands never switches to a different bucket name by itself; if the configured name has no rev_, the hint suggests checking whether the account uses pubsite_prod_rev_<digits>.
  • Hands only lists and reads stats/installs/ and stats/store_performance/ CSVs of the bound package, with a read-only token. Country and other breakdown files are not read yet.

CI Environment Variables ​

Every variable is read as HANDS_<name> first, then the legacy QUIVER_<name>, so existing CI keeps working unchanged.

VariableRequiredPurpose
HANDS_APINoHands business API base URL. Defaults to https://hands.build. HANDS_CLI_API takes precedence if set.
HANDS_BEARER_TOKENYesApp-scoped deploy token for CI.
HANDS_AUTH_TOKENNoAlias for HANDS_BEARER_TOKEN (tried first).
HANDS_NO_UPDATE_CHECKNoSet to any value to turn off the new-version notice.

Outside CI, the CLI checks npm for a newer version at most once a day and, when one exists, prints one line to stderr with the upgrade command (npm i -g @botiverse/hands-cli@latest). The lookup never delays a command by more than a second and never changes stdout. It is off when CI is set.

Legacy equivalents QUIVER_API, QUIVER_BEARER_TOKEN, QUIVER_AUTH_TOKEN are still accepted.

CI Examples ​

Copy-ready pipelines built on these commands live in examples/ in the Hands repository:

  • A reusable GitHub Action: uses: botiverse/hands/examples/publish-android@examples-v1.
  • Complete GitHub Actions and GitLab CI workflows for Android, iOS (publish + server-side TestFlight upload), and Electron (per-platform channels for the generic provider).
  • Plain-bash scripts for Jenkins, Buildkite, or any runner with bash and npm.

Versioning Guidance ​

For Android releases, keep APK versionCode and Hands version_code identical. Clients only update when the server release has a higher version code than the installed app.

One common scheme is:

text
versionCode = major * 1_000_000 + minor * 10_000 + patch * 100 + build
versionName = major.minor.patch[-suffix]

Example: 1.0.3-rc2 becomes versionName=1.0.3-rc2 and versionCode=1000302.

Security ​

Do not paste deploy tokens, package tokens, signing passwords, or keystore data into public chat, issue comments, logs, or release notes. Store them in the CI secret store and pass them to Hands through environment variables.

Store subscription products ​

Use hands store-products apply <app> --file products.json to preview subscription changes, then add --commit after review. See Store subscription products for the file format, price and activation behavior, and recovery procedure.