blun-king-cli 7.0.2 → 7.0.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.
Files changed (3) hide show
  1. package/lib/chat.js +50 -16
  2. package/lib/ui.js +16 -5
  3. package/package.json +1 -1
package/lib/chat.js CHANGED
@@ -15,6 +15,7 @@ var permissionMode = "normal"; // safe, normal, god
15
15
 
16
16
  function showPrompt(rl, username, model) {
17
17
  ui.setCurrentPerm(permissionMode);
18
+ ui.renderInputBox(username, model, permissionMode);
18
19
  rl.prompt();
19
20
  }
20
21
 
@@ -242,26 +243,59 @@ function startChat() {
242
243
  }
243
244
 
244
245
  if (input === "/help") {
245
- ui.renderBox(
246
- "Chat Commands",
247
- [
248
- "/exit Exit chat",
249
- "/clear Clear screen",
250
- "/status Show token usage & uptime",
251
- "/login Login from chat",
252
- "/whoami Show current user info",
253
- "/keys List API keys",
254
- "/model Switch AI model",
255
- "/settings Show/change settings",
256
- "/perm Cycle permission mode (safe/normal/god)",
257
- "/help Show this help",
258
- ].join("\n"),
259
- "cyan"
260
- );
246
+ console.log(chalk.bold.cyan("\n Commands:\n"));
247
+ var helpLines = [
248
+ ["/exit", "Exit chat"],
249
+ ["/clear", "Clear screen"],
250
+ ["/status", "Show token usage & uptime"],
251
+ ["/login", "Login from chat"],
252
+ ["/whoami", "Show current user info"],
253
+ ["/keys", "List API keys"],
254
+ ["/model", "Switch AI model"],
255
+ ["/settings", "Show/change settings"],
256
+ ["/perm", "Cycle permission mode (safe/normal/god)"],
257
+ ["/help", "Show this help"],
258
+ ];
259
+ helpLines.forEach(function (h) {
260
+ console.log(" " + chalk.green(h[0]) + " ".repeat(14 - h[0].length) + chalk.dim(h[1]));
261
+ });
262
+ console.log();
261
263
  showPrompt(rl, username, model);
262
264
  return;
263
265
  }
264
266
 
267
+ // Slash command picker - type just "/" to open interactive menu
268
+ if (input === "/") {
269
+ var inquirer = require("inquirer");
270
+ inquirer.prompt([{
271
+ type: "list",
272
+ name: "cmd",
273
+ message: chalk.cyan("Select command"),
274
+ choices: [
275
+ { name: chalk.green("/model") + chalk.dim(" Switch AI model"), value: "/model" },
276
+ { name: chalk.green("/settings") + chalk.dim(" Show/change settings"), value: "/settings" },
277
+ { name: chalk.green("/perm") + chalk.dim(" Cycle permission mode"), value: "/perm" },
278
+ { name: chalk.green("/status") + chalk.dim(" Token usage & uptime"), value: "/status" },
279
+ { name: chalk.green("/whoami") + chalk.dim(" Current user info"), value: "/whoami" },
280
+ { name: chalk.green("/keys") + chalk.dim(" List API keys"), value: "/keys" },
281
+ { name: chalk.green("/login") + chalk.dim(" Login from chat"), value: "/login" },
282
+ { name: chalk.green("/clear") + chalk.dim(" Clear screen"), value: "/clear" },
283
+ { name: chalk.green("/help") + chalk.dim(" Show all commands"), value: "/help" },
284
+ new inquirer.Separator(),
285
+ { name: chalk.red("/exit") + chalk.dim(" Exit chat"), value: "/exit" },
286
+ { name: chalk.dim("Cancel"), value: "" },
287
+ ],
288
+ pageSize: 12,
289
+ }]).then(function (ans) {
290
+ if (ans.cmd) {
291
+ rl.emit("line", ans.cmd);
292
+ } else {
293
+ showPrompt(rl, username, model);
294
+ }
295
+ });
296
+ return;
297
+ }
298
+
265
299
  // Send message
266
300
  if (localMode) {
267
301
  ui.renderResponse(
package/lib/ui.js CHANGED
@@ -60,20 +60,31 @@ function getInputBoxWidth() {
60
60
  }
61
61
 
62
62
  function renderInputBox(username, model, permMode) {
63
- // Claude Code style - no box, just clean space
63
+ var w = getInputBoxWidth();
64
+ var pm = permMode || currentPermMode || "normal";
65
+ var label = permissionLabels[pm] || permissionLabels.normal;
66
+ var modelTag = chalk.bgCyan.black(" " + (model || "auto") + " ");
67
+ var info = modelTag + chalk.dim(" | ") + label;
68
+ console.log(chalk.green("\u256d\u2500") + chalk.green.bold(" BLUN ") + chalk.green("\u2500".repeat(Math.max(2, w - 10))) + chalk.green("\u256e"));
64
69
  }
65
70
 
66
71
  var currentPermMode = "normal";
67
72
  function setCurrentPerm(pm) { currentPermMode = pm; }
68
73
 
69
74
  function renderInputBoxClose() {
70
- // Show permission line after input (like Claude Code)
71
- var label = permissionLabels[currentPermMode] || permissionLabels.normal;
72
- console.log(chalk.dim(" \u276f\u276f ") + chalk.dim("bypass permissions ") + label + chalk.dim(" (shift+tab to cycle)"));
75
+ var w = getInputBoxWidth();
76
+ var pm = currentPermMode || "normal";
77
+ var label = permissionLabels[pm] || permissionLabels.normal;
78
+ var stats = getStats();
79
+ var elapsed = Math.floor(stats.uptime / 1000);
80
+ var mins = Math.floor(elapsed / 60);
81
+ var secs = elapsed % 60;
82
+ var infoLine = label + chalk.dim(" | Tokens: " + totalTokens.toLocaleString() + " | " + mins + "m " + secs + "s");
83
+ console.log(chalk.green("\u2570") + chalk.green("\u2500") + chalk.dim(" ") + infoLine + chalk.dim(" ") + chalk.green("\u2500".repeat(Math.max(2, w - 40))) + chalk.green("\u256f"));
73
84
  }
74
85
 
75
86
  function renderPrompt() {
76
- return chalk.bold.green("> ");
87
+ return chalk.green("\u2502 ") + chalk.bold.green("> ");
77
88
  }
78
89
 
79
90
  function renderPermissionLine(permMode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
4
4
  "description": "BLUN AI Assistant - Command Line Interface",
5
5
  "bin": {
6
6
  "blun": "./bin/blun.js"