clawborrator-cli 0.2.3 → 0.2.5

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
@@ -57,7 +57,7 @@ claw token mint --name "$(hostname)" --mcp-snippet --out .mcp.json
57
57
  # `claw session list`.
58
58
  ```
59
59
 
60
- The session token is stored at `~/.clawborrator/config.json` (mode
60
+ The session token is stored at `~/.clawborrator/cli_v1.json` (mode
61
61
  0600). To talk to a different hub, pass `--hub <url>` once on login;
62
62
  the URL persists.
63
63
 
@@ -290,7 +290,7 @@ In-TUI commands:
290
290
 
291
291
  | Path | Contents |
292
292
  |---|---|
293
- | `~/.clawborrator/config.json` | hub URL + session token (mode 0600) |
293
+ | `~/.clawborrator/cli_v1.json` | hub URL + session token (mode 0600) |
294
294
  | `$CLAWBORRATOR_HUB` | env override for hub URL (one-shot, doesn't persist) |
295
295
 
296
296
  ---
@@ -64007,11 +64007,11 @@ var import_node_os = require("node:os");
64007
64007
  var import_node_path = require("node:path");
64008
64008
  var import_node_fs = require("node:fs");
64009
64009
  var CONFIG_DIR = (0, import_node_path.resolve)((0, import_node_os.homedir)(), ".clawborrator");
64010
- var CONFIG_PATH = (0, import_node_path.resolve)(CONFIG_DIR, "config.json");
64010
+ var CONFIG_PATH = (0, import_node_path.resolve)(CONFIG_DIR, "cli_v1.json");
64011
64011
  var DEFAULTS = {
64012
64012
  // Default to the public hub. Local-dev users override via either
64013
64013
  // CLAWBORRATOR_HUB=http://localhost:8787 or `claw login --hub <url>`,
64014
- // which persists into ~/.clawborrator/config.json.
64014
+ // which persists into ~/.clawborrator/cli_v1.json.
64015
64015
  hubUrl: process.env.CLAWBORRATOR_HUB ?? "https://next.clawborrator.com",
64016
64016
  sessionToken: null
64017
64017
  };
@@ -64213,7 +64213,7 @@ var loginCmd = new Command("login").description("authenticate against a hub_v1 i
64213
64213
  saveConfig({ hubUrl, sessionToken: session.token });
64214
64214
  console.log(`logged in as @${user.githubLogin}`);
64215
64215
  console.log(`hub: ${hubUrl}`);
64216
- console.log(`session: ${session.token.slice(0, 16)}\u2026 (stored in ~/.clawborrator/config.json)`);
64216
+ console.log(`session: ${session.token.slice(0, 16)}\u2026 (stored in ~/.clawborrator/cli_v1.json)`);
64217
64217
  console.log(`expires at: ${session.expiresAt}`);
64218
64218
  } catch (e) {
64219
64219
  if (e instanceof ApiError && e.status === 503) {
@@ -68642,7 +68642,7 @@ var sessionMessages = new Command("messages").alias("msgs").description("dump op
68642
68642
  }
68643
68643
  printPagedHasMore(data, opts.json);
68644
68644
  });
68645
- var sessionArchive = new Command("archive").description("soft-delete a session (sets archivedAt). Note: register-time reconnect unarchives, so a session whose UUID is still in a project's .claude/clawborrator/session.json will resurrect on its next start.").argument("<ref>", "session UUID or @routingName").action(async (ref) => {
68645
+ var sessionArchive = new Command("archive").description("soft-delete a session (sets archivedAt). Note: register-time reconnect unarchives, so a session whose UUID is still in a project's .claude/clawborrator/identity.json will resurrect on its next start.").argument("<ref>", "session UUID or @routingName").action(async (ref) => {
68646
68646
  const id = await resolveSessionId(ref);
68647
68647
  const r = await api.post(
68648
68648
  `/api/v1/sessions/${encodeURIComponent(id)}/archive`,
@@ -69345,6 +69345,25 @@ var desktopList = new Command("list").alias("ls").description("list desktop daem
69345
69345
  console.log(`${dot} ${d.machineId.slice(0, 8)} ${host.padEnd(24)} v${ver.padEnd(8)} last-seen ${fmtAgo4(d.lastSeenAt)}`);
69346
69346
  }
69347
69347
  });
69348
+ var desktopDelete = new Command("delete").description("hard-delete a desktop daemon registration. Revokes any tokens stamped with this machine_id (today: clawborrator-supervisor app tokens) and unmanages any sessions whose managed_by_machine_id matches (the session row survives as unmanaged; destroy it separately if you want it gone). Closes the live /supervisor WS if connected.").argument("<machineId>", "desktop machine id (from `claw desktop list`)").option("--yes", "skip the confirmation prompt").action(async (machineId, opts) => {
69349
+ if (!opts.yes) {
69350
+ process.stdout.write(`Hard-delete desktop ${machineId} and revoke its associated tokens? [y/N] `);
69351
+ const answer = await new Promise((res) => {
69352
+ process.stdin.once("data", (d) => res(d.toString().trim().toLowerCase()));
69353
+ });
69354
+ if (answer !== "y" && answer !== "yes") {
69355
+ console.log("cancelled");
69356
+ return;
69357
+ }
69358
+ }
69359
+ const out = await api.delete(
69360
+ `/api/v1/desktops/${encodeURIComponent(machineId)}`
69361
+ );
69362
+ console.log(`\u2713 deleted desktop ${machineId}`);
69363
+ console.log(` tokens revoked: ${out.tokensRevoked}`);
69364
+ console.log(` sessions unmanaged: ${out.sessionsUnmanaged}`);
69365
+ if (out.wsClosed) console.log(` closed the live /supervisor WS`);
69366
+ });
69348
69367
  var desktopCreate = new Command("create-session").description("ask a desktop daemon to spawn a managed CC session in a folder").argument("<machineId>", "desktop machine id (from `claw desktop list`)").argument("<folder>", "absolute path on the desktop where CC should be spawned").option("--routing-name <name>", "optional routing name for the new session (e.g. @frontend)").option("--flag <flag...>", "extra CLI flag to pass to claude. Repeat for multiple. Use one argv slot per --flag (e.g. --flag --model --flag opus, or --flag --model=opus). Reference: https://code.claude.com/docs/en/cli-reference#cli-flags").option("--manual-start", "do NOT auto-press Enter on startup; operator answers prompts via screenshot PIP / `claw session input`").action(async (machineId, folder, opts) => {
69349
69368
  const body = { folder };
69350
69369
  if (opts.routingName) body.routingName = opts.routingName;
@@ -69356,7 +69375,7 @@ var desktopCreate = new Command("create-session").description("ask a desktop dae
69356
69375
  );
69357
69376
  console.log(`\u2713 session created: ${out.sessionId}`);
69358
69377
  });
69359
- var desktopCmd = new Command("desktop").description("inspect + control desktop daemons (clawborrator-supervisor)").addCommand(desktopList).addCommand(desktopCreate);
69378
+ var desktopCmd = new Command("desktop").description("inspect + control desktop daemons (clawborrator-supervisor)").addCommand(desktopList).addCommand(desktopDelete).addCommand(desktopCreate);
69360
69379
  function fmtAgo4(iso) {
69361
69380
  const ms = Date.now() - new Date(iso).getTime();
69362
69381
  if (ms < 6e4) return Math.max(1, Math.floor(ms / 1e3)) + "s ago";
@@ -69367,7 +69386,7 @@ function fmtAgo4(iso) {
69367
69386
 
69368
69387
  // src/index.ts
69369
69388
  var program2 = new Command();
69370
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.2.1");
69389
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.2.5");
69371
69390
  program2.addCommand(loginCmd);
69372
69391
  program2.addCommand(logoutCmd);
69373
69392
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "claw — command-line client for clawborrator. Attach to remote Claude Code sessions, send prompts, resolve permission gates, route across sessions, manage public agents and webhooks. Auth via GitHub OAuth + PKCE.",
6
6
  "license": "MIT",