@xelauvas/xela-cli 0.1.0 → 0.1.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.
- package/README.md +2 -2
- package/bin/xela.cmd +72 -0
- package/bin/xela.js +81 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ AI coding assistant that works with **any model** — free or paid. Use OpenRout
|
|
|
12
12
|
|
|
13
13
|
**npm (recommended):**
|
|
14
14
|
```bash
|
|
15
|
-
npm install -g xela-cli
|
|
15
|
+
npm install -g @xelauvas/xela-cli
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
**One-liner:**
|
|
@@ -186,7 +186,7 @@ ollama pull deepseek-v3.2
|
|
|
186
186
|
|
|
187
187
|
```bash
|
|
188
188
|
# npm install
|
|
189
|
-
npm uninstall -g xela-cli
|
|
189
|
+
npm uninstall -g @xelauvas/xela-cli
|
|
190
190
|
|
|
191
191
|
# curl install
|
|
192
192
|
curl -fsSL https://raw.githubusercontent.com/xelauvas/codeclau/main/uninstall.sh | bash
|
package/bin/xela.cmd
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal
|
|
3
|
+
|
|
4
|
+
set "XELA_HOME=%USERPROFILE%\.xela"
|
|
5
|
+
set "XELA_CONFIG=%XELA_HOME%\config.cmd"
|
|
6
|
+
set "INSTALL_DIR=%~dp0.."
|
|
7
|
+
|
|
8
|
+
:: Create config on first run
|
|
9
|
+
if not exist "%XELA_CONFIG%" (
|
|
10
|
+
mkdir "%XELA_HOME%" 2>nul
|
|
11
|
+
(
|
|
12
|
+
echo @echo off
|
|
13
|
+
echo :: Xela Configuration
|
|
14
|
+
echo :: Provider: openrouter, groq, ollama, deepseek, openai, cerebras, sambanova
|
|
15
|
+
echo set "XELA_PROVIDER=openrouter"
|
|
16
|
+
echo.
|
|
17
|
+
echo :: API Key
|
|
18
|
+
echo set "OPENAI_API_KEY=sk-or-your-key-here"
|
|
19
|
+
echo.
|
|
20
|
+
echo :: Model ^(auto-detected from provider if not set^)
|
|
21
|
+
echo :: set "OPENAI_MODEL=qwen/qwen3.6-plus-preview:free"
|
|
22
|
+
echo.
|
|
23
|
+
echo :: Base URL ^(auto-detected from provider if not set^)
|
|
24
|
+
echo :: set "OPENAI_BASE_URL=https://openrouter.ai/api/v1"
|
|
25
|
+
) > "%XELA_CONFIG%"
|
|
26
|
+
echo.
|
|
27
|
+
echo Welcome to Xela!
|
|
28
|
+
echo Config created at %XELA_CONFIG%
|
|
29
|
+
echo Edit it: notepad %XELA_CONFIG%
|
|
30
|
+
echo.
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
:: Load config
|
|
34
|
+
call "%XELA_CONFIG%"
|
|
35
|
+
|
|
36
|
+
:: Auto-detect base URL
|
|
37
|
+
if not defined OPENAI_BASE_URL (
|
|
38
|
+
if "%XELA_PROVIDER%"=="openrouter" set "OPENAI_BASE_URL=https://openrouter.ai/api/v1"
|
|
39
|
+
if "%XELA_PROVIDER%"=="groq" set "OPENAI_BASE_URL=https://api.groq.com/openai/v1"
|
|
40
|
+
if "%XELA_PROVIDER%"=="ollama" set "OPENAI_BASE_URL=http://localhost:11434/v1"
|
|
41
|
+
if "%XELA_PROVIDER%"=="deepseek" set "OPENAI_BASE_URL=https://api.deepseek.com"
|
|
42
|
+
if "%XELA_PROVIDER%"=="cerebras" set "OPENAI_BASE_URL=https://api.cerebras.ai/v1"
|
|
43
|
+
if "%XELA_PROVIDER%"=="sambanova" set "OPENAI_BASE_URL=https://api.sambanova.ai/v1"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
:: Auto-detect model
|
|
47
|
+
if not defined OPENAI_MODEL (
|
|
48
|
+
if "%XELA_PROVIDER%"=="openrouter" set "OPENAI_MODEL=qwen/qwen3.6-plus-preview:free"
|
|
49
|
+
if "%XELA_PROVIDER%"=="groq" set "OPENAI_MODEL=qwen-qwq-32b"
|
|
50
|
+
if "%XELA_PROVIDER%"=="ollama" set "OPENAI_MODEL=qwen2.5-coder:7b"
|
|
51
|
+
if "%XELA_PROVIDER%"=="deepseek" set "OPENAI_MODEL=deepseek-chat"
|
|
52
|
+
if "%XELA_PROVIDER%"=="openai" set "OPENAI_MODEL=gpt-4o"
|
|
53
|
+
if "%XELA_PROVIDER%"=="cerebras" set "OPENAI_MODEL=llama-3.3-70b"
|
|
54
|
+
if "%XELA_PROVIDER%"=="sambanova" set "OPENAI_MODEL=Meta-Llama-3.3-70B-Instruct"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
:: Handle -m flag
|
|
58
|
+
:parse_args
|
|
59
|
+
if "%~1"=="-m" (
|
|
60
|
+
set "OPENAI_MODEL=%~2"
|
|
61
|
+
shift
|
|
62
|
+
shift
|
|
63
|
+
goto :parse_args
|
|
64
|
+
)
|
|
65
|
+
if "%~1"=="--model" (
|
|
66
|
+
set "OPENAI_MODEL=%~2"
|
|
67
|
+
shift
|
|
68
|
+
shift
|
|
69
|
+
goto :parse_args
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
node --import "%INSTALL_DIR%\src\_shims\register.js" "%INSTALL_DIR%\start.js" %*
|
package/bin/xela.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFileSync, execSync } from 'child_process';
|
|
3
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { homedir } from 'os';
|
|
7
|
+
|
|
8
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
9
|
+
const INSTALL_DIR = join(__dirname, '..');
|
|
10
|
+
const XELA_HOME = join(homedir(), '.xela');
|
|
11
|
+
const XELA_CONFIG = join(XELA_HOME, 'config.json');
|
|
12
|
+
|
|
13
|
+
// Create config on first run
|
|
14
|
+
if (!existsSync(XELA_CONFIG)) {
|
|
15
|
+
mkdirSync(XELA_HOME, { recursive: true });
|
|
16
|
+
writeFileSync(XELA_CONFIG, JSON.stringify({
|
|
17
|
+
provider: 'openrouter',
|
|
18
|
+
apiKey: 'sk-or-your-key-here',
|
|
19
|
+
model: '',
|
|
20
|
+
baseUrl: '',
|
|
21
|
+
}, null, 2));
|
|
22
|
+
console.log('');
|
|
23
|
+
console.log(' Welcome to Xela!');
|
|
24
|
+
console.log(` Config created at ${XELA_CONFIG}`);
|
|
25
|
+
console.log(` Edit it to add your API key`);
|
|
26
|
+
console.log('');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Load config
|
|
30
|
+
let config = {};
|
|
31
|
+
try {
|
|
32
|
+
config = JSON.parse(readFileSync(XELA_CONFIG, 'utf-8'));
|
|
33
|
+
} catch {}
|
|
34
|
+
|
|
35
|
+
const provider = config.provider || 'openrouter';
|
|
36
|
+
|
|
37
|
+
// Set env vars from config
|
|
38
|
+
if (config.apiKey && config.apiKey !== 'sk-or-your-key-here') {
|
|
39
|
+
process.env.OPENAI_API_KEY = config.apiKey;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Auto-detect base URL
|
|
43
|
+
if (!process.env.OPENAI_BASE_URL) {
|
|
44
|
+
const baseUrls = {
|
|
45
|
+
openrouter: 'https://openrouter.ai/api/v1',
|
|
46
|
+
groq: 'https://api.groq.com/openai/v1',
|
|
47
|
+
ollama: 'http://localhost:11434/v1',
|
|
48
|
+
deepseek: 'https://api.deepseek.com',
|
|
49
|
+
openai: undefined,
|
|
50
|
+
cerebras: 'https://api.cerebras.ai/v1',
|
|
51
|
+
sambanova: 'https://api.sambanova.ai/v1',
|
|
52
|
+
};
|
|
53
|
+
if (baseUrls[provider]) process.env.OPENAI_BASE_URL = config.baseUrl || baseUrls[provider];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Auto-detect model
|
|
57
|
+
if (!process.env.OPENAI_MODEL) {
|
|
58
|
+
const defaultModels = {
|
|
59
|
+
openrouter: 'qwen/qwen3.6-plus-preview:free',
|
|
60
|
+
groq: 'qwen-qwq-32b',
|
|
61
|
+
ollama: 'qwen2.5-coder:7b',
|
|
62
|
+
deepseek: 'deepseek-chat',
|
|
63
|
+
openai: 'gpt-4o',
|
|
64
|
+
cerebras: 'llama-3.3-70b',
|
|
65
|
+
sambanova: 'Meta-Llama-3.3-70B-Instruct',
|
|
66
|
+
};
|
|
67
|
+
process.env.OPENAI_MODEL = config.model || defaultModels[provider] || 'gpt-4o';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Handle -m/--model flag
|
|
71
|
+
const args = process.argv.slice(2);
|
|
72
|
+
for (let i = 0; i < args.length; i++) {
|
|
73
|
+
if ((args[i] === '-m' || args[i] === '--model') && args[i + 1]) {
|
|
74
|
+
process.env.OPENAI_MODEL = args[i + 1];
|
|
75
|
+
args.splice(i, 2);
|
|
76
|
+
i--;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Import and run the CLI
|
|
81
|
+
await import(join(INSTALL_DIR, 'src', 'entrypoints', 'cli.tsx'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xelauvas/xela-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Xela — AI coding assistant powered by any model (OpenRouter, Groq, Ollama, DeepSeek, OpenAI)",
|
|
5
5
|
"author": "xelauvas",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"keywords": ["ai", "coding", "assistant", "cli", "openrouter", "groq", "ollama", "deepseek", "xela"],
|
|
13
13
|
"bin": {
|
|
14
|
-
"xela": "./bin/xela"
|
|
14
|
+
"xela": "./bin/xela.js"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"bin/",
|