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