navada-edge-cli 2.2.1 → 2.3.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/README.md +26 -0
- package/lib/agent.js +66 -11
- package/lib/cli.js +4 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,32 @@ An AI-powered terminal agent for the **NAVADA Edge Network**. Full computer acce
|
|
|
6
6
|
npm install -g navada-edge-cli
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
## Executive Summary
|
|
10
|
+
|
|
11
|
+
**NAVADA Edge CLI** is a production-grade terminal tool that gives developers and infrastructure teams an AI agent with full system access, connected to a distributed computing network.
|
|
12
|
+
|
|
13
|
+
**The problem:** Managing distributed infrastructure across multiple cloud providers, on-prem servers, and services requires jumping between terminals, dashboards, and APIs. AI assistants answer questions but can't execute.
|
|
14
|
+
|
|
15
|
+
**The solution:** One CLI that talks naturally, executes commands locally and remotely, and unifies access to your entire infrastructure through a conversational AI agent with 13 built-in tools.
|
|
16
|
+
|
|
17
|
+
**Key differentiators:**
|
|
18
|
+
- **Conversational AI agent** — type naturally, the agent uses tools to execute (not just answer)
|
|
19
|
+
- **Full computer access** — shell, files, processes on your local machine
|
|
20
|
+
- **Distributed network** — 4 physical nodes connected via Tailscale VPN, managed from one terminal
|
|
21
|
+
- **Two sub-agents** — Lucas CTO (infrastructure) and Claude CoS (communications + automation)
|
|
22
|
+
- **Cloud-native** — Cloudflare (R2, Flux AI, Stream, DNS), Azure (n8n), private Docker registry
|
|
23
|
+
- **5 AI models** — Claude Sonnet 4, GPT-4o, Qwen Coder (FREE), YOLO v8, Flux (FREE)
|
|
24
|
+
- **45+ slash commands** — direct access when you need precision
|
|
25
|
+
- **4 themes** — dark, crow (achromatic), matrix, light
|
|
26
|
+
- **Mobile access** — HTTP server with web UI, accessible from phone
|
|
27
|
+
- **Cross-platform** — Windows, macOS, Linux
|
|
28
|
+
- **Docker ready** — run as a container with `docker run -it navada-edge-cli`
|
|
29
|
+
- **Zero config to start** — install, login with any API key, start talking
|
|
30
|
+
|
|
31
|
+
**Who it's for:** DevOps engineers, infrastructure teams, AI developers, and anyone who manages distributed systems and wants an AI copilot in their terminal.
|
|
32
|
+
|
|
33
|
+
**Pricing:** The CLI is free and open source (MIT). AI features require your own API key (Anthropic, OpenAI, or HuggingFace — Qwen is free). Network features require access to a NAVADA Edge Network instance.
|
|
34
|
+
|
|
9
35
|
```
|
|
10
36
|
╭─────────────────────────────────────────────────────────╮
|
|
11
37
|
│ ███╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ █████╗ │
|
package/lib/agent.js
CHANGED
|
@@ -95,7 +95,53 @@ const localTools = {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
// ---------------------------------------------------------------------------
|
|
98
|
-
//
|
|
98
|
+
// Grok (xAI) — free tier for all users (30 RPM, 40K TPM)
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
const GROK_KEY = 'xai-NEmiT3HGX6OoNZ2Xwj5RJtzy1U2AgcDxGrebJbp7dNFCdk9dSF1kEpaoaL6CygcsFYGR3tQuWyhGJAg1';
|
|
101
|
+
const GROK_MODEL = 'grok-3-mini-fast';
|
|
102
|
+
|
|
103
|
+
async function callGrok(messages) {
|
|
104
|
+
const r = await navada.request('https://api.x.ai/v1/chat/completions', {
|
|
105
|
+
method: 'POST',
|
|
106
|
+
body: {
|
|
107
|
+
model: GROK_MODEL,
|
|
108
|
+
messages: [
|
|
109
|
+
{ role: 'system', content: IDENTITY.personality },
|
|
110
|
+
...messages,
|
|
111
|
+
],
|
|
112
|
+
max_tokens: 2048,
|
|
113
|
+
temperature: 0.7,
|
|
114
|
+
},
|
|
115
|
+
headers: {
|
|
116
|
+
'Authorization': `Bearer ${GROK_KEY}`,
|
|
117
|
+
'Content-Type': 'application/json',
|
|
118
|
+
},
|
|
119
|
+
timeout: 30000,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
if (r.status === 429) {
|
|
123
|
+
return {
|
|
124
|
+
content: `You've hit the free tier rate limit (30 requests/min).
|
|
125
|
+
|
|
126
|
+
To continue chatting, add your own API key:
|
|
127
|
+
/login sk-ant-your-anthropic-key (full agent with tool use)
|
|
128
|
+
/login sk-your-openai-key (GPT-4o)
|
|
129
|
+
/init hfToken hf_your_token (Qwen Coder — FREE unlimited)
|
|
130
|
+
|
|
131
|
+
Or wait a minute and try again.`,
|
|
132
|
+
isRateLimit: true,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (r.status !== 200) {
|
|
137
|
+
throw new Error(`Grok API error ${r.status}: ${JSON.stringify(r.data).slice(0, 200)}`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return { content: r.data?.choices?.[0]?.message?.content || '', isRateLimit: false };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
// Anthropic Claude API — conversational agent with tool use
|
|
99
145
|
// ---------------------------------------------------------------------------
|
|
100
146
|
async function chat(userMessage, conversationHistory = []) {
|
|
101
147
|
// Smart key detection — check all possible locations
|
|
@@ -110,8 +156,9 @@ async function chat(userMessage, conversationHistory = []) {
|
|
|
110
156
|
|| (apiKey && apiKey.startsWith('sk-ant') ? apiKey : '')
|
|
111
157
|
|| '';
|
|
112
158
|
|
|
159
|
+
// No personal key — use Grok free tier
|
|
113
160
|
if (!effectiveKey) {
|
|
114
|
-
return
|
|
161
|
+
return grokChat(userMessage, conversationHistory);
|
|
115
162
|
}
|
|
116
163
|
|
|
117
164
|
const tools = [
|
|
@@ -273,8 +320,18 @@ async function executeTool(name, input) {
|
|
|
273
320
|
}
|
|
274
321
|
}
|
|
275
322
|
|
|
323
|
+
async function grokChat(userMessage, conversationHistory = []) {
|
|
324
|
+
const messages = [
|
|
325
|
+
...conversationHistory.slice(-20),
|
|
326
|
+
{ role: 'user', content: userMessage },
|
|
327
|
+
];
|
|
328
|
+
|
|
329
|
+
const result = await callGrok(messages);
|
|
330
|
+
return result.content;
|
|
331
|
+
}
|
|
332
|
+
|
|
276
333
|
async function fallbackChat(msg) {
|
|
277
|
-
// Try MCP → Qwen → OpenAI →
|
|
334
|
+
// Try MCP → Qwen → OpenAI → Grok free tier
|
|
278
335
|
if (navada.config.mcp) {
|
|
279
336
|
try {
|
|
280
337
|
const r = await navada.mcp.call('chat', { message: msg });
|
|
@@ -290,14 +347,12 @@ async function fallbackChat(msg) {
|
|
|
290
347
|
if (navada.config.openaiKey) {
|
|
291
348
|
try { return await navada.ai.openai.chat(msg); } catch {}
|
|
292
349
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
/commands still work without a key — try /help`;
|
|
350
|
+
// Grok is always available as the free fallback
|
|
351
|
+
try {
|
|
352
|
+
const result = await callGrok([{ role: 'user', content: msg }]);
|
|
353
|
+
return result.content;
|
|
354
|
+
} catch {}
|
|
355
|
+
return `All providers failed. Check your internet connection or try again.`;
|
|
301
356
|
}
|
|
302
357
|
|
|
303
358
|
// ---------------------------------------------------------------------------
|
package/lib/cli.js
CHANGED
|
@@ -92,11 +92,10 @@ async function run(argv) {
|
|
|
92
92
|
// Interactive mode — always start. User can /setup if needed.
|
|
93
93
|
showWelcome();
|
|
94
94
|
|
|
95
|
-
//
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
console.log(ui.
|
|
99
|
-
console.log(ui.dim('You can still use /commands. Natural chat requires an API key.'));
|
|
95
|
+
// Show tier info
|
|
96
|
+
const hasPersonalKey = config.getApiKey() || config.get('anthropicKey') || process.env.ANTHROPIC_API_KEY;
|
|
97
|
+
if (!hasPersonalKey) {
|
|
98
|
+
console.log(ui.dim('Free tier active (Grok). /login <your-key> for full agent with tool use.'));
|
|
100
99
|
console.log('');
|
|
101
100
|
}
|
|
102
101
|
|
package/package.json
CHANGED