CLI Reference
The cihub CLI manages your Companion Hub stack, apps, models, and CI Account registration from the terminal. It is bundled with the desktop app and Linux packages β there is no separate npm package.
Install
Install Companion Hub using any desktop path:
- DownloadΒ or GitHub ReleasesΒ
- macOS:
brew install --cask companion-hub(after tapping homebrew-tapΒ ) - Windows:
scoop install companion-hub(after adding the scoop bucketΒ ) - Linux:
.debor.rpmfrom GitHub Releases
On first launch of the desktop app, cihub is copied to:
| Platform | Location |
|---|---|
| macOS / Linux | ~/.local/bin (or ~/bin) |
| Windows | %LOCALAPPDATA%\Companion Hub\bin |
Open a new terminal after first launch, then verify:
cihub --helpOn a Linux headless server where you never opened the GUI, use the bundled path directly or run companion-hub --detached first:
/usr/lib/companion-hub/resources/cihub wizardnpm install -g ci-hub is not supported β the CLI is not published to the npm
registry. Install the desktop app or Linux package instead.
Environments
Most commands accept an optional environment argument. On a packaged install (desktop app or Linux package), commands always target your prod data directory regardless of the env name you pass.
| Value | Env file | Compose files | When to use |
|---|---|---|---|
local (default in checkout) | .env.local | docker-compose.local.yml | Source-based development from a git clone |
dev | .env.dev | docker-compose.prod.yml | Dev appliance |
staging | .env.staging | docker-compose.prod.yml + staging overlay | Staging appliance |
prod | .env.prod | docker-compose.prod.yml | Explicit prod appliance from checkout |
# From a git clone (contributors):
cihub up local
cihub up dev --detached
cihub status prod
# From a packaged install (any directory):
cihub up --detached
cihub statusSetup & registration
cihub wizard [env]
Guided setup wizard. On first run (no env file found), enters FTUE mode: checks Docker, runs setup and registration, then starts the Hub.
cihub wizardReturning users get an action menu: setup, up, register, config, MCP, down, app-list, reset, restart.
cihub setup [env]
Initializes Traefik and Docker auth config for the target environment.
cihub register [env]
Prints your device ID and the hub.ci.computer registration URL. Open the URL in a browser to pair the device.
Hub lifecycle
cihub up [env] [--detached] # start the hub stack
cihub down [env] # stop the hub stack
cihub restart [env] # restart the target environment
cihub recreate [env] # reset runtime state, then start again
cihub status [env] # containers, tunnel URL, Tailscale IP, models
cihub logs [env] [service] # stream compose logs
cihub config [env] # resolved config values--detachedruns the stack in the background (equivalent todocker compose up -d).statusshows Containers (color-coded), Network (local URL, Cloudflare tunnel, Tailscale VPN IP), and Models (installed Ollama models).
Packaged / headless startup
companion-hub --detached # Linux headless, no GUI
cihub up --detached # same prod install, from any shellFor source-based local development:
cihub up localModels
cihub models list
cihub models install llama3.2
cihub models rm llama3.2Requires Ollama reachable on the host. See AI & Inference.
App lifecycle
Manage Docker containers on the host, independently of the Hub compose stack:
cihub app list
cihub app status [name]
cihub app logs <name> [--tail N]
cihub app inspect <name>
cihub app add <name> <image> [--port h:c] [--env K=V]
cihub app edit <name> <image> [--port h:c] [--env K=V]
cihub app start <name>
cihub app stop <name>
cihub app restart <name>
cihub app delete <name>Public Web
Diagnose and repair Cloudflare Gateway routing for exposable apps:
cihub public-web status [env]
cihub public-web repair [env] [--app <name>]MCP
Enable the Hub MCP server for agent apps:
cihub mcp setup [env]
cihub mcp shutdown [env]
cihub mcp config [env]Connect an agent
Wire an agent installed on this host to Companion Memory, so it gets passive capture rather than memory tools it has to call:
cihub connect openclaw --memory-url <url> --memory-key <key>
cihub connect hermes --memory-url <url> --memory-key <key>| Flag | Effect |
|---|---|
--memory-url, --memory-key | Companion Memory base URL and an API key. Prompted for on a TTY |
--hub-url, --hub-key | Also register the Hub MCP server |
--force | Claim the memory slot even if another provider holds it (openclaw) |
--dry-run | Print the plan and write nothing |
It probes every server you give it before touching disk, so a failed probe leaves the machine
exactly as it was. The memory probe checks the key, not just the address β it calls an endpoint
requiring the Memory scope, so a key that would fail silently at capture time is refused up front.
For openclaw it backs up the agentβs config before editing and restores it on a failed write; for
hermes it stages the plugin, writes mcp_servers.hub when you pass the Hub flags, and hands the
memory credentials to hermes memory setup, which you still run to finish. It configures the
host it runs on β for an agent on another machine, follow the per-agent instructions in
Connect an Existing Agent.
API keys
Mint and list the keys an MCP client uses to reach the Hub. Run these on the appliance host:
cihub api-key create --name <label> [--scopes mcp] [--capability read|write|full]
cihub api-key list| Flag | Values | Default |
|---|---|---|
--name | any label | required |
--scopes | mcp | mcp |
--capability | read, write, full | write |
The key is printed once, at creation, and cannot be retrieved afterwards. api-key list shows
IDs, names, scopes, capability and a prefix β never the key itself.
Choosing a capability, and connecting a client once you have a key, are covered in Connect an Existing Agent.
There is no subcommand for changing an existing key β create and list are the whole CLI surface.
Change a keyβs capability from Settings β Security in the Hub dashboard instead.
Maintenance
cihub doctor [env] # validate Docker, env files, bind mounts, and compose inputs
cihub clean [env] [--yes] # remove generated host-state files for one environment
cihub reset [env] [--yes] # remove runtime state for one environment
cihub uninstall [--yes] # full machine cleanup of Hub stateresetis the environment-scoped wipe path.uninstallis the machine-wide uninstall-style wipe path, including Hub data, tunnel state, containers, volumes, and related runtime files.
Help
cihub --help
cihub man
cihub versionFor running Hub without the desktop window, see Running Companion Hub.