shiroai 2.0.4 → 2.0.5
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/cli.js +34 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -17,7 +17,18 @@ const c = {
|
|
|
17
17
|
|
|
18
18
|
// ===== CONFIG =====
|
|
19
19
|
const API_URL = 'https://inference.do-ai.run/v1/chat/completions';
|
|
20
|
-
const
|
|
20
|
+
const MODELS = [
|
|
21
|
+
'openai-gpt-oss-120b',
|
|
22
|
+
'anthropic-claude-3.5-sonnet',
|
|
23
|
+
'anthropic-claude-sonnet-4',
|
|
24
|
+
'meta-llama-3.1-405b-instruct',
|
|
25
|
+
'deepseek-r1',
|
|
26
|
+
'deepseek-v3',
|
|
27
|
+
'qwen-2.5-72b-instruct',
|
|
28
|
+
'llama-3.3-70b-instruct',
|
|
29
|
+
'deepseek-r1-distill-llama-70b',
|
|
30
|
+
'mistral-small-3.2-24b-instruct',
|
|
31
|
+
];
|
|
21
32
|
const CWD = process.cwd();
|
|
22
33
|
const CONFIG_DIR = path.join(os.homedir(), '.shiroai');
|
|
23
34
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
@@ -32,6 +43,7 @@ const AGENTS_DIR = path.join(CONFIG_DIR, 'agents');
|
|
|
32
43
|
function loadConfig() { try { return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8')); } catch { return {}; } }
|
|
33
44
|
function saveConfig(cfg) { fs.writeFileSync(CONFIG_FILE, JSON.stringify(cfg, null, 2)); }
|
|
34
45
|
let config = loadConfig();
|
|
46
|
+
let MODEL = config.model || 'openai-gpt-oss-120b';
|
|
35
47
|
|
|
36
48
|
// ===== CLI ARGS =====
|
|
37
49
|
const args = process.argv.slice(2);
|
|
@@ -486,6 +498,10 @@ function header() {
|
|
|
486
498
|
function showHelp() {
|
|
487
499
|
console.log(`${c.bold}Commands:${c.r}`);
|
|
488
500
|
console.log(` ${c.cyan}/help${c.r} Show this help`);
|
|
501
|
+
console.log(` ${c.cyan}/model${c.r} Show current model`);
|
|
502
|
+
console.log(` ${c.cyan}/model list${c.r} List available models`);
|
|
503
|
+
console.log(` ${c.cyan}/model <name>${c.r} Switch model`);
|
|
504
|
+
console.log(` ${c.cyan}/auto${c.r} Use default model`);
|
|
489
505
|
console.log(` ${c.cyan}/context${c.r} Show context info`);
|
|
490
506
|
console.log(` ${c.cyan}/context add <f>${c.r} Add file to context`);
|
|
491
507
|
console.log(` ${c.cyan}/chat save <name>${c.r} Save session`);
|
|
@@ -549,6 +565,23 @@ function prompt() {
|
|
|
549
565
|
return prompt();
|
|
550
566
|
}
|
|
551
567
|
|
|
568
|
+
// Model commands
|
|
569
|
+
if (input === '/model') { console.log(`${c.dim}Current model: ${c.cyan}${MODEL}${c.r}`); return prompt(); }
|
|
570
|
+
if (input === '/model list') {
|
|
571
|
+
console.log(`${c.bold}Available models:${c.r}`);
|
|
572
|
+
MODELS.forEach((m, i) => console.log(` ${m === MODEL ? c.green + '● ' : ' '}${c.cyan}${m}${c.r}`));
|
|
573
|
+
console.log(`\n${c.dim} Use: /model <name>${c.r}`);
|
|
574
|
+
return prompt();
|
|
575
|
+
}
|
|
576
|
+
if (input === '/auto') { MODEL = 'openai-gpt-oss-120b'; config.model = MODEL; saveConfig(config); console.log(`${c.green}✓ Model: ${MODEL} (auto)${c.r}`); return prompt(); }
|
|
577
|
+
if (input.startsWith('/model ')) {
|
|
578
|
+
const name = input.slice(7).trim();
|
|
579
|
+
const match = MODELS.find(m => m.includes(name));
|
|
580
|
+
if (match) { MODEL = match; config.model = MODEL; saveConfig(config); console.log(`${c.green}✓ Model switched: ${MODEL}${c.r}`); }
|
|
581
|
+
else { console.log(`${c.red}Model not found. Use /model list${c.r}`); }
|
|
582
|
+
return prompt();
|
|
583
|
+
}
|
|
584
|
+
|
|
552
585
|
// Regular chat with tool use
|
|
553
586
|
await chat(input);
|
|
554
587
|
prompt();
|