sdk/apps/cline-hub/README.md
A browser dashboard for the local Cline hub. Open it to see who's connected, what sessions are running, drive a session from a chat box, and restart the hub when you need a fresh daemon.
HubUIClient.subscribeUI)CLINE_PROVIDER / CLINE_MODEL env varsROOM_SECRETThe dashboard registers two clients with the hub: a cline-hub-server (via ClineCore) for driving sessions and a cline-hub-server (via HubUIClient) for the admin view.
cd apps/cline-hub
bun run start
Open http://127.0.0.1:8787 and click Connect. The server will discover or spawn a local detached hub on startup; the hub endpoint is printed in the console and shown in the sidebar.
For webview development with Vite hot reload:
cd apps/cline-hub
bun run dev
This starts the Vite webview server on http://127.0.0.1:5173 and the hub dashboard on http://127.0.0.1:8787. Open the dashboard URL; the served page loads webview modules from Vite, so changes under src/webview/src hot reload without rebuilding. Use CLINE_HUB_WEBVIEW_DEV_PORT or CLINE_HUB_WEBVIEW_DEV_HOST to change the Vite bind address.
To start a brand-new session, the dashboard needs to know which provider and model to use. It picks them up automatically from the most recent session on the hub. If there are no recent sessions, set CLINE_PROVIDER and CLINE_MODEL in the environment before running.
Environment variables:
| Variable | Default | Description |
|---|---|---|
HOST | 127.0.0.1 | Bind host for the dashboard. Use the default for same-machine development. Set HOST=0.0.0.0 only when intentionally exposing the dashboard on a LAN/tunnel. |
CLINE_HUB_DASHBOARD_PORT | 8787 | Dashboard HTTP/WebSocket port. |
PUBLIC_URL | http://<HOST>:<PORT> (127.0.0.1 when binding 0.0.0.0) | URL printed for humans to open/copy. Set this to your LAN URL or tunnel URL. |
ROOM_SECRET | unset | Shared invite secret required for browser WebSocket connections when HOST is non-local. |
WORKSPACE_ROOT | current directory | Workspace passed to the hub on startup. |
CLINE_PROVIDER | unset | Fallback provider id when no recent session is available to copy from. |
CLINE_MODEL | unset | Fallback model id when no recent session is available to copy from. |
The server prints both the bind URL and the public/invite URL at startup. When ROOM_SECRET is set, the printed invite URL includes ?roomSecret=...; the browser UI also lets you paste the secret manually.
Validate option parsing without starting a server:
bun run smoke:options
Choose a strong room secret and bind explicitly to all interfaces:
cd apps/cline-hub
HOST=0.0.0.0 \
CLINE_HUB_DASHBOARD_PORT=8787 \
PUBLIC_URL=http://YOUR_LAN_IP:8787 \
ROOM_SECRET='use-a-long-random-secret' \
bun run start
Share the printed invite URL with another machine on the same LAN.
ROOM_SECRET is required for HOST=0.0.0.0; without it the dashboard exits before listening.
Start the dashboard locally with an explicit secret:
cd apps/cline-hub
ROOM_SECRET='use-a-long-random-secret' bun run start
In another terminal, expose the local port with your tunnel provider, for example:
ngrok http 8787
Restart the dashboard with the tunnel URL as PUBLIC_URL so the printed invite URL is copyable:
PUBLIC_URL=https://YOUR-TUNNEL.example \
ROOM_SECRET='use-a-long-random-secret' \
bun run start
Share only the printed invite URL with trusted participants.
Clicking Restart Hub in the sidebar:
ClineCore and HubUIClient from the current hub.stopLocalHubServerGracefully() to shut the local detached hub down.ensureDetachedHubServer(workspaceRoot) to spawn a fresh hub.Sessions running on the previous hub are stopped along with the hub. Other clients connected to that hub (CLI, VS Code, menubar) will see their connection drop and reconnect to the new daemon on next request.
This is an example dashboard, not a production admin tool. Exposing it on a LAN or tunnel lets anyone with the invite secret list clients/sessions on your hub, drive sessions, and restart the hub. Use a long random ROOM_SECRET, only share the URL with trusted participants, and stop the process when you are done. The hub and agent runtime remain owned by the host machine.