iaurora 1.0.3 → 1.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.
Files changed (2) hide show
  1. package/bin/aurora.js +30 -40
  2. 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,30 +29,40 @@ 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 `aurora 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() {
44
+ const cmd = 'aurora';
37
45
  console.log(`
38
46
  Aurora AI Gateway — CLI
39
47
  One API for every LLM provider. Self-hosted, open-source.
40
48
 
41
49
  USAGE
42
- npx iaurora <command>
50
+ ${cmd} <command>
43
51
 
44
52
  COMMANDS
45
- help Show this help
46
- install Download the Aurora binary for your platform
47
- start Start the gateway (requires config setup)
48
- version Show version
53
+ help Show this CLI overview
54
+ install Download the Aurora binary for your platform
55
+ Any other arg Passed through to the Aurora binary
49
56
 
50
- SETUP
51
- 1. npx iaurora install # Download the binary
52
- 2. cp .env.template .env # Configure your environment
53
- 3. npx iaurora start # Start the gateway
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
54
61
 
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
62
+ SETUP
63
+ 1. ${cmd} install # Download the binary
64
+ 2. cp .env.template .env # Configure your environment
65
+ 3. ${cmd} # Start the gateway
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] || 'help';
73
+ const cmd = args[0] || '';
68
74
 
69
- if (cmd === 'help' || cmd === '--help' || cmd === '-h') {
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
- const binary = findBinary();
92
- if (!binary) {
93
- console.error('Aurora binary not found.');
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": "1.0.3",
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": ">=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
- }
1
+ {
2
+ "version": "1.0.5",
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
+ }