Install Bee
Bee is a single executable. Prebuilt binaries are published on the releases page for macOS and Linux, on amd64 and arm64.
Install script (recommended)
curl -fsSL https://raw.githubusercontent.com/tokhive/bee/main/install.sh | sh
The script picks the build for your operating system and CPU, verifies it against the release's checksums.txt, and installs bee to ~/.local/bin. Run it as the user who will pair Bee and who is signed in to the official clients. Don't put the whole command under sudo.
-
macOS: the script installs the binary only. Continue with First Run (
bee start). To keep Bee running in the background, see Operations. -
Linux: the script also installs and enables the
tokhive-beesystem service, so Bee starts after a reboot without anyone logging in. It asks for your password only to manage the service. Sign in to your official clients first (codex loginorclaude), then answer yes to Set up and start Bee now? and follow the three steps:- Device pairing: enter your Hive address (
https://console.tokhive.ai) and confirm the pairing link in the console. - Supplied accounts: choose which signed-in accounts to supply.
- Background startup: the installer starts the service and checks that it is active.
Then run
bee statusto check that each account is taking work. - Device pairing: enter your Hive address (
If ~/.local/bin is not on your PATH, add it to your shell profile, or call Bee by its full path. Check the installation with bee version.
Installer options
| Variable | Effect |
|---|---|
BEE_VERSION | Install a specific release, for example BEE_VERSION=v0.0.10. Defaults to the latest release. |
BEE_INSTALL_DIR | Install somewhere other than ~/.local/bin. |
BEE_INSTALL_SERVICE | Linux defaults to 1, enabling the system service. Set 0 for binary-only installation, including systems without systemd or administrator access. |
BEE_INSTALL_INTERACTIVE | Defaults to 1. Set 0 to skip the setup prompts, for example in unattended installation. |
BEE_LANG | zh for Simplified Chinese or en for English. Unset uses English. |
NO_COLOR | Set to a nonempty value to disable terminal colors. |
Pass them to sh, for example:
curl -fsSL https://raw.githubusercontent.com/tokhive/bee/main/install.sh | BEE_INSTALL_SERVICE=0 sh
Linux service details
If Hive has deleted or replaced this device and rejects its previous pairing, the interactive installer offers to pair again (default no). After you agree and enter the Hive address, it stops the service, backs up only bee.json into a private, uniquely named directory beside it, and shows the backup path. It then opens the normal web pairing flow and reuses egress.json. Re-pairing requires the Linux flock tool (usually included in util-linux); a busy configuration lock or a changed configuration stops recovery. Declining or ending input keeps the existing configuration. A failed new pairing keeps both the backup and any newly saved pairing state so you can resume by running the installer again. Confirming a replacement in Hive may deactivate another Bee.
The steps are labeled 1/3 device pairing, 2/3 supplied accounts, and 3/3 background startup. Existing configuration reduces the questions you need to answer, while the completed flow still reaches step 3/3 and shows the final service state. Separators, icons and colors make each stage visible. Redirected output or TERM=dumb uses plain text; NO_COLOR=1 disables colors.
Installation, bee login, bee setup, and the management menu use English when BEE_LANG is unset, including on a Chinese locale and without a terminal. Set BEE_LANG=zh for Chinese or BEE_LANG=en for English. Full bilingual pairing and account selection require a Bee release containing this support; older releases retain their original command output. The choice applies to the current run and is not stored in the service configuration.
You can decline or set BEE_INSTALL_INTERACTIVE=0. Without an interactive terminal, the wizard is skipped automatically. Automatic startup is still enabled, and the installer prints manual commands with your actual paths. With the default configuration paths:
bee login --hive https://hive.example.com # existing pairing: bee login
bee setup # only if egress.json is missing
sudo systemctl start tokhive-bee
sudo systemctl status tokhive-bee
sudo journalctl -u tokhive-bee -f
If a step fails, the wizard stops and preserves the installed binary and any configuration already written; follow the original error and retry or use the manual commands. If a foreground Bee holds the same configuration, stop it first. The service runs as the installing user and skips startup until both pairing and account configuration files exist. Linux service installation requires a running systemd manager (version 243 or newer for configuration checks) and administrator access.
The service records the installation's binary path, home, configuration directory, executable search path and official-client directory variables. Use the same environment when installing and pairing. Use sudo systemctl edit tokhive-bee for other required environment variables or non-default device/egress paths. Credentials must be accessible without an interactive login; starting a service does not unlock a login-locked keyring.
If you used the old user-level service, first run systemctl --user disable --now tokhive-bee. The installer refuses to overwrite a hand-written or linked system unit; use BEE_INSTALL_SERVICE=0 to keep that service, or migrate it explicitly.
Manual download
-
Download
bee_<os>_<arch>.tar.gzfor your machine andchecksums.txtfrom the releases page.<os>isdarwinorlinux,<arch>isamd64orarm64. -
Verify the archive:
shasum -a 256 -c checksums.txt --ignore-missing -
Extract it and move
beeonto yourPATH:tar -xzf bee_linux_amd64.tar.gzmv bee ~/.local/bin/
A file downloaded through a browser is quarantined, and Gatekeeper refuses to run the unsigned binary. Clear the flag:
xattr -d com.apple.quarantine bee
The install script downloads with curl and is not affected.
Build from source
You need Go 1.27.3 or newer, plus git and bash.
git clone https://github.com/tokhive/bee.git
cd bee
make build # builds bin/bee
Bee depends on the TEE client library github.com/tokhive/tee as an ordinary Go module pinned in go.mod. You can also build with go build -o bin/bee ./cmd/bee.
Put bin/bee on your PATH, or call it as ./bin/bee. A source build reports its version as dev, followed by the commit when built inside the repository, for example dev+3f82e19a1b2c.
Manage Bee from the terminal
Run bee without arguments in a terminal:
bee
The menu opens in English without a language-selection prompt, regardless of the system locale. Select Start Bee, Status, Device pairing, Supplied accounts, Background service, Logs and diagnostics, Advanced options, Help and version, or Change language. These groups cover all existing Bee command capabilities. Use 0 to return directly from a submenu, or to exit from the main menu. Exiting the menu leaves the background service running.
Start Bee checks the configuration, opens pairing or account selection when something is missing, and then starts Bee: the installer's service on Linux, or in the foreground on macOS. Foreground operation occupies the terminal; closing it or pressing Ctrl-C stops Bee.
More about the menu
Start Bee checks configuration automatically. Missing or unfinished pairing opens the pairing flow; a missing supply file opens account selection. Pairing and saving accounts still require confirmation; cancelling either step leaves Bee stopped. With complete, valid configuration, it starts directly without another question. It automatically starts the matching installer-managed systemd service on Linux, or runs in the foreground when no supported background service is available (including macOS). If the service is already active, Bee reports that instead of starting again. Service inspection or configuration-matching errors stop the action with diagnostic details. Foreground operation occupies the terminal: closing the terminal or pressing Ctrl+C stops this Bee. Ctrl+C exits the program; enter bee again to reopen the menu. Background startup returns to the menu and keeps running after the terminal closes.
Unreadable, incorrectly permissioned or malformed configuration stops startup with the file path and recovery guidance; existing files are kept. A paired device is verified with Hive before starting. Only an explicit device-replaced or invalid-credential response opens re-pairing, with confirmation and a private backup before replacing the device configuration. Supply selections are kept. Network or other verification failures stop this attempt without resetting pairing. A valid supply file whose official Codex or Claude sign-in is temporarily unavailable is kept: Bee can connect and wait for sign-in recovery. To change existing choices, use Device pairing or Supplied accounts from the main menu.
Advanced options → Run existing configuration in foreground preserves explicit foreground operation with custom supply paths. Without a default supply file, this action keeps Bee online without supplying accounts. Ordinary Start Bee completes missing supply configuration before running.
Under Supplied accounts, query registered accounts and supply status independently, choose accounts individually or select all usable accounts, pause/resume new work, and confirm account changes. Configuration options cover platform selection, official-client directories and a local HTTP CONNECT proxy (keep, set or clear). Every saved selection still requires final confirmation. Codex and Claude Code checks provide local sign-in inspection and explicit online model/quota queries; Claude also supports online identity verification. Check options select the official directory and store. For Claude, leaving the directory unspecified follows the environment, while explicitly clearing it selects the official default.
Advanced options changes paths only for the current menu session. Changing the device file resets the associated supply path and service target. A custom supply file applies to account setup, direct foreground run and diagnostics. Start Bee and status always use egress.json beside the device file. These paths do not rewrite an installed service or bypass service matching. Logs and diagnostics can display the complete diagnostic JSON. Help and version works without pairing or networking and includes each command's original parameter reference.
Set BEE_LANG=zh for Chinese or BEE_LANG=en for English. Change language affects only the current session. Confirmations use 1) Confirm / 0) Cancel, with cancellation as the default. Known errors and recovery steps follow the selected language. HTTP statuses and error codes stay visible; unfamiliar external errors and service logs are labeled as original technical details. Compact pages use status icons and colors; NO_COLOR=1 disables colors, and TERM=dumb uses plain text.
Linux service controls apply only to the installer's system service for the same user, executable and configuration. Custom units, drop-ins, or a different binary/configuration path require manual management. Start/stop controls Bee now; enable/disable boot startup controls the next reboot. Saving account choices is separate from applying them: a running service loads the changes only after you confirm a restart. The status view distinguishes service activity, account authorization and readiness to take work.
The other menu actions work on macOS, including automatic foreground operation under Start Bee; background service controls are unavailable there. All existing subcommands remain available. Bare bee prints help without waiting for input when either input or output is not a terminal.
Upgrade
Run the install script again. It replaces bee in place and updates its managed Linux service, without repeating pairing or account selection. Then restart Bee to run the new version:
| How Bee runs | Restart |
|---|---|
| Linux service | The installer asks whether to restart it (default no, so current work can finish). Later: sudo systemctl restart tokhive-bee. |
| macOS LaunchAgent | launchctl kickstart -k gui/$(id -u)/ai.tokhive.bee |
| In a terminal | Stop it with Ctrl-C and run bee start again. |
The Bee Device page shows which version is connected, so you can check that the upgrade took effect. Bee does not update itself; see Keep the software current.
Uninstall
-
Stop Bee. If using the installed Linux service, disable and remove it first:
sudo systemctl disable --now tokhive-beesudo rm /etc/systemd/system/tokhive-bee.servicesudo systemctl daemon-reloadIf using the macOS LaunchAgent, unload and remove it:
launchctl bootout gui/$(id -u)/ai.tokhive.beerm ~/Library/LaunchAgents/ai.tokhive.bee.plist -
Delete the binary, for example
rm ~/.local/bin/bee. -
Optionally delete Bee's configuration directory (see Configuration). This removes the device pairing; the machine has to be paired again to supply.
Bee never signs you out of the official clients, so Codex and Claude Code keep working as before.
To also delete your TokHive account and its data, email hello@tokhive.ai.
Next step
On Linux, if the installer started the service, check it with bee status. Otherwise, run Bee for the first time.