blun-king-cli 1.5.0 → 1.7.0

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 (2) hide show
  1. package/bin/blun.js +86 -4
  2. package/package.json +1 -1
package/bin/blun.js CHANGED
@@ -17,6 +17,7 @@ const MEMORY_DIR = path.join(CONFIG_DIR, "memory");
17
17
  const SKILLS_DIR = path.join(CONFIG_DIR, "skills");
18
18
  const HISTORY_FILE = path.join(CONFIG_DIR, "history.json");
19
19
  const LOG_FILE = path.join(CONFIG_DIR, "cli.log");
20
+ const PKG_VERSION = (() => { try { return require(path.join(__dirname, "..", "package.json")).version; } catch(e) { return "1.7.0"; } })();
20
21
 
21
22
  if (!fs.existsSync(CONFIG_DIR)) fs.mkdirSync(CONFIG_DIR, { recursive: true });
22
23
  if (!fs.existsSync(MEMORY_DIR)) fs.mkdirSync(MEMORY_DIR, { recursive: true });
@@ -108,7 +109,7 @@ function printHeader() {
108
109
  var line = BOX.h.repeat(w - 4);
109
110
  console.log("");
110
111
  console.log(C.brightBlue + " " + BOX.tl + line + BOX.tr + C.reset);
111
- console.log(C.brightBlue + " " + BOX.v + C.reset + C.bold + C.brightWhite + " " + BOX.bot + " BLUN KING CLI" + C.reset + C.dim + " v1.4" + C.reset + " ".repeat(Math.max(0, w - 24)) + C.brightBlue + BOX.v + C.reset);
112
+ console.log(C.brightBlue + " " + BOX.v + C.reset + C.bold + C.brightWhite + " " + BOX.bot + " BLUN KING CLI" + C.reset + C.dim + " v" + PKG_VERSION + C.reset + " ".repeat(Math.max(0, w - 24)) + C.brightBlue + BOX.v + C.reset);
112
113
  console.log(C.brightBlue + " " + BOX.v + C.reset + C.gray + " Premium KI — Local First — Autonom" + C.reset + " ".repeat(Math.max(0, w - 41)) + C.brightBlue + BOX.v + C.reset);
113
114
  console.log(C.brightBlue + " " + BOX.v + line + BOX.v + C.reset);
114
115
  console.log(C.brightBlue + " " + BOX.v + C.reset + C.gray + " API " + C.brightCyan + config.api.base_url + C.reset + " ".repeat(Math.max(0, w - 14 - config.api.base_url.length)) + C.brightBlue + BOX.v + C.reset);
@@ -1956,6 +1957,78 @@ async function cmdReview() {
1956
1957
  } catch(e) { printError(e.message); }
1957
1958
  }
1958
1959
 
1960
+ // ══════════════════════════════════════════════════
1961
+ // ── SLASH COMMAND MENU (Claude Code style) ──
1962
+ // ══════════════════════════════════════════════════
1963
+ var COMMAND_DESCRIPTIONS = [
1964
+ { cmd: "/help", desc: "Show all commands and shortcuts" },
1965
+ { cmd: "/clear", desc: "Clear chat history" },
1966
+ { cmd: "/compact", desc: "Reduce context window, keep recent messages" },
1967
+ { cmd: "/config", desc: "Manage settings (list, get, set, add, remove)" },
1968
+ { cmd: "/model", desc: "Show or switch the active AI model" },
1969
+ { cmd: "/permissions", desc: "View and manage tool permissions" },
1970
+ { cmd: "/doctor", desc: "Run full system diagnostics (bundled)" },
1971
+ { cmd: "/status", desc: "Show runtime status from API" },
1972
+ { cmd: "/health", desc: "Quick API health check" },
1973
+ { cmd: "/cost", desc: "Show estimated session cost" },
1974
+ { cmd: "/review", desc: "Review current git diff with AI" },
1975
+ { cmd: "/skills", desc: "List all available AI skills/roles" },
1976
+ { cmd: "/search", desc: "Search the web via DuckDuckGo" },
1977
+ { cmd: "/learn", desc: "Teach BLUN King new knowledge" },
1978
+ { cmd: "/generate", desc: "Generate a file from description" },
1979
+ { cmd: "/analyze", desc: "Analyze a website or HTML" },
1980
+ { cmd: "/agent", desc: "Run autonomous multi-step agent loop" },
1981
+ { cmd: "/agents", desc: "Manage subagents (list, create, run, info)" },
1982
+ { cmd: "/screenshot", desc: "Take a Playwright screenshot of a URL" },
1983
+ { cmd: "/render", desc: "Full JS-rendered page capture (Playwright)" },
1984
+ { cmd: "/plugin", desc: "Manage MCP plugins (list, add, remove, run)" },
1985
+ { cmd: "/mcp", desc: "Alias for /plugin" },
1986
+ { cmd: "/hooks", desc: "Manage pre/post command hooks" },
1987
+ { cmd: "/git", desc: "Git commands (status, log, diff, add, commit, push...)" },
1988
+ { cmd: "/ssh", desc: "Manage SSH connections and run remote commands" },
1989
+ { cmd: "/deploy", desc: "Deploy via git, ssh, rsync, or pm2" },
1990
+ { cmd: "/sh", desc: "Run a shell command directly" },
1991
+ { cmd: "/read", desc: "Read a file with line numbers" },
1992
+ { cmd: "/write", desc: "Write or create a file" },
1993
+ { cmd: "/init", desc: "Initialize project (AGENT.md, .gitignore, git)" },
1994
+ { cmd: "/memory", desc: "View, save, or delete local memory entries" },
1995
+ { cmd: "/files", desc: "List files in current workdir" },
1996
+ { cmd: "/settings", desc: "Show current configuration" },
1997
+ { cmd: "/versions", desc: "Show prompt registry versions" },
1998
+ { cmd: "/login", desc: "Login with API key or OAuth" },
1999
+ { cmd: "/logout", desc: "Clear stored credentials" },
2000
+ { cmd: "/eval", desc: "Run the eval test suite" },
2001
+ { cmd: "/watchdog", desc: "Show or toggle watchdog status" },
2002
+ { cmd: "/exit", desc: "Exit the CLI" }
2003
+ ];
2004
+
2005
+ function showSlashMenu(filter) {
2006
+ var filtered = COMMAND_DESCRIPTIONS;
2007
+ if (filter && filter.length > 1) {
2008
+ var f = filter.toLowerCase();
2009
+ filtered = COMMAND_DESCRIPTIONS.filter(function(c) {
2010
+ return c.cmd.includes(f) || c.desc.toLowerCase().includes(f);
2011
+ });
2012
+ }
2013
+ if (filtered.length === 0) return;
2014
+
2015
+ // Show max 8 entries
2016
+ var show = filtered.slice(0, 8);
2017
+ // Move cursor up and print menu
2018
+ var menuLines = [];
2019
+ show.forEach(function(c) {
2020
+ var cmdPad = (c.cmd + " ".repeat(20)).slice(0, 18);
2021
+ menuLines.push(C.dim + " " + C.brightCyan + cmdPad + C.gray + c.desc.slice(0, 55) + C.reset);
2022
+ });
2023
+ if (filtered.length > 8) {
2024
+ menuLines.push(C.dim + " ... " + (filtered.length - 8) + " more" + C.reset);
2025
+ }
2026
+
2027
+ // Print below prompt
2028
+ console.log("");
2029
+ menuLines.forEach(function(l) { console.log(l); });
2030
+ }
2031
+
1959
2032
  // ── Main Loop ──
1960
2033
  async function main() {
1961
2034
  // Handle CLI args
@@ -2073,11 +2146,20 @@ async function main() {
2073
2146
  printError("Memory not found: " + memKey2);
2074
2147
  }
2075
2148
  }
2149
+ // / alone = show menu
2150
+ else if (input === "/") {
2151
+ showSlashMenu("/");
2152
+ }
2076
2153
  // / prefix = command
2077
2154
  else if (input.startsWith("/")) {
2078
- runHook("pre", input.split(/\s+/)[0].slice(1));
2079
- await handleCommand(input);
2080
- runHook("post", input.split(/\s+/)[0].slice(1));
2155
+ // If it's a partial command without space, show filtered menu
2156
+ if (!input.includes(" ") && !ALL_COMMANDS.includes(input)) {
2157
+ showSlashMenu(input);
2158
+ } else {
2159
+ runHook("pre", input.split(/\s+/)[0].slice(1));
2160
+ await handleCommand(input);
2161
+ runHook("post", input.split(/\s+/)[0].slice(1));
2162
+ }
2081
2163
  }
2082
2164
  // plain text = chat
2083
2165
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "BLUN King CLI — Premium KI Console",
5
5
  "bin": {
6
6
  "blun": "./bin/blun.js"