iaurora 1.0.2 → 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.
Files changed (2) hide show
  1. package/bin/aurora.js +27 -37
  2. package/package.json +3 -3
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 Show this help
46
- install Download the Aurora binary for your platform
47
- start Start the gateway (requires config setup)
48
- version Show version
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 start # Start the gateway
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] || '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,5 +1,5 @@
1
1
  {
2
- "version": "1.0.2",
2
+ "version": "1.0.4",
3
3
  "author": "SantiagoDePolonia",
4
4
  "license": "Apache-2.0",
5
5
  "files": [
@@ -29,7 +29,7 @@
29
29
  "node": "\u003e=18"
30
30
  },
31
31
  "scripts": {
32
- "postinstall": "node ./scripts/npm-postinstall.js"
32
+ "postinstall": "node scripts/npm-postinstall.js"
33
33
  },
34
34
  "homepage": "https://github.com/gurveeer/Aurora#readme",
35
35
  "repository": {
@@ -37,6 +37,6 @@
37
37
  "url": "git+https://github.com/gurveeer/Aurora.git"
38
38
  },
39
39
  "bin": {
40
- "aurora": "./bin/aurora.js"
40
+ "aurora": "bin/aurora.js"
41
41
  }
42
42
  }