@cabane/cli 0.1.1 → 0.1.3
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/dist/cli.js +12 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -189,7 +189,7 @@ import { homedir as homedir2 } from "os";
|
|
|
189
189
|
// src/config.ts
|
|
190
190
|
import { mkdirSync, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
191
191
|
import { dirname } from "path";
|
|
192
|
-
var DEFAULT_DIST_BASE = "https://
|
|
192
|
+
var DEFAULT_DIST_BASE = "https://dist.cabane.ai";
|
|
193
193
|
var DEFAULT_PORT = 3e3;
|
|
194
194
|
var DEFAULT_PG_PORT = 55432;
|
|
195
195
|
function defaultConfig() {
|
|
@@ -953,7 +953,7 @@ import { pipeline } from "stream/promises";
|
|
|
953
953
|
var bearer = (token) => ({ authorization: `Bearer ${token}` });
|
|
954
954
|
async function fetchManifest(distBase, token, version) {
|
|
955
955
|
const q = version && version.length > 0 ? `?version=${encodeURIComponent(version)}` : "";
|
|
956
|
-
const res = await fetch(`${distBase.replace(/\/$/, "")}/
|
|
956
|
+
const res = await fetch(`${distBase.replace(/\/$/, "")}/manifest${q}`, {
|
|
957
957
|
headers: bearer(token)
|
|
958
958
|
});
|
|
959
959
|
if (res.status === 404) return null;
|
|
@@ -963,13 +963,13 @@ async function fetchManifest(distBase, token, version) {
|
|
|
963
963
|
);
|
|
964
964
|
}
|
|
965
965
|
if (!res.ok) {
|
|
966
|
-
throw new Error(`GET /
|
|
966
|
+
throw new Error(`GET /manifest \u2192 ${res.status}: ${(await res.text()).slice(0, 200)}`);
|
|
967
967
|
}
|
|
968
968
|
return await res.json();
|
|
969
969
|
}
|
|
970
970
|
async function downloadArtifact(distBase, token, manifest, destPath) {
|
|
971
971
|
const q = `?version=${encodeURIComponent(manifest.version)}`;
|
|
972
|
-
const res = await fetch(`${distBase.replace(/\/$/, "")}/
|
|
972
|
+
const res = await fetch(`${distBase.replace(/\/$/, "")}/artifact${q}`, {
|
|
973
973
|
headers: bearer(token),
|
|
974
974
|
// fetch follows the 302 to the presigned URL on its own; the redirect target
|
|
975
975
|
// is unauthenticated (the signature is the gate) so the bearer header is
|
|
@@ -977,7 +977,7 @@ async function downloadArtifact(distBase, token, manifest, destPath) {
|
|
|
977
977
|
redirect: "follow"
|
|
978
978
|
});
|
|
979
979
|
if (!res.ok || !res.body) {
|
|
980
|
-
throw new Error(`GET /
|
|
980
|
+
throw new Error(`GET /artifact \u2192 ${res.status}: ${(await res.text()).slice(0, 200)}`);
|
|
981
981
|
}
|
|
982
982
|
const hash = createHash("sha256");
|
|
983
983
|
const source = Readable.fromWeb(res.body);
|
|
@@ -1222,7 +1222,7 @@ function composeBridgeEnv(opts) {
|
|
|
1222
1222
|
...opts.persistedEnv,
|
|
1223
1223
|
...opts.parentEnv,
|
|
1224
1224
|
CABANE_BRIDGE_HOME: opts.bridgeHome,
|
|
1225
|
-
CLAUDE_CONFIG_DIR: opts.claudeConfigDir,
|
|
1225
|
+
...opts.claudeConfigDir ? { CLAUDE_CONFIG_DIR: opts.claudeConfigDir } : {},
|
|
1226
1226
|
BRIDGE_NO_OPEN: "1",
|
|
1227
1227
|
CABANE_BRIDGE_CLASS: "house"
|
|
1228
1228
|
};
|
|
@@ -1554,6 +1554,9 @@ function daemonFooter(config) {
|
|
|
1554
1554
|
lines.push("logs: cabane logs \xB7 stop: cabane down");
|
|
1555
1555
|
return lines;
|
|
1556
1556
|
}
|
|
1557
|
+
function resolveClaudeConfigDir(env = process.env) {
|
|
1558
|
+
return env.CLAUDE_CONFIG_DIR;
|
|
1559
|
+
}
|
|
1557
1560
|
var Supervisor = class {
|
|
1558
1561
|
constructor(paths, appDir, port) {
|
|
1559
1562
|
this.paths = paths;
|
|
@@ -1595,7 +1598,7 @@ var Supervisor = class {
|
|
|
1595
1598
|
const config = loadConfig();
|
|
1596
1599
|
const paired = readBridgeConfig(this.paths.bridgeHome)?.deviceId;
|
|
1597
1600
|
if (!config.houseDeviceId || !paired) return;
|
|
1598
|
-
const claudeConfigDir =
|
|
1601
|
+
const claudeConfigDir = resolveClaudeConfigDir();
|
|
1599
1602
|
this.bridge = new BridgeChild(
|
|
1600
1603
|
this.appDir,
|
|
1601
1604
|
this.paths.bridgeHome,
|
|
@@ -1913,14 +1916,14 @@ async function update(opts) {
|
|
|
1913
1916
|
|
|
1914
1917
|
// src/cli.ts
|
|
1915
1918
|
var program = new Command();
|
|
1916
|
-
program.name("cabane").description("Run a self-hosted Cabane on your own machine \u2014 no docker, no repo.").version("0.1.
|
|
1919
|
+
program.name("cabane").description("Run a self-hosted Cabane on your own machine \u2014 no docker, no repo.").version("0.1.2");
|
|
1917
1920
|
var parsePort = (raw) => {
|
|
1918
1921
|
const n = Number(raw);
|
|
1919
1922
|
if (!Number.isInteger(n) || n <= 0 || n > 65535) throw new Error(`invalid port: ${raw}`);
|
|
1920
1923
|
return n;
|
|
1921
1924
|
};
|
|
1922
1925
|
program.command("init").description("interactive first-run wizard: data location, port, and the executor credential").action(init);
|
|
1923
|
-
program.command("install").description("install the server artifact (token \u2192 gated download, or --from a local tarball)").option("--token <token>", "distribution token (cabdist_\u2026) \u2014 prompted if omitted").option("--from <tarball>", "install from a local artifact tarball instead of downloading").option("--dist-base <url>", "distribution origin to fetch from (default https://
|
|
1926
|
+
program.command("install").description("install the server artifact (token \u2192 gated download, or --from a local tarball)").option("--token <token>", "distribution token (cabdist_\u2026) \u2014 prompted if omitted").option("--from <tarball>", "install from a local artifact tarball instead of downloading").option("--dist-base <url>", "distribution origin to fetch from (default https://dist.cabane.ai)").option("--version <version>", "install a specific published version (default: latest)").option("--port <port>", "local port the server will listen on (default 3000)", parsePort).option("--force", "reinstall even if this version is already present").action(install);
|
|
1924
1927
|
program.command("up").description("start + supervise the stack (Postgres, server, house bridge)").option("--daemon", "run in the background (terminal returns; stop with `cabane down`)").option("--port <port>", "override the configured port", parsePort).action(up);
|
|
1925
1928
|
program.command("setup-agent").description("after browser signup: register the house bridge + put your agent on it").option("--token <token>", "a Cabane access token (cab_\u2026) \u2014 prompted if omitted").option("--model <model>", "model the agent runs (default anthropic/claude-opus-4-8)").action(setupAgent);
|
|
1926
1929
|
program.command("update").description("install a newer published artifact (keeps the previous for rollback)").option("--token <token>", "distribution token (cabdist_\u2026) \u2014 defaults to the stored one").option("--dist-base <url>", "distribution origin to fetch from").option("--version <version>", "install a specific version instead of latest").action(update);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabane/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The cabane CLI — install, supervise (server + embedded Postgres + house bridge), and update a self-hosted Cabane on your own machine. No docker, no repo.",
|
|
6
6
|
"license": "UNLICENSED",
|