This page covers the commands operators and developers actually run: the b3iq fleet CLI, the local b3iq-host agent CLI, and the monorepo build/test commands. Internal network-operations tooling — traffic warming and B3 payout settlement — runs on a secured operator machine and is not part of the public CLI.

Keep secrets out of argv

Use ignored .env.local files, protected secret files, stdin, or temporary curl config files for tokens and private keys. Do not paste API tokens, customer tokens, gateway keys, or payout account keys into shell history.

b3iq CLI

b3iq is the fleet CLI — it manages your machines remotely from your own laptop or CI, against your B3IQ account. It's a different tool from the local b3iq-host agent CLI below: b3iq-host drives the daemon on the machine itself, b3iq talks to the control plane and can reach every machine on your account.

1

Sign in

Run b3iq login to sign in via a browser device-flow pairing, or set B3IQ_TOKEN to a personal access token minted from Settings → CLI tokens for CI and headless use.

2

Check your fleet

b3iq status prints a fleet overview; b3iq machines list and b3iq models list show what's online and what each machine can serve.

3

Operate

Install or remove a model, restart a runtime, tail gateway logs, or open an SSH session — see the command table below.

CommandPurpose
b3iq loginSign in via browser device flow (--token <t> for CI, or set B3IQ_TOKEN)
b3iq logout --revokeForget the saved token; --revoke also kills it server-side
b3iq whoamiShow the logged-in account
b3iq statusFleet overview: machines online and servable models
b3iq machines listList your machines (--quiet for node ids)
b3iq machines get <machine>One machine's detail
b3iq models list [--machine <id>]Servable models across the fleet, or one machine's full catalog
b3iq models install <model> --machine <id>Install a model on a machine (--no-wait to not block)
b3iq models remove <model> --machine <id>Uninstall a model from a machine (--no-wait to not block)
b3iq runtimes list [--machine <id>]A machine's runtimes, with status and self-heal coverage
b3iq runtimes restart <runtime> --machine <id>Restart a runtime (--no-wait to not block)
b3iq logs [--limit N] [--follow]Recent gateway request logs; --follow streams new events
b3iq ssh <machine> [-- cmd]Open an SSH session — transport is resolved for you, no ProxyCommand needed
b3iq config [default-machine <id>]View or set local CLI config, including a default machine
b3iq doctorDiagnose auth, API reachability, and cloudflared

<machine> accepts a node ID, an ID prefix, or a substring of the machine name.

Output and exit codes

stdout is data, stderr is logs. Output is JSON automatically when piped to a non-TTY, --json forces it anywhere, and --quiet prints only ids. Exit codes are stable: 0 ok · 1 usage · 2 api · 3 auth · 4 rate-limited.

Config lives at ~/.b3iq/config.json. Env overrides the file: B3IQ_TOKEN (personal access token, skips the login step), B3IQ_API_URL, and B3IQ_ORG_ID.

Host Agent CLI

On an installed node these are available as b3iq-host <command>. From a source checkout, run go run ./cmd/b3iq-host <command> inside host-agent/.

CommandPurpose
b3iq-host versionPrint build metadata (--short for the version string only)
b3iq-host initCreate the local node identity and config
b3iq-host scanPrint host/CPU/GPU/NPU inventory as JSON (--recommend for a runtime suggestion)
b3iq-host resolve-pinsResolve the pinned runtime build for this hardware
b3iq-host runtimesProbe configured local runtimes
b3iq-host provision-enginesInstall/start a model engine (--auto for the recommended one)
b3iq-host preflightCheck disk, ports, and permissions before install (--json)
b3iq-host enroll --url URLEnroll the node with a B3IQ control plane
b3iq-host setupHeadless onboarding: claim, enroll, managed mode, and tunnel in one non-interactive run
b3iq-host statusPrint node, auth, state, and API-key status (--pretty or --json)
b3iq-host doctorHealth check: service, runtimes, and local operator (--json)
b3iq-host serveStart the local host agent on its configured listener
b3iq-host wizard urlPrint the local setup wizard URL (add --with-token for a one-time bootstrap token)
b3iq-host openPrint and open the local dashboard URL in a browser
b3iq-host auth bootstrapCreate the first local owner from env or stdin password
b3iq-host auth loginPrint a local operator session token
b3iq-host api-key createCreate a local `b3iq_local_` API key
b3iq-host api-key listList local API keys
b3iq-host api-key revoke --id IDRevoke a local API key
b3iq-host chat --api-key-stdin --prompt TEXTSend a local OpenAI-compatible chat request
b3iq-host support-bundleGenerate a redacted diagnostics bundle
b3iq-host logs -fTail the service logs (journald on Linux; live file on macOS/Windows)
b3iq-host install-service --dry-runPlan background service/autostart installation
b3iq-host uninstall-serviceRemove the background service and autostart (counterpart to install-service)
b3iq-host startup-service --enableEnable or disable service startup at boot/login (--enable / --disable)
b3iq-host start/stop/restart-serviceControl the installed service (--system for system scope)
b3iq-host always-onEnable or disable the B3IQ-managed no-sleep power policy (--enable / --disable)
b3iq-host update-service --dry-runPlan a signature-verified binary update
b3iq-host resetRe-enrollment reset: wipe identity, keep the binary and models
b3iq-host uninstall --purgeRemove the node; --purge also deletes the binary, models, and PATH entry

Build From Source

Run package-scoped pnpm commands from the repo root.

bash
pnpm installpnpm typecheckpnpm buildpnpm dev:explorer # Protocol Explorer dev serverpnpm dev:wizard # Setup wizard dev serverpnpm dev:desktop # Desktop companion dev server

Common Env

EnvPurpose
B3IQ_HOMEOverride the node config/state directory
B3IQ_LISTEN_ADDRLocal HTTP listener (defaults to 127.0.0.1:8831; LAN exposure is opt-in)
B3IQ_CONTROL_PLANE_URLControl-plane base URL, usually `https://control-plane.b3iq.org`
B3IQ_GATEWAY_API_KEYHosted OpenAI-compatible gateway key (`b3iq_gateway_`)
B3IQ_CUSTOMER_ID / B3IQ_CUSTOMER_TOKENCustomer identity headers for B3IQ-native jobs
Host agent

What the agent does and the local API it serves.

Learn More
Updates

Signed self-update and one-click apply.

Learn More
Ask a question... ⌘I