navada-edge-cli 3.5.8 → 3.5.9
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/lib/commands/edge.js +4 -4
- package/lib/commands/setup.js +60 -52
- package/package.json +1 -1
package/lib/commands/edge.js
CHANGED
|
@@ -100,10 +100,10 @@ module.exports = function(reg) {
|
|
|
100
100
|
console.log(ui.label('User', r.data.name || r.data.userId || 'connected'));
|
|
101
101
|
console.log('');
|
|
102
102
|
console.log(ui.dim('You now have access to:'));
|
|
103
|
-
console.log(ui.dim(' /
|
|
104
|
-
console.log(ui.dim(' /
|
|
105
|
-
console.log(ui.dim(' /
|
|
106
|
-
console.log(ui.dim(' /
|
|
103
|
+
console.log(ui.dim(' /offload — run tasks 24/7 on cloud'));
|
|
104
|
+
console.log(ui.dim(' /sessions — view running tasks'));
|
|
105
|
+
console.log(ui.dim(' /attach — stream task output'));
|
|
106
|
+
console.log(ui.dim(' /kill — stop a task'));
|
|
107
107
|
validated = true;
|
|
108
108
|
break;
|
|
109
109
|
} else if (r.status === 401) {
|
package/lib/commands/setup.js
CHANGED
|
@@ -4,13 +4,14 @@ const readline = require('readline');
|
|
|
4
4
|
const navada = require('navada-edge-sdk');
|
|
5
5
|
const ui = require('../ui');
|
|
6
6
|
const config = require('../config');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
7
9
|
|
|
8
10
|
function ask(rl, question) {
|
|
9
11
|
return new Promise(resolve => rl.question(question, resolve));
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
async function runSetup(fromRepl = false) {
|
|
13
|
-
// Create a fresh readline — don't conflict with the REPL
|
|
14
15
|
const rl = readline.createInterface({
|
|
15
16
|
input: process.stdin,
|
|
16
17
|
output: process.stdout,
|
|
@@ -18,80 +19,87 @@ async function runSetup(fromRepl = false) {
|
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
console.log('');
|
|
21
|
-
console.log(ui.box('SETUP', '
|
|
22
|
+
console.log(ui.box('NAVADA EDGE SETUP', ' Let\'s configure your CLI in under a minute.'));
|
|
22
23
|
console.log('');
|
|
23
24
|
|
|
24
|
-
// 1. API Key
|
|
25
|
-
console.log(ui.dim('
|
|
26
|
-
console.log(ui.dim('
|
|
27
|
-
console.log(ui.dim('
|
|
28
|
-
console.log(ui.dim(' - OpenAI key (sk-...)'));
|
|
29
|
-
console.log(ui.dim(' - Or press Enter to skip (limited mode)'));
|
|
25
|
+
// 1. API Key
|
|
26
|
+
console.log(ui.dim(' Add an AI API key for full agent capabilities.'));
|
|
27
|
+
console.log(ui.dim(' Supported: OpenAI (sk-...), Anthropic (sk-ant-...), Gemini (AIza...)'));
|
|
28
|
+
console.log(ui.dim(' Or press Enter to use the free tier (Grok, limited).'));
|
|
30
29
|
console.log('');
|
|
31
30
|
|
|
32
31
|
const apiKey = await ask(rl, ' API key: ');
|
|
33
32
|
if (apiKey.trim()) {
|
|
34
33
|
const key = apiKey.trim();
|
|
35
|
-
config.setApiKey(key);
|
|
36
|
-
// Auto-detect key type and save to right field
|
|
37
34
|
if (key.startsWith('sk-ant')) {
|
|
38
35
|
config.set('anthropicKey', key);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
config.setApiKey(key);
|
|
37
|
+
console.log(ui.success('Anthropic key saved. Full agent mode with tool use enabled.'));
|
|
38
|
+
} else if (key.startsWith('AIza')) {
|
|
39
|
+
config.set('geminiKey', key);
|
|
40
|
+
console.log(ui.success('Gemini key saved. Free unlimited access.'));
|
|
42
41
|
} else if (key.startsWith('sk-')) {
|
|
43
42
|
config.set('openaiKey', key);
|
|
44
|
-
|
|
45
|
-
console.log(ui.success('OpenAI key saved'));
|
|
43
|
+
config.setApiKey(key);
|
|
44
|
+
console.log(ui.success('OpenAI key saved. GPT-4o with tool use enabled.'));
|
|
45
|
+
} else if (key.startsWith('nvapi-')) {
|
|
46
|
+
config.set('nvidiaKey', key);
|
|
47
|
+
console.log(ui.success('NVIDIA key saved. Llama, Mistral, DeepSeek enabled.'));
|
|
48
|
+
} else if (key.startsWith('hf_')) {
|
|
49
|
+
config.set('hfToken', key);
|
|
50
|
+
console.log(ui.success('HuggingFace key saved. Qwen Coder enabled.'));
|
|
46
51
|
} else {
|
|
47
|
-
|
|
52
|
+
config.setApiKey(key);
|
|
53
|
+
console.log(ui.success('Key saved.'));
|
|
48
54
|
}
|
|
49
55
|
} else {
|
|
50
|
-
console.log(ui.dim('Skipped
|
|
56
|
+
console.log(ui.dim(' Skipped. Free tier active. Add a key anytime with /login <key>'));
|
|
51
57
|
}
|
|
52
58
|
console.log('');
|
|
53
59
|
|
|
54
|
-
// 2.
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
config.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
60
|
+
// 2. Theme
|
|
61
|
+
const theme = await ask(rl, ' Theme (dark/crow/matrix/light) [dark]: ');
|
|
62
|
+
config.setTheme(theme.trim() || 'dark');
|
|
63
|
+
console.log('');
|
|
64
|
+
|
|
65
|
+
// 3. Create agent.md
|
|
66
|
+
const agentMd = path.join(config.CONFIG_DIR, 'agent.md');
|
|
67
|
+
if (!fs.existsSync(agentMd)) {
|
|
68
|
+
const createAgent = await ask(rl, ' Create agent.md for custom AI personality? (Y/n): ');
|
|
69
|
+
if (createAgent.trim().toLowerCase() !== 'n') {
|
|
70
|
+
if (!fs.existsSync(config.CONFIG_DIR)) fs.mkdirSync(config.CONFIG_DIR, { recursive: true });
|
|
71
|
+
fs.writeFileSync(agentMd, `# My NAVADA Agent
|
|
72
|
+
|
|
73
|
+
## About Me
|
|
74
|
+
<!-- Tell the agent who you are and what you work on -->
|
|
75
|
+
I am a developer working on...
|
|
76
|
+
|
|
77
|
+
## Preferences
|
|
78
|
+
<!-- How should the agent behave? -->
|
|
79
|
+
- Be concise and technical
|
|
80
|
+
- Always explain before making changes
|
|
81
|
+
- Prefer TypeScript for new code
|
|
82
|
+
|
|
83
|
+
## My Stack
|
|
84
|
+
<!-- What tools and tech do you use? -->
|
|
85
|
+
- ...
|
|
86
|
+
`);
|
|
87
|
+
console.log(ui.success('Created ~/.navada/agent.md'));
|
|
88
|
+
console.log(ui.dim(' Edit this file to personalise your agent.'));
|
|
81
89
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
console.log(ui.success('Nodes configured'));
|
|
90
|
+
} else {
|
|
91
|
+
console.log(ui.dim(' agent.md already exists.'));
|
|
85
92
|
}
|
|
86
93
|
console.log('');
|
|
87
94
|
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
// 4. Cloud compute (optional)
|
|
96
|
+
console.log(ui.dim(' Want 24/7 cloud compute? Sign up at portal.navada-edge-server.uk'));
|
|
97
|
+
console.log(ui.dim(' Generate an API key, then run: /edge login nv_edge_your_key'));
|
|
91
98
|
console.log('');
|
|
92
99
|
|
|
93
|
-
//
|
|
94
|
-
|
|
100
|
+
// Done
|
|
101
|
+
const pkg = require('../../package.json');
|
|
102
|
+
console.log(ui.box('READY', ` NAVADA Edge CLI v${pkg.version}\n Config: ${config.CONFIG_FILE}\n\n Type naturally to chat, or /help for commands.`));
|
|
95
103
|
console.log('');
|
|
96
104
|
|
|
97
105
|
rl.close();
|
package/package.json
CHANGED