Skip to content

CLI Reference

The hive binary is the Hive CLI client. It connects to an hived daemon over WebSocket and manages Claude Code sessions.

Global Options

hive [OPTIONS] <COMMAND>
OptionEnv VarDefaultDescription
--host <HOST>HIVE_HOST127.0.0.1Daemon host address
--port <PORT>HIVE_PORT9178Daemon port
--token <TOKEN>HIVE_TOKEN(auto*)Authentication token
--nodes <NODES>HIVE_NODES(none)Comma-separated cluster node addresses
--tlsHIVE_TLSfalseConnect over TLS (wss://)

*The token is optional in most cases. Local-only commands (ps, install, update, guide, daemon) never connect to a daemon. For commands that do connect, when --token/HIVE_TOKEN is not supplied the CLI falls back to the token stored in the local hived config - so commands against the local node work out of the box. Supply --token explicitly only when targeting a remote node whose token differs from the local one.

When --nodes is set, the client tries each address until one succeeds. Every node is a co-equal authority under leaderless clustering, so any reachable node can serve the request. This overrides --host/--port.

Commands

hive new - Create a session

hive new [OPTIONS]
OptionShortDefaultDescription
--dir <DIR>-d.Working directory for the session
--name <NAME>(none)Optional session name

Creates a new SDK-mode session. The working directory is resolved to an absolute path. Prints the session ID on success.

$ hive new --dir /home/user/project --name "refactor"
Session created: 550e8400-e29b-41d4-a716-446655440000
  Mode: Sdk
  Dir:  /home/user/project
  Name: refactor

hive ls - List sessions

hive ls

Lists all sessions on the daemon with their ID, status, mode, attached client count, and working directory.

$ hive ls
ID                                     STATUS       MODE     CLIENTS  DIR
550e8400-e29b-41d4-a716-446655440000   idle         sdk      0        /home/user/project
6ba7b810-9dad-11d1-80b4-00c04fd430c8   running      sdk      1        /home/user/other

Status values: running, idle, detached, exited

hive send - Send a prompt

hive send <SESSION> <PROMPT>
ArgumentDescription
SESSIONSession ID (UUID)
PROMPTThe prompt text to send

Sends a prompt to an SDK-mode session. Spawns a new Claude process for the prompt. Automatically attaches to the session and streams output until completion.

$ hive send 550e8400-e29b-41d4-a716-446655440000 "explain the main function"
{"type":"assistant","content":"The main function..."}

Output is Claude's raw stream-json format (one JSON object per line).

hive attach - Attach to a session

hive attach <SESSION>

Subscribes to an existing session's output stream. Prints all output in real-time until the connection closes or you press Ctrl+C.

$ hive attach 550e8400-e29b-41d4-a716-446655440000
Attached to session 550e8400-e29b-41d4-a716-446655440000. Streaming output...
{"type":"assistant","content":"..."}

hive kill - Kill a session

hive kill <SESSION>

Terminates the session and its Claude process. The session is removed from the daemon.

$ hive kill 550e8400-e29b-41d4-a716-446655440000
Session 550e8400-e29b-41d4-a716-446655440000 killed.

hive tag - Set session tags

hive tag <SESSION> [TAG...]
ArgumentDescription
SESSIONSession ID (UUID)
TAGOne or more tags to set (replaces all existing tags)

Sets tags on a session. All existing tags are replaced by the new list. Pass no tags to clear all tags.

$ hive tag 550e8400-e29b-41d4-a716-446655440000 backend refactor
Session 550e8400-e29b-41d4-a716-446655440000 tags: backend, refactor

$ hive tag 550e8400-e29b-41d4-a716-446655440000
Session 550e8400-e29b-41d4-a716-446655440000 tags cleared.

hive export - Export a session transcript

hive export <SESSION> [--format text|json]
Argument/OptionDescription
SESSIONSession ID (UUID)
--formatOutput format: text (default) or json

Exports a session's full output history with metadata. The text format prints the pre-formatted transcript directly (suitable for piping to a file). The json format emits a JSON object with session_id, filename (suggested save name), and content fields.

$ hive export 550e8400-e29b-41d4-a716-446655440000 > transcript.txt

$ hive export 550e8400-e29b-41d4-a716-446655440000 --format json
{"session_id":"550e8400-...","filename":"my-session_2026-03-11.txt","content":"..."}

hive cluster-status - Show cluster info

hive cluster-status

Displays the cluster topology: this node and all known peers with their connection state. The Role, Term, Leader ID, and Leader Address fields are vestigial under leaderless clustering - every node reports Role: Leader, Term: 0, and itself as the leader. Treat every node as a co-equal authority.

$ hive cluster-status
Cluster Status
==============
  Node ID:        a1b2c3d4-e5f6-7890-abcd-ef1234567890 (node-a)
  Role:           Leader
  Term:           0
  Leader ID:      a1b2c3d4-e5f6-7890-abcd-ef1234567890
  Leader Address: 10.0.0.1:9178

PEER ID                                NAME               ROLE         ADDRESS                  CONNECTED
b2c3d4e5-f6a7-8901-bcde-f12345678901   node-b             leader       10.0.0.2:9179            yes

Returns an error if the connected node is not part of a cluster.

hive adopt - Adopt a running Claude process

hive adopt [OPTIONS]
OptionShortDefaultDescription
--pid <PID>-p(none)PID of the Claude process to adopt
--name <NAME>(none)Optional session name
--dir <DIR>-d(none)Working directory for the adopted session

Adopts an already-running Claude Code process into daemon management. Without --pid, discovers running Claude processes and lists them interactively.

The adopted process becomes a managed session (mode: adopted) that can be attached, monitored, and killed like any other session.

$ hive adopt --pid 12345 --name "existing-work"
Session created: 7f3a2b10-...
  Mode: Adopted
  PID:  12345

hive open - Open a terminal on the daemon

hive open [OPTIONS]
OptionShortDefaultDescription
--dir <DIR>-d.Working directory for the terminal
--shell <SHELL>-s$SHELL (Unix) or powershell.exe (Windows)Shell or command to launch (e.g. bash, powershell, cmd, zsh)
--name <NAME>(none)Optional human-readable name for this terminal

Opens an interactive shell or command terminal on the daemon. The terminal runs as a managed session that can be attached from other clients.

The working directory is resolved to an absolute path. If --shell is not provided, the command defaults to $SHELL on Unix systems or powershell.exe on Windows.

The terminal is created and automatically attached - output streams to stdout in real-time. Press Ctrl+C to detach (the terminal continues running on the daemon).

$ hive open --dir /tmp --shell bash --name "build"
Terminal opened: a1b2c3d4-... (bash)
Attaching... Press Ctrl+C to detach.

The terminal behaves like an attached session: you can send input (keystrokes) and receive output in real-time. To detach and later reattach, use hive attach <session-id> in another terminal.

hive team - Manage agent teams

hive team <SUBCOMMAND>

Subcommands for listing and managing agent teams (multi-session Claude task runners).

hive team ls

Lists all active teams.

$ hive team ls
ID                                     LEADER SESSION       STATUS       WORKERS  NAME
a1b2c3d4-...                           550e8400-...         running      3        my-team

hive team get <TEAM_ID>

Shows details for a specific team.

$ hive team get a1b2c3d4-e5f6-7890-abcd-ef1234567890
Team:    a1b2c3d4-...
Name:    my-team
Status:  Running
Leader:  550e8400-...
Workers: 3
  - 6ba7b810-...
  - 7c8d9e0f-...
  - 8d9e0f1a-...

hive team delete <TEAM_ID>

Deletes a team and kills all its sessions.

$ hive team delete a1b2c3d4-e5f6-7890-abcd-ef1234567890
Team a1b2c3d4-... deleted.

Autopilot subcommands

When a team session runs the autopilot skill (see teams-autopilot.md), the leader agent uses these subcommands to orchestrate workers from inside its own loop:

CommandPurpose
hive team handoff <TEAM_ID> --name <n> --prompt <p>Spawn worker + block until report. Returns a wait_id on timeout.
hive team assign <TEAM_ID> --name <n> --prompt <p>Spawn worker and return immediately. Pair with wait.
hive team send <TEAM_ID> [--to <id> | --broadcast] --message <m>DM a worker or broadcast to the team.
hive team inbox <TEAM_ID> [--session <id>] [--since <seq>] [--watch]Replay relayed messages (NDJSON). At-least-once on seq.
hive team workers <TEAM_ID>Print the roster with per-worker status (pending / reported(success|failure)).
hive team report <TEAM_ID> --success|--failure [--result <s>]Worker reports its result. Auto-called by the Claude Stop hook.
hive team complete <TEAM_ID> [--result <s>]Leader marks the team done.
hive team wait <TEAM_ID> [--for <ids>] [--timeout <secs>] [--wait-id <id>]Bounded block on pending workers.
hive team statusPrint env-derived identity (HIVE_TEAM_ID, HIVE_SESSION_ID, role) and team summary.

Workers spawned via handoff/assign default to an isolated git worktree under .hive/worktrees/<worker-id> (or a plain sandbox dir if the leader cwd is not a git repo). The hard worker cap is 5 per team.

hive internal stop - Stop-hook helper (not for direct use)

Called by the Claude Stop hook in .claude/settings.json that the autopilot skill materialises. Reads HIVE_TEAM_ID / HIVE_SESSION_ID from the env, extracts the last assistant message from --transcript or the hook payload's transcript_path on stdin, and emits ReportWorkerResult to the daemon.

hive internal stop [--team-id <id>] [--session-id <id>] [--transcript <path>] [--failure]

hive ps - List local Claude processes

hive ps

Lists Claude Code processes running on the local machine. Does not require a daemon connection or token.

$ hive ps
PID     CMD
12345   claude --print --output-format stream-json ...
67890   claude --print --output-format stream-json ...

hive version - Show version information

hive version

Prints the version of this CLI binary, its build platform, and the version of the locally installed hived daemon (if one is installed). Does not require a daemon connection or token. hive --version (and -V) print the CLI version alone.

$ hive version
hive (CLI):    v1.12.9
platform:      linux-x64
hived (local): hived 1.12.9

hive install - Install the daemon

hive install [OPTIONS]
OptionDefaultDescription
--non-interactivefalseSkip interactive prompts, use defaults
--name <NAME>(none)Node display name (skips name prompt)
--port <PORT>9178Daemon listen port (skips port prompt)
--bind <ADDR>0.0.0.0Bind address (skips bind address prompt)
--user-secret <SECRET>(none)User secret to set in daemon config
--jsonfalseOutput a single JSON summary line (for automation)

Extracts the bundled hived daemon binary and runs a configuration wizard. Does not require a daemon connection or token.

The wizard prompts for: display name, port, bind address, token, claude binary path, and optional cluster settings. The config is written to the platform config directory.

Install paths:

  • Windows: %LOCALAPPDATA%\Programs\Hive\hived.exe
  • Linux/macOS: /usr/local/bin/hived
$ hive install
Installing Hive daemon...
  Binary: /usr/local/bin/hived
  Config: /home/alice/.config/hive/Hive/config.toml
  Token:  a3f8b2c1d4e5...
Done. Start the daemon with: hived

hive rename-node - Rename a cluster node

hive rename-node <NODE_ID> <NAME>
ArgumentDescription
NODE_IDNode UUID (from hive cluster-status)
NAMENew display name for the node

Renames a cluster node. The name is saved to the node's config file and propagated to all peers immediately.

$ hive rename-node a1b2c3d4-e5f6-7890-abcd-ef1234567890 "production-1"
Node renamed.

hive update - Update the CLI

hive update [OPTIONS]
OptionDefaultDescription
--from <URL>local node's [update].manifest_url, else https://hive.vazac.dev/Remote manifest base URL
--channel <CHANNEL>local node's [update].channel, else semi-stableRelease channel: semi-stable or unstable
--remote-token <TOKEN>$HIVE_UPDATE_TOKEN, else local node's [update].tokenBearer token for private remote manifests

Updates the running hive CLI binary in place. This is a local-only command - it does not connect to a daemon.

By default the CLI reads the local hived config's [update] section and follows the same manifest URL and channel the node itself tracks. So on a node set to the unstable channel, a plain hive update pulls the unstable CLI; no flags needed. --from, --channel, and --remote-token override the config values. The concrete manifest file is derived from the channel (manifest.json for semi-stable, manifest-unstable.json for unstable). The binary is verified by SHA-256 before the running CLI is replaced and restarted.

Examples:

bash
# Follow the local node's configured channel and manifest URL
hive update

# Force the unstable channel for this update only
hive update --channel unstable

# Pull the CLI directly from a specific remote manifest base URL
hive update --from https://updates.example.com/hive/

# Private manifest
HIVE_UPDATE_TOKEN=secret hive update --from https://updates.example.com/hive/

hive update-node - Update a node from a URL

hive update-node [OPTIONS]
OptionDefaultDescription
--from <URL>local node's [update].manifest_url, else https://hive.vazac.dev/Remote manifest base URL
--channel <CHANNEL>local node's [update].channel, else semi-stableRelease channel: semi-stable or unstable
--remote-token <TOKEN>$HIVE_UPDATE_TOKEN, else local node's [update].tokenBearer token for private remote manifests
--refresh-artifactsfalseAlso refresh the daemon's bundled client artifacts after the node update

Asks the connected node to fetch a remote manifest, download the daemon binary for its own platform, verify the SHA-256, and restart itself.

With no arguments this updates the local node (the daemon on --host, which defaults to 127.0.0.1), following the same [update] manifest URL and channel the node already tracks - mirroring how hive update self-updates the CLI. So a plain hive update-node is all you need to bring the local daemon up to date. --from, --channel, and --remote-token override the config values.

Use --refresh-artifacts when you also want the daemon to refresh the clients/ tree it serves to connected CLIs and desktop apps.

bash
# Update the local node, following its configured channel and manifest URL
hive update-node

# Force the unstable channel for this update only
hive update-node --channel unstable

# Update a specific node from an explicit manifest URL
hive --host node2.example.com update-node --from https://updates.example.com/hive/
hive update-node --from https://updates.example.com/hive/ --refresh-artifacts

The previous name hive update-daemon still works as an alias.

hive discover - Discover Hive nodes on Tailscale

hive discover

Scans the Tailscale network for other Hive nodes. Prints discovered nodes with their address, version, and platform. The scan identifies TLS-only nodes (those that serve wss:// and reject plain ws://) too. Does not require a daemon connection.

$ hive discover
ADDRESS              VERSION   PLATFORM
100.64.1.2:9178      1.8.103   linux-arm64
100.64.1.3:9178      1.8.103   windows-x64

hive daemon - Local daemon management

hive daemon <SUBCOMMAND>

Read-only subcommands for inspecting the locally installed daemon. These read the local config file directly and do not require a daemon connection.

hive daemon get-token

Prints the auth token from the local daemon config.

$ hive daemon get-token
a3f8b2c1d4e5f6a7b8c9d0e1f2a3b4c5...

hive daemon get-config

Prints the full daemon config as TOML.

$ hive daemon get-config
[daemon]
name = "my-node"
port = 9178
...

hive daemon status

Shows whether the daemon is installed, its version, and whether it is currently running.

$ hive daemon status
Installed: yes
Version:   1.8.103
Running:   yes (PID 4321)

hive cert - Provision TLS for the web client

hive cert [OPTIONS]

A browser served over HTTPS cannot open a plain ws:// socket to a remote host, so the web client only connects to nodes that serve TLS (wss://). This command makes that one step: it detects the node's Tailscale MagicDNS name (<node>.<tailnet>.ts.net), issues a browser-trusted certificate with tailscale cert, writes it next to the daemon config, sets tls_cert/tls_key, and (with --restart) restarts the daemon.

OptionDescription
--name <NAME>Domain to issue the cert for. Defaults to this machine's Tailscale MagicDNS name.
--restartRestart hived after writing the config (systemd hosts only).
--config <PATH>Daemon config file to update. Defaults to the per-user config dir; pass this when hived runs with --config <path> (e.g. a system install at /etc/hive/config.toml). The daemon also passes its own config path automatically when it invokes hive cert.

Run it on the machine the daemon runs on (usually with sudo, since tailscale cert and the config write need privileges):

$ sudo hive cert --restart
Provisioning a TLS certificate for: my-node.tailnet.ts.net
Wrote certificate: /root/.config/hive/tls/my-node.tailnet.ts.net.crt
Wrote private key: /root/.config/hive/tls/my-node.tailnet.ts.net.key
Updated /root/.config/hive/config.toml (tls_cert / tls_key set).
Restarting hived (systemctl restart hived)...
hived restarted.

Requirements: the Tailscale CLI on PATH (override with HIVE_TAILSCALE_BIN) and HTTPS Certificates enabled for the tailnet. hive cert fails fast with a clear message if Tailscale is not installed on the node. Tailscale certs expire after ~90 days - re-run to renew, then restart the daemon. Any node with its own public-domain certificate works too; this just automates the Tailscale path.

Once a node serves TLS, connect to it by its Tailscale MagicDNS hostname (<node>.<tailnet>.ts.net), not a bare IP - the certificate is issued for that hostname, so an IP fails validation. The app auto-negotiates wss:// vs ws:// per connection profile, so there is no manual TLS toggle to set.

hive project - Manage projects

hive project <SUBCOMMAND>

Projects are working directories tracked by the cluster. They are the anchor point for file operations, git operations, and task scheduling.

hive project ls

Lists all projects.

$ hive project ls
ID                                     NAME                           DIR
a1b2c3d4-...                           my-app                         /home/user/my-app

hive project new

hive project new --name <NAME> --dir <DIR> [--description <DESC>] [--node <NODE_ID>]

Creates a new project. The working directory is resolved to an absolute path.

$ hive project new --name "my-app" --dir /home/user/my-app
Project created: a1b2c3d4-...
  Name: my-app
  Dir:  /home/user/my-app

hive project get <PROJECT_ID>

Shows full details for a project.

hive project update <PROJECT_ID>

hive project update <PROJECT_ID> [--name <N>] [--dir <D>] [--description <D>] [--node <N>]

Updates a project. Only the fields you provide are changed.

hive project rm <PROJECT_ID>

Deletes a project. Sessions and files under the project directory are not affected.


hive task - Manage scheduled tasks

hive task <SUBCOMMAND>

Tasks are shell commands scheduled to run by the daemon.

Schedule formats

FormatExampleMeaning
onceonceRun once immediately
cron:<expr>cron:0_*_*_*_*Cron expression (use _ instead of spaces)
interval:<secs>interval:300Repeat every N seconds

hive task ls

Lists all tasks with their status, schedule, and command.

hive task new

hive task new --cmd <CMD> [--dir <DIR>] [--schedule <SCHED>] [--name <NAME>] [--project <ID>]

Creates a new task.

$ hive task new --name "nightly-backup" --cmd "rsync -a /data /backup" --schedule "cron:0_2_*_*_*"
Task created: b2c3d4e5-...
  Name: nightly-backup

hive task get <TASK_ID>

Shows full details for a task.

hive task update <TASK_ID>

Updates a task. Only provided fields are changed.

hive task rm <TASK_ID>

Deletes a task.

hive task cancel <TASK_ID>

Cancels a running or pending task.

hive task trigger <TASK_ID>

Triggers a task immediately, regardless of its schedule.


hive file - Manage project files

hive file <SUBCOMMAND> <PROJECT_ID> ...

All file operations work on paths relative to a project's working directory. Path traversal outside the project root is rejected by the daemon.

hive file ls <PROJECT_ID> [PATH]

Lists files in a project directory. PATH defaults to the project root.

$ hive file ls a1b2c3d4-... src
dir              src/components/
file        1024  src/main.rs
file        2048  src/lib.rs

hive file read <PROJECT_ID> <PATH>

Prints a file's contents to stdout.

$ hive file read a1b2c3d4-... src/main.rs
fn main() { ... }

hive file write <PROJECT_ID> <PATH>

Reads from stdin and writes to the file (overwrites). Use shell redirection:

bash
echo "hello" | hive file write a1b2c3d4-... src/main.rs
cat local.rs   | hive file write a1b2c3d4-... src/main.rs

hive file touch <PROJECT_ID> <PATH>

Creates an empty file. Fails if the path already exists.

hive file mkdir <PROJECT_ID> <PATH>

Creates a directory. The parent must already exist.

hive file mv <PROJECT_ID> <FROM> <TO>

Moves or renames a file or directory. The destination must not already exist.

hive file cp <PROJECT_ID> <FROM> <TO>

Copies a file or directory recursively. The destination must not already exist.

hive file rm <PROJECT_ID> <PATH>

Deletes a file or directory. Directories are removed recursively.


hive git - Git operations on a project

hive git <SUBCOMMAND> <PROJECT_ID> ...

All git operations run against a project's working directory on the daemon host.

hive git status <PROJECT_ID>

Shows branch, ahead/behind count, staged changes, unstaged changes, and untracked files.

$ hive git status a1b2c3d4-...
On branch main (upstream: origin/main, +1 -0)

Staged changes:
  M src/main.rs

Untracked files:
  ? scratch.txt

hive git diff <PROJECT_ID> <PATH> [--cached]

Prints the unified diff for a file. --cached shows the staged diff (index vs HEAD); without it shows the unstaged diff (worktree vs index).

hive git stage <PROJECT_ID> <PATH...>

Stages one or more files. Pass . to stage everything.

hive git unstage <PROJECT_ID> <PATH...>

Unstages one or more files. Pass . to unstage everything.

hive git commit <PROJECT_ID> --message <MSG>

Commits staged changes.

$ hive git commit a1b2c3d4-... --message "fix: null pointer in parser"

hive git pull <PROJECT_ID>

Pulls from the configured upstream.

hive git push <PROJECT_ID>

Pushes to the configured upstream.


Cluster Usage

When using --nodes, the client connects to the first reachable node:

bash
# Connect to whichever node answers first - any node can serve the request
hive --nodes 10.0.0.1:9178,10.0.0.2:9178 ls

# Environment variable form
export HIVE_NODES="10.0.0.1:9178,10.0.0.2:9178"
hive ls

Leaderless clustering has no leader to find: every node serves reads and writes locally and gossips changes to its peers, so any reachable node returns the same cluster-wide view. The connected address is printed to stderr:

Connected to 10.0.0.1:9178

Exit Codes

CodeMeaning
0Success
1Error (auth failure, connection refused, session not found, etc.)

Logging

Set the RUST_LOG environment variable to control log output:

bash
RUST_LOG=debug hive ls       # Verbose logging
RUST_LOG=warn hive ls        # Only warnings (default)

Hive - remote AI coding agents over WebSocket.