bluekiwi 0.3.20 → 0.3.21

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.
@@ -41,6 +41,7 @@ export async function initCommand(options = {}) {
41
41
  // Load existing config for pre-filling prompts
42
42
  const existingCfg = loadConfig() ?? createEmptyConfig();
43
43
  let existingProfile = getProfile(existingCfg, profileName);
44
+ const activeProfile = getProfile(existingCfg, existingCfg.active_profile);
44
45
  let server = normalizeEnvValue(options.server) ??
45
46
  normalizeEnvValue(process.env.BLUEKIWI_API_URL) ??
46
47
  normalizeEnvValue(process.env.BLUEKIWI_SERVER);
@@ -58,21 +59,23 @@ export async function initCommand(options = {}) {
58
59
  existingProfile = getProfile(existingCfg, profileName);
59
60
  }
60
61
  }
61
- if (!isNonInteractive && (server === undefined || apiKey === undefined)) {
62
- const questions = [];
63
- if (server === undefined) {
64
- questions.push({
62
+ if (!isNonInteractive) {
63
+ if (options.server === undefined) {
64
+ const serverAnswer = await prompts({
65
65
  type: "text",
66
66
  name: "server",
67
67
  message: "BlueKiwi server URL",
68
- initial: existingProfile?.profile.server_url,
68
+ initial: existingProfile?.profile.server_url ??
69
+ activeProfile?.profile.server_url ??
70
+ server,
69
71
  });
72
+ server = normalizeEnvValue(serverAnswer.server) ?? server;
70
73
  }
71
74
  if (apiKey === undefined) {
72
75
  const maskedKey = existingProfile?.profile.api_key
73
76
  ? maskApiKey(existingProfile.profile.api_key)
74
77
  : undefined;
75
- questions.push({
78
+ const apiKeyAnswer = await prompts({
76
79
  type: "text",
77
80
  name: "apiKey",
78
81
  message: maskedKey
@@ -80,15 +83,7 @@ export async function initCommand(options = {}) {
80
83
  : "API key (bk_...)",
81
84
  initial: maskedKey,
82
85
  });
83
- }
84
- const answers = await prompts(questions);
85
- server ??= answers.server;
86
- // If user kept the masked key (just pressed Enter), restore original
87
- if (apiKey === undefined) {
88
- const entered = answers.apiKey;
89
- const maskedKey = existingProfile?.profile.api_key
90
- ? maskApiKey(existingProfile.profile.api_key)
91
- : undefined;
86
+ const entered = apiKeyAnswer.apiKey;
92
87
  if (entered && maskedKey && entered === maskedKey) {
93
88
  apiKey = existingProfile.profile.api_key;
94
89
  }
package/dist/index.js CHANGED
@@ -24,41 +24,43 @@ const program = new Command();
24
24
  program
25
25
  .name("bluekiwi")
26
26
  .description("BlueKiwi CLI — connect your agent runtime to a BlueKiwi server")
27
- .version(pkg.version);
27
+ .helpOption("-h, --help", "display help for command")
28
+ .version(pkg.version, "-v, --version", "display version number");
28
29
  program
29
30
  .command("accept <token>")
30
- .requiredOption("--server <url>", "BlueKiwi server URL")
31
- .option("--profile <name>", "Profile name (default: default)")
32
- .option("--username <name>", "Username (non-interactive)")
33
- .option("--password <pass>", "Password (non-interactive)")
31
+ .requiredOption("-s, --server <url>", "BlueKiwi server URL")
32
+ .option("-p, --profile <name>", "Profile name (default: default)")
33
+ .option("-u, --username <name>", "Username (non-interactive)")
34
+ .option("-w, --password <pass>", "Password (non-interactive)")
34
35
  .action(acceptCommand);
35
36
  program
36
37
  .command("init")
37
- .option("--server <url>", "BlueKiwi server URL")
38
- .option("--api-key <key>", "API key (bk_...)")
39
- .option("--profile <name>", "Profile name (default: default)")
40
- .option("--runtime <name>", "Runtime to install into (repeatable, or comma-separated)", collectRuntimes, [])
41
- .option("--yes", "Suppress all prompts (non-interactive)")
38
+ .option("-s, --server <url>", "BlueKiwi server URL")
39
+ .option("-k, --api-key <key>", "API key (bk_...)")
40
+ .option("--apikey <key>", "Alias for --api-key")
41
+ .option("-p, --profile <name>", "Profile name (default: default)")
42
+ .option("-r, --runtime <name>", "Runtime to install into (repeatable, or comma-separated)", collectRuntimes, [])
43
+ .option("-y, --yes", "Suppress all prompts (non-interactive)")
42
44
  .action((opts) => initCommand({
43
45
  server: opts.server,
44
- apiKey: opts.apiKey,
46
+ apiKey: opts.apiKey ?? opts.apikey,
45
47
  runtimes: opts.runtime?.length ? opts.runtime : undefined,
46
48
  profile: opts.profile,
47
49
  yes: opts.yes,
48
50
  }));
49
51
  program
50
52
  .command("status")
51
- .option("--profile <name>", "Profile name (default: active profile)")
53
+ .option("-p, --profile <name>", "Profile name (default: active profile)")
52
54
  .action((opts) => statusCommand(opts.profile));
53
55
  program.command("upgrade").action(upgradeCommand);
54
56
  program
55
57
  .command("logout")
56
- .option("--profile <name>", "Remove only one profile")
58
+ .option("-p, --profile <name>", "Remove only one profile")
57
59
  .action((opts) => logoutCommand(opts.profile));
58
60
  program.command("runtimes").action(runtimesCommand.list);
59
61
  program
60
62
  .command("runtimes:add <name>")
61
- .option("--profile <name>", "Profile to install into runtimes and set active")
63
+ .option("-p, --profile <name>", "Profile to install into runtimes and set active")
62
64
  .action((name, opts) => runtimesCommand.add(name, opts.profile));
63
65
  program.command("runtimes:remove <name>").action(runtimesCommand.remove);
64
66
  program.command("profile").action(profileCommand.list);
@@ -66,6 +68,18 @@ program.command("profile:list").action(profileCommand.list);
66
68
  program.command("profile:use <name>").action(profileCommand.use);
67
69
  program.command("profile:remove <name>").action(profileCommand.remove);
68
70
  program.command("dev-link").action(devLinkCommand);
71
+ program.command("help [command]").action((command) => {
72
+ if (!command) {
73
+ program.outputHelp();
74
+ return;
75
+ }
76
+ const target = program.commands.find((cmd) => cmd.name() === command || cmd.aliases().includes(command));
77
+ if (!target) {
78
+ console.error(`Unknown command '${command}'`);
79
+ process.exit(1);
80
+ }
81
+ target.outputHelp();
82
+ });
69
83
  program.parseAsync(process.argv).catch((err) => {
70
84
  console.error(err.message);
71
85
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluekiwi",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "description": "BlueKiwi CLI — install MCP client and skills into your agent runtime",
5
5
  "license": "MIT",
6
6
  "repository": {