@cabane/companion 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,9 +10,9 @@ This is **v0**. It's a small CLI — install it from npm with one command, pair
10
10
 
11
11
  ## The model in one paragraph
12
12
 
13
- The Companion runs on a **device you register**, running **agents you assign to it**. You register the device once (in Cabane), pair it to this CLI with a one-time **pairing string**, and `start` it. From then on it **pulls its assignments from Cabane at runtime** — every agent you've pointed at this device, across all your workspaces — and runs each one locally. Which agents to run, and how they're configured (mode, MCP servers, model), is owned by Cabane and delivered per turn. The machine only holds the bits that _must_ be local: the device token, each agent's working directory, and your secrets.
13
+ The Companion runs on a **device you pair**, running **agents you assign to it**. Pair the device once with a short code, then `start` it. From then on it **pulls its assignments from Cabane at runtime** — every agent you've pointed at this device, across all your workspaces — and runs each one locally. Which agents to run, and how they're configured (mode, MCP servers, model), is owned by Cabane and delivered per turn. The machine only holds the bits that _must_ be local: the device token, each agent's working directory, and your secrets.
14
14
 
15
- > **No account password or full-account token ever touches your machine.** The pairing string carries a **device token** (`cabdev_…`) — good only for pulling this device's assignments and reporting liveness. Each agent the Companion runs gets its own **workspace-bound agent token**, delivered once when the agent is assigned and scoped to that one agent in that one workspace. Registering, deactivating, and removing a device — and assigning agents to it — all live in the Cabane app; the CLI only runs the agents locally.
15
+ > **No account password or full-account token ever touches your machine.** The short-code pairing flow delivers a **device token** (`cabdev_…`) directly to the waiting CLI — good only for pulling this device's assignments and reporting liveness. Each agent the Companion runs gets its own **workspace-bound agent token**, delivered once when the agent is assigned and scoped to that one agent in that one workspace. Deactivating and removing a device — and assigning agents to it — all live in the Cabane app; the CLI only pairs the machine and runs the agents locally.
16
16
 
17
17
  ## Prerequisites
18
18
 
@@ -32,12 +32,20 @@ That puts `cabane-companion` on your PATH. Confirm it with `cabane-companion --v
32
32
 
33
33
  ## First run
34
34
 
35
- In the Cabane app, open **Settings → Devices** (under your user settings) and **Register a device**. Give the machine a label; Cabane shows you — once — a **pairing string** (and the raw device token). Copy the pairing string; it won't be shown again.
35
+ On your machine, start the short-code pairing flow:
36
36
 
37
- Then, on your machine:
37
+ ```sh
38
+ cabane-companion pair
39
+ # Enter this code at https://cabane.ai/settings/companions
40
+ #
41
+ # ABCD-EFGH
42
+ #
43
+ # Waiting for you to confirm it in cabane…
44
+ ```
45
+
46
+ Open the printed URL, enter the code in **Settings → Connectors**, give the device a label, and confirm. The waiting command receives its device token directly and finishes:
38
47
 
39
48
  ```sh
40
- cabane-companion pair # paste the pairing string at the hidden prompt
41
49
  # ✓ Paired this device "MacBook" with https://app.cabane.ai.
42
50
  # Run `cabane-companion start` — it will pull the agents assigned to this device and run them.
43
51
 
@@ -50,7 +58,7 @@ cabane-companion start
50
58
  # [14:32:14] 4f6a93d2 — replied (8.4s)
51
59
  ```
52
60
 
53
- The pairing string carries a live credential, so `pair` reads it off-argv by default: with no argument you're prompted to paste it (hidden), or pass `--file <path>`. Passing it positionally still works but leaves the secret in your shell history and process list, so `pair` warns.
61
+ A headless machine needs no browser of its own: run `cabane-companion pair` on it, then open **Settings Connectors** in any browser you're signed in to and enter the short code it printed. The device token is delivered straight to the waiting CLI over the pairing channel nothing is ever copied or pasted.
54
62
 
55
63
  A freshly paired device runs nothing yet — it has no agents. In **Workspace settings → Agents**, set an agent's **executor** to this device. The running Companion picks the assignment up within a minute (no restart), and the next time you `@mention` that agent, the reply comes from your own machine. Assign agents in as many of your workspaces as you like — one running Companion serves them all.
56
64
 
@@ -58,7 +66,7 @@ A freshly paired device runs nothing yet — it has no agents. In **Workspace se
58
66
 
59
67
  | Command | What it does |
60
68
  | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
- | `pair [string] [--file <path>]` | Pair this device using the one-time string the Cabane app gives you. Decoded + validated locally (no network call), then the device identity is written to `~/.cabane/config.json` (mode 600). Re-pairing replaces the device token and **keeps** your local `agents` overrides + dashboard prefs. |
69
+ | `pair [--server <url>]` | Pair this device using a short code confirmed in Settings Connectors. The device token is delivered directly to the waiting CLI, then the identity is written to `~/.cabane/config.json` (mode 600). Re-pairing replaces the device token and **keeps** your local `agents` overrides + dashboard prefs. |
62
70
  | `start [--open] [--no-open] [--daemon] [--port <p>]` | Pull this device's assigned agents from Cabane and run them, opening one SSE subscription per workspace and serving the localhost dashboard (default `http://127.0.0.1:7474`; URL printed on start). Re-pulls assignments every ~60s, so adding/removing an agent in Cabane lands without a restart. Does **not** auto-open a browser by default — pass `--open` (or set `autoOpen: true` in config); `--no-open` / `BRIDGE_NO_OPEN=1` force it off. Foreground by default; `--daemon` runs it detached (see below). |
63
71
  | `stop` | Stops a running Companion (foreground or daemon) cleanly. Idempotent — "nothing running" is a success. |
64
72
  | `status` | Prints local state — the paired device, the secret names it declares, the log path, and (when running) whether the Companion is background or foreground, its pid, uptime, and dashboard URL. The live list of assigned agents lives in the dashboard while the Companion runs. |