@cabane/cli 0.1.4 → 0.1.6
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 +74 -87
- package/dist/cli.js +295 -730
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
# cabane CLI
|
|
2
2
|
|
|
3
3
|
Run a self-hosted [Cabane](https://cabane.ai) on your own machine. `@cabane/cli`
|
|
4
|
-
installs the Cabane server, runs the whole stack — server
|
|
5
|
-
and
|
|
4
|
+
installs the Cabane server, runs the whole stack — server plus embedded Postgres —
|
|
5
|
+
and keeps it updated.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**Claude Code**, **Codex**, or **opencode**. Cabane ships no model of its own
|
|
13
|
-
and requires no particular provider; the house bridge runs whichever executor
|
|
14
|
-
(and credentials) you have.
|
|
7
|
+
That's the whole server side — your workspace, its files, and its data. **Agents
|
|
8
|
+
run the same way they do on hosted Cabane: on a [companion](https://app.cabane.ai/docs/reference/companion)
|
|
9
|
+
you pair**, on a device you control, using the harness (Claude Code, Codex, or
|
|
10
|
+
OpenCode) and credential already there. The self-hosted server runs no agent turns
|
|
11
|
+
itself and needs no model key of its own.
|
|
15
12
|
|
|
16
13
|
The short version:
|
|
17
14
|
|
|
18
15
|
```sh
|
|
19
16
|
npm i -g @cabane/cli # install the CLI (bin: `cabane`)
|
|
20
|
-
cabane init # first-run wizard
|
|
17
|
+
cabane init # first-run wizard (data location, port, URL)
|
|
21
18
|
cabane install --token cabdist_… # fetch + verify + unpack the server
|
|
22
19
|
cabane up --daemon # run the stack
|
|
23
20
|
# open http://localhost:3000, sign up
|
|
24
|
-
cabane setup-agent #
|
|
21
|
+
cabane setup-agent # confirm your account + how to pair a companion
|
|
25
22
|
```
|
|
26
23
|
|
|
27
24
|
Each step, in order, below.
|
|
@@ -29,8 +26,10 @@ Each step, in order, below.
|
|
|
29
26
|
## Requirements
|
|
30
27
|
|
|
31
28
|
- **Node ≥ 22.**
|
|
32
|
-
- **
|
|
33
|
-
with
|
|
29
|
+
- **A companion to run your agents** — the desktop Companion or the headless
|
|
30
|
+
`@cabane/companion`, on a device you control, with a coding-agent harness (Claude
|
|
31
|
+
Code, Codex, or OpenCode) installed and signed in. The server itself needs no
|
|
32
|
+
model credential.
|
|
34
33
|
|
|
35
34
|
## Getting started
|
|
36
35
|
|
|
@@ -38,35 +37,34 @@ Each step, in order, below.
|
|
|
38
37
|
|
|
39
38
|
2. **Run `cabane init`** — the interactive first-run wizard. It asks where your
|
|
40
39
|
data lives (and shows the resolved paths — `data/storage` for uploads,
|
|
41
|
-
`data/pg` for the database), the port, an optional public URL
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
persists to config, so a later `cabane up` needs no flags. Re-run it any time
|
|
45
|
-
to reconfigure, or skip it and pass flags directly if you prefer.
|
|
40
|
+
`data/pg` for the database), the port, and an optional public URL. Everything
|
|
41
|
+
persists to config, so a later `cabane up` needs no flags. Re-run it any time to
|
|
42
|
+
reconfigure, or skip it and pass flags directly if you prefer.
|
|
46
43
|
|
|
47
44
|
3. **Run `cabane install --token cabdist_…`** — fetches the server artifact with
|
|
48
45
|
your distribution token, verifies its sha256, and unpacks it. (Have a local
|
|
49
46
|
tarball instead? `cabane install --from <artifact.tgz>` works offline.)
|
|
50
47
|
|
|
51
48
|
4. **Run `cabane up --daemon`** — starts and supervises the stack: embedded
|
|
52
|
-
Postgres
|
|
53
|
-
the foreground.
|
|
49
|
+
Postgres and the server. Leave off `--daemon` to run it in the foreground.
|
|
54
50
|
|
|
55
51
|
5. **Sign up.** Open <http://localhost:3000> and create your account and first
|
|
56
52
|
workspace.
|
|
57
53
|
|
|
58
|
-
6. **
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
6. **Pair a companion.** Your workspace seeds an agent, but it has nowhere to run
|
|
55
|
+
until you pair a device. `cabane setup-agent` (mint an access token in
|
|
56
|
+
**Settings → Developer**, paste it at the prompt) confirms your account and
|
|
57
|
+
prints the steps: install the Companion (desktop app, or the headless
|
|
58
|
+
`@cabane/companion`), sign in against this instance, pair it, then assign the
|
|
59
|
+
seeded agent to one of its connectors. This is the same pairing flow as hosted
|
|
60
|
+
Cabane.
|
|
63
61
|
|
|
64
|
-
For the fuller picture of what you just stood up — agents,
|
|
65
|
-
|
|
62
|
+
For the fuller picture of what you just stood up — agents, workspaces, files —
|
|
63
|
+
see the [Cabane docs](https://app.cabane.ai/docs).
|
|
66
64
|
|
|
67
65
|
## What it supervises
|
|
68
66
|
|
|
69
|
-
`cabane up` runs
|
|
67
|
+
`cabane up` runs two children in order, with a clean SIGTERM teardown:
|
|
70
68
|
|
|
71
69
|
1. **Embedded Postgres** — the `embedded-postgres` binaries (pinned pg 16.14) run
|
|
72
70
|
as a child on a local off-5432 port; data in `<CABANE_HOME>/data/pg`. No system
|
|
@@ -74,30 +72,29 @@ files — see the [Cabane docs](https://app.cabane.ai/docs).
|
|
|
74
72
|
2. **The server** — the artifact's single-process API+SPA (`server.js`, filesystem
|
|
75
73
|
storage, the bundled SPA served via `WEB_DIST`), env composed automatically
|
|
76
74
|
(`NODE_ENV=production`, `http://localhost:<port>`, generated-once vision
|
|
77
|
-
secret). Migrations apply on boot.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
secret, any persisted `cabane set-env` creds). Migrations apply on boot.
|
|
76
|
+
|
|
77
|
+
Agents don't run here — they run on a companion you pair (a separate process on a
|
|
78
|
+
device you control), the same as hosted Cabane.
|
|
81
79
|
|
|
82
80
|
## Layout (`~/.cabane-selfhost/`)
|
|
83
81
|
|
|
84
82
|
```
|
|
85
|
-
config.json the CLI's config (token, port, versions,
|
|
83
|
+
config.json the CLI's config (token, port, versions, persisted creds)
|
|
86
84
|
app/<version>/ each installed artifact tree
|
|
87
85
|
data/pg/ Postgres data dir
|
|
88
86
|
data/storage/ file bytes (filesystem storage backend)
|
|
89
|
-
|
|
90
|
-
logs/ server.log · bridge.log
|
|
87
|
+
logs/ server.log
|
|
91
88
|
run/ supervisor.pid · state.json
|
|
92
89
|
```
|
|
93
90
|
|
|
94
91
|
The root defaults to **`~/.cabane-selfhost/`** — deliberately _not_ `~/.cabane`,
|
|
95
|
-
which a standalone `@cabane/
|
|
96
|
-
install can never clobber a
|
|
97
|
-
whole root with the **`CABANE_HOME`** env var (the multi-instance
|
|
98
|
-
pre-existing self-host install still living at `~/.cabane` is adopted in
|
|
99
|
-
no data moves. A `cabane install` / `set-env` pointed (via `CABANE_HOME`)
|
|
100
|
-
directory that holds a
|
|
92
|
+
which a standalone `@cabane/companion` user companion already keys off, so a
|
|
93
|
+
self-host install can never clobber a companion's device pairing on a shared box.
|
|
94
|
+
Override the whole root with the **`CABANE_HOME`** env var (the multi-instance
|
|
95
|
+
lever); a pre-existing self-host install still living at `~/.cabane` is adopted in
|
|
96
|
+
place, so no data moves. A `cabane install` / `set-env` pointed (via `CABANE_HOME`)
|
|
97
|
+
at a directory that holds a companion config refuses rather than overwrite it.
|
|
101
98
|
|
|
102
99
|
**Relocating just the data.** `cabane init` can point the **data** leg (pg +
|
|
103
100
|
storage) at any path you choose while `config.json` + `app/` stay under the root —
|
|
@@ -115,17 +112,28 @@ paths so you can see it.
|
|
|
115
112
|
|
|
116
113
|
| Command | What it does |
|
|
117
114
|
| -------------------- | --------------------------------------------------------------------------------------------- |
|
|
118
|
-
| `cabane init` | interactive first-run wizard: data location, port, public URL
|
|
115
|
+
| `cabane init` | interactive first-run wizard: data location, port, public URL |
|
|
119
116
|
| `cabane install` | fetch (token → gated artifact) or `--from` a local tarball; unpack + `npm install --omit=dev` |
|
|
120
117
|
| `cabane up` | start + supervise the stack (`--daemon` for background) |
|
|
121
|
-
| `cabane setup-agent` | after signup:
|
|
118
|
+
| `cabane setup-agent` | after signup: confirm your account + print companion-pairing guidance |
|
|
122
119
|
| `cabane update` | install a newer published artifact (keeps N-1 for rollback) |
|
|
123
|
-
| `cabane set-env` | persist `KEY=VALUE`
|
|
120
|
+
| `cabane set-env` | persist generic `KEY=VALUE` server env forwarded to the server (`--list` / `--unset`) |
|
|
124
121
|
| `cabane down` | stop a running stack |
|
|
125
122
|
| `cabane status` | what's installed + running |
|
|
126
|
-
| `cabane logs` | tail the server
|
|
123
|
+
| `cabane logs` | tail the server log |
|
|
127
124
|
| `cabane doctor` | preflight: diagnose common self-host failure classes (runs with the stack down) |
|
|
128
125
|
|
|
126
|
+
## Running agents
|
|
127
|
+
|
|
128
|
+
A self-hosted server runs no agent turns itself. Agents run exactly as on hosted
|
|
129
|
+
Cabane: on a companion you pair against your instance. Install the desktop
|
|
130
|
+
Companion or the headless `@cabane/companion` on a device you control, sign in
|
|
131
|
+
against your self-hosted URL, pair it, and assign your agents to its connectors.
|
|
132
|
+
The turn runs in the harness on that device — Claude Code, Codex, or OpenCode —
|
|
133
|
+
against the login or key already there; the server never sees the credential. For a
|
|
134
|
+
single-box setup, the companion can run on the same machine as the server (point it
|
|
135
|
+
at `http://localhost:3000`).
|
|
136
|
+
|
|
129
137
|
## Troubleshooting — `cabane doctor`
|
|
130
138
|
|
|
131
139
|
When something won't start, run `cabane doctor` **first**. It's a standalone
|
|
@@ -135,53 +143,32 @@ pass/fail/warn report, each with a one-line fix, then exits non-zero if any hard
|
|
|
135
143
|
check fails. It's strictly local — nothing phones home. Checks:
|
|
136
144
|
|
|
137
145
|
- **Node** ≥ the required version.
|
|
138
|
-
- **Executor** — your executor's binary on PATH (`claude` by default), and a
|
|
139
|
-
credential reachable by the house bridge (a subscription login, or an
|
|
140
|
-
`ANTHROPIC_*` env/persisted key). Reachability only; it never calls the
|
|
141
|
-
provider.
|
|
142
146
|
- **Port** free (or held by a running cabane).
|
|
143
147
|
- **Embedded Postgres** — platform binaries present + data dir healthy.
|
|
144
148
|
- **Storage root** — writable, and where it is.
|
|
145
|
-
- **Bridge/server version** — the bridge bundled in the installed artifact
|
|
146
|
-
matches the server it ships with (a version skew from a mismatched install is
|
|
147
|
-
flagged).
|
|
148
149
|
- **Disk space** for the data dir.
|
|
149
150
|
- **macOS Gatekeeper** — quarantine on the Postgres binaries (macOS only).
|
|
150
151
|
|
|
151
|
-
##
|
|
152
|
-
|
|
153
|
-
The
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
# ambient — export in the shell you launch from
|
|
172
|
-
export ANTHROPIC_API_KEY=sk-ant-…
|
|
173
|
-
cabane up --daemon
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
`set-env` stores generic `KEY=VALUE` pairs in `<CABANE_HOME>/config.json` and composes
|
|
177
|
-
them into the bridge on every `up`, so it serves any executor's credentials (a
|
|
178
|
-
proxy `ANTHROPIC_BASE_URL`, an `ANTHROPIC_AUTH_TOKEN`, another harness's key) —
|
|
179
|
-
not just Anthropic. A bare `cabane set-env KEY` (no `=value`) prompts for the value
|
|
180
|
-
without echoing, so a secret never lands on the command line. Inspect with `cabane
|
|
181
|
-
set-env --list` (values masked), remove with `cabane set-env --unset KEY`. A live shell export takes precedence over a
|
|
182
|
-
persisted value; the house-class isolation vars (`HOME`, `CLAUDE_CONFIG_DIR`,
|
|
183
|
-
class) always win over both. Apply a change to an already-running stack with
|
|
184
|
-
`cabane down && cabane up`.
|
|
152
|
+
## Server env — `cabane set-env`
|
|
153
|
+
|
|
154
|
+
The self-hosted server needs no model credential of its own. `cabane set-env` stays
|
|
155
|
+
for any generic server env you _do_ want to persist:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
# persisted — save once; every future `up` (fresh shell, reboot) picks it up.
|
|
159
|
+
# A bare KEY prompts for the value (hidden); `KEY=VALUE` still works for scripting.
|
|
160
|
+
cabane set-env SOME_KEY
|
|
161
|
+
cabane down && cabane up --daemon
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
It stores generic `KEY=VALUE` pairs in `<CABANE_HOME>/config.json` and layers them
|
|
165
|
+
into the server's env on every `up` — beneath the composed infra vars, so an
|
|
166
|
+
operator key reaches the server but can never clobber `DATABASE_URL` / `NODE_ENV` /
|
|
167
|
+
`STORAGE_*`. A bare `cabane set-env KEY` (no `=value`) prompts for the value without
|
|
168
|
+
echoing, so a secret never lands on the command line. Inspect with
|
|
169
|
+
`cabane set-env --list` (values masked), remove with `cabane set-env --unset KEY`.
|
|
170
|
+
A live shell export takes precedence over a persisted value. Apply a change to an
|
|
171
|
+
already-running stack with `cabane down && cabane up`.
|
|
185
172
|
|
|
186
173
|
## Notes
|
|
187
174
|
|