@keyban/cli 0.4.5 → 0.5.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
@@ -66,7 +66,7 @@ keyban wallet --help
66
66
  With Claude Code:
67
67
 
68
68
  ```bash
69
- claude mcp add agent-wallet -- npx -y @keyban/cli@latest mcp
69
+ claude mcp add keyban-agent-wallet -- npx -y @keyban/cli@latest mcp
70
70
  ```
71
71
 
72
72
  On first boot the server runs a key generation, keeps its share in the wallet's
package/dist/index.mjs CHANGED
@@ -156501,15 +156501,27 @@ function windowsNpx(env = process.env) {
156501
156501
  }
156502
156502
  function register(client) {
156503
156503
  const npx = windowsNpx();
156504
- const server = npx ? `"${npx.node}" "${npx.npxCli}" -y @keyban/cli@latest mcp` : SERVER;
156505
- const args = ["-y", "--package=install-mcp", "install-mcp", server, "--name", "agent-wallet", "--client", client, "--yes"];
156504
+ const server = npx ? `${npx.node} ${npx.npxCli} -y @keyban/cli@latest mcp` : SERVER;
156505
+ const args = ["-y", "--package=install-mcp", "install-mcp", server, "--name", "keyban-agent-wallet", "--client", client, "--yes"];
156506
156506
  const stdio = ["ignore", 2, 2];
156507
156507
  const run = npx ? spawnSync2(npx.node, [npx.npxCli, ...args], { stdio }) : process.platform === "win32" ? spawnSync2(["npx", ...args.map((arg) => `"${arg}"`)].join(" "), { shell: true, stdio }) : spawnSync2("npx", args, { stdio });
156508
156508
  if (run.status !== 0) throw new Error(`install-mcp exited ${run.status ?? run.signal}: the MCP server is not registered.`);
156509
156509
  }
156510
+ function walletLabel(id) {
156511
+ try {
156512
+ const { name } = findWallet(id);
156513
+ return name ? `${name} (${id})` : id;
156514
+ } catch {
156515
+ return id;
156516
+ }
156517
+ }
156518
+ function runWalletTool(tool) {
156519
+ const run = spawnSync2(process.execPath, [process.argv[1], "wallet", tool], { stdio: ["ignore", 1, 2] });
156520
+ if (run.status !== 0) throw new Error(`keyban wallet ${tool} exited ${run.status ?? run.signal}.`);
156521
+ }
156510
156522
  function setupCommand() {
156511
156523
  return new Command("setup").description(
156512
- "Install a wallet for an agent: log in, keep the wallet as `keyban wallet import --wallet-id` does, and register `keyban mcp` as the agent-wallet MCP server of the agent, with install-mcp"
156524
+ "Install a wallet for an agent: log in, keep the wallet as `keyban wallet import --wallet-id` does, and register `keyban mcp` as the keyban-agent-wallet MCP server of the agent, with install-mcp"
156513
156525
  ).requiredOption("--wallet-id <id>", "the wallet to install, as the dashboard names it").requiredOption("--client <client>", "the agent, as install-mcp names it: codex, claude-code, cursor\u2026").option("--api <env|url>", "the Keyban API the wallet lives on", defaultApi()).option("--force", "overwrite the wallet file there, losing its client share").action(async (options) => {
156514
156526
  try {
156515
156527
  const api = resolveURL(options.api);
@@ -156521,11 +156533,19 @@ function setupCommand() {
156521
156533
  `);
156522
156534
  process.stdout.write(`Using ${await importWalletSigner(api, options.walletId, process.env, options.force)}
156523
156535
  `);
156524
- process.stderr.write(`Registering agent-wallet for ${options.client} with npx install-mcp\u2026
156536
+ process.stderr.write(`Registering keyban-agent-wallet for ${options.client} with npx install-mcp\u2026
156525
156537
  `);
156526
156538
  register(options.client);
156527
- process.stdout.write(`Registered agent-wallet for ${options.client}: open a new conversation to use it.
156539
+ process.stdout.write(`Registered keyban-agent-wallet for ${options.client}.
156528
156540
  `);
156541
+ process.stderr.write("Activating the wallet: its first call generates its signing key (a few seconds)\u2026\n");
156542
+ process.stdout.write(`Wallet: ${walletLabel(options.walletId)}
156543
+ `);
156544
+ runWalletTool("get-account-info");
156545
+ runWalletTool("balance");
156546
+ process.stdout.write(
156547
+ "To go further (funding, payments, approvals), open a new conversation: this one loaded its MCP servers before keyban-agent-wallet was registered.\n"
156548
+ );
156529
156549
  } catch (error2) {
156530
156550
  reportCommandFailed("setup", error2);
156531
156551
  process.stderr.write(`Error: ${error2 instanceof Error ? error2.message : String(error2)}
@@ -156536,7 +156556,7 @@ function setupCommand() {
156536
156556
  }
156537
156557
 
156538
156558
  // src/index.ts
156539
- var VERSION5 = true ? "0.4.5" : "0.0.0";
156559
+ var VERSION5 = true ? "0.5.1" : "0.0.0";
156540
156560
  if (process.argv[2] !== "mcp" && !process.env.MCP_LOG_LEVEL) logger.setMinLevel("error");
156541
156561
  function typedArgv(argv) {
156542
156562
  if (argv[2] !== "__complete") return argv;