navada-edge-cli 2.2.0 → 2.2.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.
Files changed (2) hide show
  1. package/lib/registry.js +32 -1
  2. package/package.json +1 -1
package/lib/registry.js CHANGED
@@ -59,7 +59,38 @@ async function execute(input) {
59
59
  return;
60
60
  }
61
61
 
62
- // No slash — treat as natural language route to AI agent
62
+ // No slash — check if first word is a known command anyway
63
+ const firstWord = trimmed.split(/\s+/)[0].toLowerCase();
64
+ const restArgs = trimmed.split(/\s+/).slice(1);
65
+
66
+ // Check built-in commands (login, setup, status, etc.)
67
+ if (commands[firstWord]) {
68
+ try {
69
+ await commands[firstWord].handler(restArgs);
70
+ } catch (e) {
71
+ const ui = require('./ui');
72
+ console.log(ui.error(e.message));
73
+ }
74
+ return;
75
+ }
76
+
77
+ // Check user aliases
78
+ const userAliases = config.getAliases();
79
+ if (userAliases[firstWord]) {
80
+ const expanded = userAliases[firstWord].split(/\s+/);
81
+ const aliasCmd = commands[expanded[0]];
82
+ if (aliasCmd) {
83
+ try {
84
+ await aliasCmd.handler([...expanded.slice(1), ...restArgs]);
85
+ } catch (e) {
86
+ const ui = require('./ui');
87
+ console.log(ui.error(e.message));
88
+ }
89
+ return;
90
+ }
91
+ }
92
+
93
+ // Not a command — treat as natural language → route to AI agent
63
94
  try {
64
95
  await commands['chat'].handler(trimmed.split(/\s+/));
65
96
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "navada-edge-cli",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Interactive CLI for the NAVADA Edge Network — explore nodes, agents, Cloudflare, AI, Docker, and MCP from your terminal",
5
5
  "main": "lib/cli.js",
6
6
  "bin": {