iaurora 1.0.3 → 1.0.4
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/bin/aurora.js +27 -37
- package/package.json +42 -42
package/bin/aurora.js
CHANGED
|
@@ -11,15 +11,11 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
11
11
|
const __dirname = dirname(__filename);
|
|
12
12
|
const require = createRequire(import.meta.url);
|
|
13
13
|
|
|
14
|
-
// Try multiple locations for the binary, in priority order
|
|
15
14
|
function findBinary() {
|
|
16
15
|
const candidates = [
|
|
17
|
-
// Downloaded by postinstall to ~/.aurora/bin/
|
|
18
16
|
resolve(os.homedir(), '.aurora', 'bin', os.platform() === 'win32' ? 'aurora.exe' : 'aurora'),
|
|
19
|
-
// Bundled alongside the JS wrapper
|
|
20
17
|
resolve(__dirname, 'aurora.exe'),
|
|
21
18
|
resolve(__dirname, 'aurora'),
|
|
22
|
-
// Project-local build
|
|
23
19
|
resolve(process.cwd(), 'bin', 'aurora-oss.exe'),
|
|
24
20
|
resolve(process.cwd(), 'bin', 'aurora.exe'),
|
|
25
21
|
resolve(process.cwd(), 'bin', 'aurora'),
|
|
@@ -33,6 +29,17 @@ function findBinary() {
|
|
|
33
29
|
return null;
|
|
34
30
|
}
|
|
35
31
|
|
|
32
|
+
function execBinary(args) {
|
|
33
|
+
const binary = findBinary();
|
|
34
|
+
if (!binary) {
|
|
35
|
+
console.error('Aurora binary not found.');
|
|
36
|
+
console.error('Run `npx iaurora install` to download it, or build it with `go build -o bin/aurora.exe ./apps/aurora`.');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
const result = spawnSync(binary, args, { stdio: 'inherit' });
|
|
40
|
+
process.exit(result.status ?? 0);
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
function printHelp() {
|
|
37
44
|
console.log(`
|
|
38
45
|
Aurora AI Gateway — CLI
|
|
@@ -42,21 +49,20 @@ USAGE
|
|
|
42
49
|
npx iaurora <command>
|
|
43
50
|
|
|
44
51
|
COMMANDS
|
|
45
|
-
help
|
|
46
|
-
install
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
help Show this CLI overview
|
|
53
|
+
install Download the Aurora binary for your platform
|
|
54
|
+
version Show version
|
|
55
|
+
Any other arg Passed through to the Aurora binary
|
|
56
|
+
|
|
57
|
+
FLAGS (passed to binary)
|
|
58
|
+
--help Full configuration reference with all env vars
|
|
59
|
+
-h Same as --help
|
|
60
|
+
-version Show Go binary version info
|
|
49
61
|
|
|
50
62
|
SETUP
|
|
51
63
|
1. npx iaurora install # Download the binary
|
|
52
64
|
2. cp .env.template .env # Configure your environment
|
|
53
|
-
3. npx iaurora
|
|
54
|
-
|
|
55
|
-
ENVIRONMENT VARIABLES
|
|
56
|
-
Copy .env.template to .env and set at least:
|
|
57
|
-
- AURORA_MASTER_KEY # Gateway security key
|
|
58
|
-
- AURORA_CONFIG_PATH # Path to config YAML (e.g. configs/editions/oss.example.yaml)
|
|
59
|
-
- OPENAI_API_KEY # At least one provider key
|
|
65
|
+
3. npx iaurora # Start the gateway (passes through to Go binary)
|
|
60
66
|
|
|
61
67
|
Docs: https://github.com/gurveeer/Aurora#readme
|
|
62
68
|
`.trim());
|
|
@@ -64,39 +70,23 @@ Docs: https://github.com/gurveeer/Aurora#readme
|
|
|
64
70
|
|
|
65
71
|
async function main() {
|
|
66
72
|
const args = process.argv.slice(2);
|
|
67
|
-
const cmd = args[0] || '
|
|
73
|
+
const cmd = args[0] || '';
|
|
68
74
|
|
|
69
|
-
|
|
75
|
+
// Node-only commands (no binary needed)
|
|
76
|
+
if (cmd === 'help') {
|
|
70
77
|
printHelp();
|
|
71
78
|
process.exit(0);
|
|
72
79
|
}
|
|
73
80
|
|
|
74
|
-
if (cmd === 'version' || cmd === '--version' || cmd === '-v') {
|
|
75
|
-
const binary = findBinary();
|
|
76
|
-
if (binary) {
|
|
77
|
-
const result = spawnSync(binary, ['-version'], { stdio: 'inherit' });
|
|
78
|
-
process.exit(result.status ?? 0);
|
|
79
|
-
}
|
|
80
|
-
const pkg = require(resolve(__dirname, '..', 'package.json'));
|
|
81
|
-
console.log(pkg.version);
|
|
82
|
-
process.exit(0);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
81
|
if (cmd === 'install') {
|
|
86
82
|
const { downloadAndInstall } = await import(resolve(__dirname, '..', 'scripts', 'npm-postinstall.js'));
|
|
87
83
|
await downloadAndInstall({ force: true });
|
|
88
84
|
process.exit(0);
|
|
89
85
|
}
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
console.error('Run `npx iaurora install` to download it, or build it with `go build -o bin/aurora.exe ./apps/aurora`.');
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const result = spawnSync(binary, args, { stdio: 'inherit' });
|
|
99
|
-
process.exit(result.status ?? 0);
|
|
87
|
+
// Everything else goes to the binary
|
|
88
|
+
// --help, -h, -version, or no args → binary handles them
|
|
89
|
+
execBinary(args);
|
|
100
90
|
}
|
|
101
91
|
|
|
102
92
|
main().catch(err => {
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version":
|
|
3
|
-
"author":
|
|
4
|
-
"license":
|
|
5
|
-
"files":
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"keywords":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"name":
|
|
23
|
-
"type":
|
|
24
|
-
"bugs":
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"description":
|
|
28
|
-
"engines":
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"scripts":
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"homepage":
|
|
35
|
-
"repository":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"bin":
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.4",
|
|
3
|
+
"author": "SantiagoDePolonia",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"files": [
|
|
6
|
+
"bin/",
|
|
7
|
+
"scripts/",
|
|
8
|
+
"config.yaml",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ai",
|
|
14
|
+
"llm",
|
|
15
|
+
"gateway",
|
|
16
|
+
"openai",
|
|
17
|
+
"anthropic",
|
|
18
|
+
"gemini",
|
|
19
|
+
"proxy",
|
|
20
|
+
"api-gateway"
|
|
21
|
+
],
|
|
22
|
+
"name": "iaurora",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/gurveeer/Aurora/issues"
|
|
26
|
+
},
|
|
27
|
+
"description": "Aurora AI Gateway - one API for every LLM provider. Self-hosted, open-source.",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": "\u003e=18"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"postinstall": "node scripts/npm-postinstall.js"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/gurveeer/Aurora#readme",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/gurveeer/Aurora.git"
|
|
38
|
+
},
|
|
39
|
+
"bin": {
|
|
40
|
+
"aurora": "bin/aurora.js"
|
|
41
|
+
}
|
|
42
|
+
}
|