Qnbot CLIPackage management

Package management

Sign in to the algorithm source, then install, download, and update packages.

Latest documentation

Package management

Install & update

Configure access to the algorithm source

In Studio, open Developer configuration → Token configuration to obtain the CLI token for your account, then configure it:

qnbot algorithm config-token TOKEN

You can also sign in with your Studio phone number and password. Pass the phone number to -u. The compatibility alias --app-key also takes a phone number. The command reads the password through a hidden prompt:

qnbot algorithm login -u PHONE_NUMBER

Automation can read one password line from standard input:

secret-manager-command | qnbot algorithm login -u PHONE_NUMBER --password-stdin

The CLI and Studio use the same account permissions and require separate sign-ins. The CLI saves the token obtained at login. Keep credentials in a secure credential manager.

config-token saves the token. After login or configuration, query the online catalog to verify the token and account access:

qnbot algorithm list --available

If the command returns AuthenticationRequired, the token may have expired or be invalid. Sign in again or configure a newly issued valid token with qnbot algorithm config-token TOKEN, then check the list again. QNBOT_ALGORITHM_TOKEN, when set, overrides the saved token; update or remove that environment variable as well.

Verify the credential source and catalog access

qnbot algorithm auth-status
qnbot algorithm auth-status --json

Successful verification reports verified catalog access and JSON data.authenticated=true. An account with an empty authorized catalog also passes verification.

token_source identifies where credentials are read: environment uses a nonempty QNBOT_ALGORITHM_TOKEN, which takes priority over a saved token; sdk_store reads from the SDK credential store. Read authenticated or the returned error for the authentication result. Update or remove the environment variable when changing credentials. This command only queries access status.

Failures return authentication, authorization, or network error codes. JSON error.details.token_source identifies the credential location. Sign in or configure a token after authentication errors, ask the provider about permission errors, and restore connectivity before verifying again after network errors.

Install from the online source

List the packages the current account can access, then install by App ID:

qnbot algorithm list --available
qnbot algorithm install APP_ID
qnbot algorithm install APP_ID@VERSION

Without a version, install and download select the same highest canonical stable SemVer visible to the current account for the current platform. Catalog order and backend publication-stage names do not define SemVer stability. With only prereleases or no matching platform, install returns PackageUnavailable instead of choosing a preview or another platform. Use APP_ID@VERSION for an exact supported stable or prerelease version; a missing or changed exact resource fails without fallback. The SDK still validates the package and compatibility. Pin @VERSION in scripts that need reproducible selection.

Troubleshoot online installation

Check the error code first. AuthenticationRequired, AuthenticationFailed and AuthorizationDenied indicate algorithm-source access failures. Sign in again with qnbot algorithm login -u PHONE_NUMBER and confirm the account's access permissions. If QNBOT_ALGORITHM_TOKEN is set, update or remove its invalid value as well.

PackageUnavailable (exit 27) means no usable unique target resource exists, or an unversioned install has no stable candidate for this platform. Query the current account's catalog and use the online row's package_id as the install App ID. This can differ from the installed package's native ID:

qnbot algorithm list --available --app-id APP_ID --platform macos-arm64
qnbot algorithm install APP_ID@VERSION

Replace macos-arm64 with the installation machine's actual platform. Retry with an explicit version only when that version appears in the list.

  • No exact App ID: the target is not visible in the current account's catalog. Verify the App ID and ask the publisher to check publication, account grants and platform resources. An empty catalog alone does not identify which cause applies. Do not try a similarly named package.
  • Application visible but requested platform or version absent: verify the operating system, CPU architecture and version, then ask the publisher for the matching resource.
  • Multiple versions for the platform: bare install and download select the highest visible canonical stable SemVer. With only prereleases, explicitly select a listed APP_ID@VERSION. Pin a version for reproducible selection.
  • Duplicate App ID or multiple resources for the same platform and version: ask the publisher to remove duplicate records before retrying. Repeating the install does not resolve the ambiguity.

Use PackageUnavailable and exit code 27 to detect unavailable packages in scripts. The message identifies a missing application, platform or version, or an ambiguous catalog entry.

Download packages for offline machines

Algorithm catalog queries and downloads support these desktop targets: linux-x86_64, linux-arm64, macos-x86_64, macos-arm64, windows-x86_64 and windows-arm64. --all-platforms downloads resources available to the current account within this range. See Quick start for CLI installation platforms.

Discover authorized platforms and versions, then download using the exact App ID from the list:

qnbot algorithm list --available --all-platforms
qnbot algorithm download APP_ID --platform linux-arm64 --platform windows-x86_64 -o ./packages
qnbot algorithm download APP_ID@VERSION --platform linux-arm64 -o ./packages
qnbot algorithm download --all --all-platforms -o ./packages

Without platform flags, download targets the host. Repeat --platform for multiple targets, or use mutually exclusive --all-platforms to query supported platforms and select only visible resources. --all selects authorized packages and cannot be combined with App ID operands. For each App ID/platform, an unversioned download chooses the highest SemVer without a prerelease suffix. Install and download share this default selection rule; backend publication-stage names do not define SemVer stability. An explicit @VERSION matches exactly and can select an authorized prerelease.

The default output is ./packages/<platform>/; filenames contain the App ID, version and platform. Download saves original ZIPs without installing packages or loading libraries for another architecture. Copy the corresponding directory to the target machine, then install, for example on Linux ARM64:

qnbot algorithm install ./packages/linux-arm64/

After downloading, run install on the target machine to check package contents, platform, architecture, and ABI compatibility. Concurrency defaults to 4; adjust it with --jobs 2. Existing destinations fail with a conflict unless --overwrite is explicit; failed transfers preserve old files. An item failure permits other items to continue; authentication failure stops new dispatch. Ctrl+C stops new work, waits for cleanup, retains completed files and exits 130.

Terminal progress goes to stderr. --no-progress suppresses interim progress and retains the final summary. Redirected and JSON modes emit no terminal control sequences:

qnbot --json algorithm download APP_ID --all-platforms -o ./packages

JSON emits one result object: success reports use data; partial failure or cancellation places the batch report in error.details, including item statuses, paths and completed/failed/cancelled counts. Partial failure exits 28; authentication and cancellation preserve their own codes.

Files use <output>/<platform>/<app-id>-<version>-<platform>.zip. --overwrite permits replacing files that existed before the batch, never two batch tasks sharing a destination. Before archive transfers, the CLI checks actual output-filesystem path semantics. In a case-insensitive directory, APP_A and app_a at the same version/platform fail with ReleaseConflict (exit 12) even with overwrite, preserving existing files and preventing archive transfer for the whole batch. Narrow the selection or use separate output directories for separate batches; execution order cannot preserve both packages. Case-sensitive directories retain genuinely distinct valid targets, while identical exact tuples still deduplicate.

Retry unfinished downloads

qnbot algorithm download APP_A APP_B --platform linux-arm64 -o ./packages

The final human summary supplies one retry command for each resolved failed or cancelled item. Each command preserves the original App ID, exact version, platform and output directory, excluding completed files. Copy it into the labeled POSIX sh or PowerShell shell. Resolve selection errors before retrying unresolved items; paths that cannot be safely represented produce no command. Existing files remain unchanged. Add --overwrite to the relevant command only after deliberately choosing to replace conflicting files. There are no automatic retries or overwrites; existing JSON and exits stay unchanged.

Diagnose online request failures

In a CLI release containing online network diagnostics, errors identify the authentication request, catalog request or package transfer stage and the cause confirmed by the SDK. Check network responsiveness for timeouts, system DNS for DNS failures, network/proxy/service reachability for connection failures, and system time plus trusted certificates for TLS failures. Ask the provider to repair TLS when needed; keep certificate verification enabled. An unconfirmed cause is reported as unknown.

qnbot --json algorithm list --available
qnbot --json algorithm install APP_ID@VERSION
qnbot --json algorithm download APP_ID@VERSION -o ./packages

Online request errors add optional error.details.stage/reason tokens alongside existing fields. An incomplete download batch keeps its report in error.details; each failed item can add items[].error.details.stage/reason. Stages are authentication_request, catalog_request, package_transfer or unknown; reasons are timeout, dns, connection, tls or unknown. These tokens do not change with the output language. Catalog planning failure starts no transfers; a partial batch retains completed items and exit 28.

The diagnostic feature's release version is undecided. Existing binaries need an upgrade before relying on the new fields. Keep commands and configuration, branch on existing error codes/exits and tolerate optional fields. The CLI adds no automatic retry; resolve the reported issue, then rerun the command.

Install offline packages

For offline delivery the desktop app or the delivery channel provides the algorithm package ZIP or directory, and you pass the local path to the CLI:

qnbot algorithm install ./package.zip
qnbot algorithm install ./offline-packages/

Directory installation only covers the first level and never scans subdirectories.

Version rules

  • Each package_id keeps exactly one current version.
  • Explicitly installing a different version replaces the current version, so you can upgrade or downgrade.
  • Reinstalling identical content reports already_installed.
  • Online and offline packages must match the current operating system, CPU architecture, and SDK version.

After a successful installation, confirm the current version in Inspect algorithm packages, then use that package_id when configuring a target.

Read installation results

Every successful online, ZIP or directory install lists the actual package version, platform and result before the batch summary. For example:

package_id              package_version  platform     result
qnbot_hand_engine_hand  1.3.0            macos-arm64  installed
Installed algorithm package batch batch-123: 1 installed, 0 already installed.

installed means installed by this invocation; already installed means identical content was already installed. Chinese output uses “本次安装” and “已安装相同内容”. The table records this installation’s results. Warnings go to stderr. Scripts use qnbot --json algorithm install ./package.zip to read package IDs, versions, statuses, and warnings.

Update installed packages

qnbot algorithm update --check
qnbot algorithm update
qnbot algorithm update qnbot_hand_engine_hand --check
qnbot algorithm update PACKAGE_A PACKAGE_B

Omitting package selectors preserves the all-installed behavior. Supplying selectors restricts both checks and updates to those installed packages. Displayed symbolic IDs and exact native IDs work; repeated identities are processed once. Every selector is validated before installation, so a missing, ambiguous or invalid selector fails without starting any update. Successful rows, retained updated/failed/not_attempted outcomes after a failure, and abnormal-package diagnostics cover only this selection. Unselected packages and diagnostics remain outside this run. Update rejects @VERSION; use install APP_ID@VERSION to pin a version or explicitly downgrade.

--check only reports candidates. Updates use the authorized catalog App ID and the exact latest stable version for the host platform. A row reports updated only after both the installation result and a fresh local listing confirm the original native ID at that version in ready state. A changed native ID, wrong version or inconsistent local result stops with CatalogInconsistent (exit 16), without automatically renaming or deleting another package. Inspect qnbot algorithm list and qnbot --json algorithm list, then ask the package publisher to confirm the package identity before retrying. Both ready and incompatible packages participate in updates. An incompatible package without a newer stable candidate reports unavailable; use explicit installation. Corrupted packages are diagnosed separately and never automatically installed.

Recover from a failed update batch

An update stops at the first installation or verification error. The failure table shows each package’s ID, original version, target version, verified version, status and failure reason. Check updated, failed and not_attempted to decide which packages to retry.

Earlier verified updates remain installed. The failed package may already have changed; the command performs no rollback. Inspect the local state, resolve the error, then check and retry:

qnbot --json algorithm list
qnbot algorithm update --check
qnbot algorithm update

A retry selects candidates from actual local versions and does not reinstall A when it is already at the target. Human errors and the batch table use stderr; JSON emits one complete stdout object without a human table. English and Chinese prompts are supported; JSON is language independent.

On update failure, JSON returns ok=false and error.code/message/source_file, and the command exits with a nonzero status. Failures after candidate selection add optional data.packages and data.summary (updated, failed, not_attempted counts). Each failure row retains native package_id, pre-batch current_version, nullable latest_version, and status, and adds nullable verified_version. Only updated rows have a verified target version; other rows use null. Noncandidates keep up_to_date/unavailable; the root error describes the single failed row. Failure data.diagnostics also retains abnormal-package diagnostics, including skipped corrupted packages and incompatible packages without candidates. Existing authentication-source details remain in error.details.token_source when present. Initial list/catalog errors have no data.

Scripts use the exit code and ok to determine the batch result, then read per-package progress from data. Inspect the failed package’s actual installed version before retrying.

Recover incompatible or corrupted packages

After a CLI upgrade, inspect local states and check for updates:

qnbot --json algorithm list
qnbot algorithm info package_id
qnbot algorithm update --check
qnbot algorithm update

Replace package_id with the native ID from local JSON. Both ready and incompatible packages can select a strictly newer stable version for the current platform. With a candidate, check reports update_available and successful update reports updated; verify ready with info. Without a candidate, an incompatible package reports unavailable, never up_to_date, and explains that the current catalog has no matching newer stable version for this platform. Catalog absence alone does not establish an authorization, publication or ABI fault.

Every corrupted record is reported separately with its known native ID, current version, state, skipped action, reason and recovery instructions, including when all installed packages are corrupted. For a broken@0.2.0 record, the English diagnostic contains:

broken@0.2.0: state=corrupted; skipped: corrupted packages are excluded from automatic installation.

--check installs nothing. Update never automatically deletes, uninstalls or repairs corrupted packages. Use info to inspect the record, then obtain a package compatible with your platform and CLI version from its publisher. Explicitly install using one of these delivery methods, then verify:

qnbot algorithm list --available
qnbot algorithm install APP_ID@VERSION
# Or use the publisher's compatible ZIP instead of online install
qnbot algorithm install ./package.zip
qnbot algorithm list
qnbot algorithm info package_id

Use the catalog App ID for online install, and the native ID for local info. Expected final state: ready. Package compatibility is checked during installation. If validation fails, retain the error and ask the publisher to confirm the package contents. Do not edit package ABI/version fields to bypass validation. Normal update does not reinstall an equal version or downgrade. Restart the application or rebuild its SDK instance after replacement.

Update diagnostic JSON

Corrupted packages are reported in the data.diagnostics array. The data.packages fields (package_id/current_version/latest_version/status) and statuses (update_available/up_to_date/unavailable/updated) retain their meanings; corrupted records do not enter that array. When no recovery is required, diagnostics is [].

Each diagnostic contains package_id, current_version, state, action, reason, and recovery. Corrupted records use action=skipped and reason=corrupted_package. Incompatible records without a candidate remain in packages and also have action=unavailable, reason=no_newer_host_candidate diagnostics. recovery is canonical English guidance; JSON fields and values do not change with the prompt language.

Scripts needing the full abnormal-package inventory must read both arrays. Strict decoders must allow the added diagnostics field. Human output includes diagnostic text after the table; use JSON for automation. Commands, native IDs, errors, exit codes and configuration stay the same. Successful checks, including corrupted-only, unavailable or empty results, still exit 0.

Inspect & uninstall

Inspect algorithm packages

List local installed packages:

qnbot algorithm list

List the online packages the current account can access, filtered by keyword, App ID, and platform:

qnbot algorithm list --available
qnbot algorithm list --available --query hand --app-id APP_ID --platform macos-arm64

A bare list only reports local installed versions; --available queries the authorized online catalog.

The normal local human list shows name and package_version, omitting platform; it adds state when any package is not ready. The human name prefers the catalog sAppId when it is not wholly numeric; legacy numeric IDs fall back to appName. For sAppId=qnbot_hand_xhand and appName=xhand, the table shows qnbot_hand_xhand. Available-list JSON keeps raw appName in name and raw sAppId in package_id. Nonempty local list/info waits at most one second for optional name lookup; missing credentials, offline access, timeout, or an ambiguous association falls back to the native ID. info also shows the native package_id and issues.

The available table groups each package once and shows online package_id, local installed, versions, and platforms. Platforms sharing a version set share a row; differing sets use continuation rows. A distinct name adds name; --verbose retains name and tag:

qnbot algorithm list --available --verbose
qnbot algorithm list --available --all-platforms

Local info and uninstall accept the displayed identifier, such as qnbot_hand_engine_hand, or the native ID qnbot_hand.engine_hand. SDK configuration uses the native ID from JSON; online install uses the App ID from the available list.

Read the current version of a package_id, or confirm whether a specific version is current:

qnbot algorithm info package_id
qnbot algorithm info package_id@package_version

Use qnbot --json algorithm list or info to obtain the package_id and current package_version used by SDK configuration. The version is only for information queries and uninstall protection and does not belong in ordinary SDK configuration.

Use the displayed package ID directly

qnbot algorithm info qnbot_hand_engine_hand
qnbot algorithm info qnbot_hand_engine_hand@0.2.34
qnbot algorithm uninstall qnbot_hand_engine_hand@0.2.34

Replace the version with the installed value. The CLI ignores case and punctuation differences when matching the complete ID to a unique installed package, including offline. Exact legacy IDs take precedence and remain supported; @VERSION protection is unchanged. Multiple matches fail with InvalidPackageKey (exit 4) without choosing an uninstall target. Inspect conflicts using qnbot --json algorithm list, then select an exact installed ID. SDK configuration still uses the native package_id from JSON.

Uninstall algorithm packages

Without package_version, uninstall removes the current installed version. First release applications using that version:

qnbot algorithm uninstall package_id

For version protection, also pass package_version. The command uninstalls only while the current version is still that version, and does nothing on a mismatch:

qnbot algorithm uninstall package_id@package_version

If an SDK instance in any process holds the current installed version, the command returns PackageInUse (exit 14) and keeps the package installed. Exit applications using that version before retrying. In application code, destroy the corresponding SDK instances and release related references; stopping capture alone keeps the instance alive. After successful removal, the package is no longer installed.

Unknown local installation state

When online discovery succeeds but local storage cannot be opened or read, algorithm list --available retains the complete sorted catalog and exits 0 after required output succeeds. The human installed column shows unknown, with the error reason on stderr. Wait for an operation holding the store to finish, or resolve storage-access problems. Preserve corrupted data and follow the supported recovery process, then run qnbot algorithm list to verify local state. Online discovery failures return the corresponding error code.

JSON uses each package’s installed_state to distinguish installed, not installed, and unknown states. data.diagnostics is normally an empty array and contains code/message when local reads fail. A readable local record that cannot be uniquely associated with an online identity also marks the affected row unknown. Known uniquely associated versions remain visible. Scripts must read installed_state to determine installation state, accept additional fields, and check diagnostics before relying on local metadata. An empty packages array can still carry a local failure diagnostic. JSON diagnostics stay in this array without an extra stderr warning. Relevant fields:

{"command":"algorithm.list.available","ok":true,"data":{"packages":[{"package_id":"APP_A","name":"A","tag":null,"installed_version":null,"resources":[{"version":"1.0.0","platform":"macos-arm64"}],"installed_state":"unknown"}],"diagnostics":[{"code":"IoError","message":"a local package store I/O operation failed"}]}}

JSON output

Automation scripts use --json for stable JSON output:

qnbot --json algorithm list

--json is a global option; place it before the subcommand so scripts can parse the results of list, info, and install.

Output failures

Ordinary algorithm commands and CLI self-update succeed only after required stdout/stderr output is fully written and flushed. Output failure after business success returns IoError (18); an existing business failure keeps its exit code. Stdout may contain a partial result, and the CLI does not append a second JSON object. Check the exit status and complete JSON. Installation, removal, configuration, or update may already have completed. Inspect the actual state before retrying.

Migrate table readers

For table-output changes and script updates, see Upgrade & compatibility.

Android targets

Obtain matching deliveries

Run Qnbot CLI on a desktop host to download an android-arm64 algorithm ZIP. Install the original ZIP in the Android app using Glove Android.

Use an arm64-v8a device running Android API 26 or later. The algorithm manifest must declare platform=android, architecture=aarch64, and supported qnbot_hand ABI major 2 with minor at least 1. Package the algorithm’s native dependencies with the app.

Discover and download

List available Android packages, then download by ID:

qnbot --json algorithm list --available --platform android-arm64
qnbot algorithm download APP_ID --platform android-arm64 -o ./packages
qnbot algorithm download APP_ID@VERSION --platform android-arm64 -o ./packages

Replace APP_ID with the exact package_id displayed in the available list. Without a version, each platform selects its highest canonical stable version; select prereleases explicitly. Files are saved to packages/android-arm64/APP_ID-VERSION-android-arm64.zip.

list --available --all-platforms and download --all --all-platforms share the same platform set, including Android. The default remains the current host platform. See Install & update for account authority, --overwrite, batch failures and retry behavior. Download saves the original ZIP; the Android SDK checks target compatibility.

Troubleshoot installation

  • qnbot_hand.dynamic_openxr_hand is the SDK-private skeleton package identity and public package management rejects it. Use the SDK's bundled skeleton capability; preserve the protected identity.
  • Handle installation failures through typed SDK package errors for platform, ABI, manifest and integrity problems. Keep the original ZIP.
  • If loading still fails after READY, check that the archive keeps the native dependencies supplied by the algorithm provider and matches the Android ABI.
  • With --all-platforms, process each platform subdirectory using the returned platform and saved path.