clawborrator-cli 0.0.4 → 0.0.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.
@@ -7207,7 +7207,9 @@ var sessionInit = new Command("init").description("install clawborrator hooks in
7207
7207
  if (refreshed > 0) console.log(`\u2713 refreshed ${refreshed} command line${refreshed === 1 ? "" : "s"} (e.g. updated to call the local file)`);
7208
7208
  if (alreadyPresent > 0) console.log(` (${alreadyPresent} already up-to-date, untouched)`);
7209
7209
  console.log("");
7210
- console.log("next: drop a .mcp.json with your channel token, then run `claude` in this dir.");
7210
+ console.log("next: drop a .mcp.json with your channel token (`claw token mint --kind=channel");
7211
+ console.log(" --name=<label> --mcp-snippet --out=.mcp.json`), then start CC with:");
7212
+ console.log(" claude --dangerously-load-development-channels server:clawborrator");
7211
7213
  console.log(" events will flow as you prompt; watch via `claw session attach <id>`.");
7212
7214
  });
7213
7215
  function removeHooks(settingsPath, hookFile) {
@@ -7360,6 +7362,10 @@ var sessionMessages = new Command("messages").alias("msgs").description("dump op
7360
7362
  });
7361
7363
  var sessionCmd = new Command("session").description("manage Claude Code sessions registered with this hub").addCommand(sessionList).addCommand(sessionInfo).addCommand(sessionAttach).addCommand(sessionInit).addCommand(sessionEvents).addCommand(sessionMessages);
7362
7364
 
7365
+ // src/commands/token.ts
7366
+ var import_node_fs3 = require("node:fs");
7367
+ var import_node_path3 = require("node:path");
7368
+
7363
7369
  // ../shared/dist/scopes.js
7364
7370
  var ALL_SCOPES = [
7365
7371
  "me:read",
@@ -7391,17 +7397,18 @@ var CLI_DEFAULT_SCOPES = [
7391
7397
  ];
7392
7398
 
7393
7399
  // src/commands/token.ts
7394
- var tokenMint = new Command("mint").description("create a new token").requiredOption("--kind <kind>", "channel | pat").requiredOption("--name <name>", 'human-readable label (e.g. "alice-laptop")').option("--scopes <csv>", "comma-separated scopes (PAT only); default = sensible CLI set").option("--app <name>", "pin the PAT to a specific app (display only)").option("--mcp-snippet", "after minting a channel token, print ONLY the .mcp.json block to stdout (prose to stderr) so you can pipe it: `... --mcp-snippet > .mcp.json`").action(async (opts) => {
7400
+ var tokenMint = new Command("mint").description("create a new token").requiredOption("--kind <kind>", "channel | pat").requiredOption("--name <name>", 'human-readable label (e.g. "alice-laptop")').option("--scopes <csv>", "comma-separated scopes (PAT only); default = sensible CLI set").option("--app <name>", "pin the PAT to a specific app (display only)").option("--mcp-snippet", "after minting a channel token, also produce a ready-to-use .mcp.json block. By default writes to stdout (prose to stderr); pair with --out=<path> to write the file directly (recommended on Windows \u2014 `>` redirection in PowerShell encodes as UTF-16 w/ BOM, which CC rejects).").option("--out <path>", "when used with --mcp-snippet, write the JSON to <path> (UTF-8, no BOM) instead of stdout. Pass `.mcp.json` for the canonical project location.").action(async (opts) => {
7395
7401
  if (opts.kind === "channel") {
7396
7402
  const out = await api.post("/api/v1/tokens/channel", { name: opts.name });
7397
- const prose = opts.mcpSnippet ? console.error : console.log;
7403
+ const proseToStderr = opts.mcpSnippet && !opts.out;
7404
+ const prose = proseToStderr ? console.error : console.log;
7398
7405
  prose(`\u2713 channel token minted: ${out.name}`);
7399
7406
  prose(` ${out.token}`);
7400
7407
  prose(" (shown ONCE \u2014 store it now)");
7401
7408
  if (opts.mcpSnippet) {
7402
7409
  const cfg = loadConfig();
7403
7410
  const wsUrl = cfg.hubUrl.replace(/^http(s?):\/\//, "ws$1://");
7404
- process.stdout.write(JSON.stringify({
7411
+ const json = JSON.stringify({
7405
7412
  mcpServers: {
7406
7413
  clawborrator: {
7407
7414
  command: "npx",
@@ -7412,7 +7419,18 @@ var tokenMint = new Command("mint").description("create a new token").requiredOp
7412
7419
  }
7413
7420
  }
7414
7421
  }
7415
- }, null, 2) + "\n");
7422
+ }, null, 2) + "\n";
7423
+ if (opts.out) {
7424
+ const target = (0, import_node_path3.resolve)(opts.out);
7425
+ (0, import_node_fs3.writeFileSync)(target, json, "utf8");
7426
+ prose("");
7427
+ prose(`\u2713 wrote ${target}`);
7428
+ } else {
7429
+ process.stdout.write(json);
7430
+ }
7431
+ prose("");
7432
+ prose(" next: launch CC with the clawborrator channel enabled \u2014");
7433
+ prose(" claude --dangerously-load-development-channels server:clawborrator");
7416
7434
  }
7417
7435
  return;
7418
7436
  }
@@ -7550,7 +7568,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
7550
7568
 
7551
7569
  // src/index.ts
7552
7570
  var program2 = new Command();
7553
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.4");
7571
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.6");
7554
7572
  program2.addCommand(loginCmd);
7555
7573
  program2.addCommand(logoutCmd);
7556
7574
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "claw — command-line client for clawborrator hub_v1. Manages PATs, channel tokens, sessions, cross-session routing, and webhooks; ships an inline TUI for live multi-operator session attach.",
6
6
  "license": "MIT",