@auroraflow/code 0.0.16 → 0.0.18

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 CHANGED
@@ -16,8 +16,7 @@ lib/ current MVP support modules
16
16
 
17
17
  ## Install
18
18
 
19
- Installing `@auroraflow/code` as a global npm package attempts to install/update the
20
- official Claude Code and Codex global commands:
19
+ Install `@auroraflow/code` as a global npm package:
21
20
 
22
21
  ```bash
23
22
  npm install -g @auroraflow/code
@@ -26,12 +25,18 @@ npm install -g @auroraflow/code
26
25
  Aurora does not export `claude` or `codex` bins. The standalone `claude` and
27
26
  `codex` commands remain the official clients and keep their official behavior.
28
27
  Aurora only wraps them through `aurora-claude` and `aurora-codex`.
28
+ Aurora does not auto-install official clients during package installation; this
29
+ keeps `npm install -g @auroraflow/code` fast and avoids hiding npm/network
30
+ failures inside postinstall.
29
31
 
30
32
  To install or update the official clients explicitly:
31
33
 
32
34
  ```bash
33
35
  aurora install-clients
34
36
  aurora update-clients
37
+ aurora install codex
38
+ aurora install claude
39
+ aurora install all
35
40
  ```
36
41
 
37
42
  ## Commands
@@ -43,6 +48,8 @@ node bin/aurora.js
43
48
  node bin/aurora.js init
44
49
  node bin/aurora.js claude
45
50
  node bin/aurora.js codex
51
+ node bin/aurora.js install codex
52
+ node bin/aurora.js install claude
46
53
  node bin/aurora.js install-clients
47
54
  node bin/aurora.js update-clients
48
55
  node bin/aurora.js status
@@ -50,6 +57,8 @@ node bin/aurora.js status
50
57
 
51
58
  Running `aurora` without a subcommand opens an interactive client selector. Use
52
59
  Up/Down (or `j`/`k`) and Enter to launch Claude or Codex through Aurora.
60
+ If the selected official client is missing, Aurora prompts to install that
61
+ specific client before launch.
53
62
 
54
63
  The launcher stores shared local state under `~/.aurora` and starts a local
55
64
  sidecar at `127.0.0.1:17878`. Official clients talk to the sidecar; the sidecar
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auroraflow/code",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "type": "module",
5
5
  "description": "Aurora launcher and sidecar for official Codex and Claude Code clients.",
6
6
  "repository": {
@@ -1,7 +1,7 @@
1
1
  import { ensureLayout, readAccount, readState, writeAccount, writeState } from "../../state/src/index.js";
2
- import { officialClientStatuses, runClient, updateOfficialClients } from "../../clients/src/index.js";
2
+ import { installOfficialClient, officialClientStatus, officialClientStatuses, runClient, updateOfficialClients } from "../../clients/src/index.js";
3
3
  import { ensureSidecarRunning, installSidecarService, sidecarServiceStatus, uninstallSidecarService } from "../../service/src/index.js";
4
- import { chooseClient, promptFields } from "../../../lib/prompt.js";
4
+ import { chooseClient, promptChoice, promptFields } from "../../../lib/prompt.js";
5
5
 
6
6
  export async function runAuroraCLI(argv = process.argv.slice(2)) {
7
7
  await ensureLayout();
@@ -28,6 +28,9 @@ export async function runAuroraCLI(argv = process.argv.slice(2)) {
28
28
  officialClients: officialClientStatuses()
29
29
  }, null, 2));
30
30
  return;
31
+ case "install":
32
+ await installCommand(rest);
33
+ return;
31
34
  case "install-clients":
32
35
  case "install-official-clients":
33
36
  case "update-clients":
@@ -70,6 +73,26 @@ async function sidecarCommand(args) {
70
73
  }
71
74
  }
72
75
 
76
+ async function installCommand(args) {
77
+ const target = args[0] ?? "";
78
+ switch (target) {
79
+ case "codex":
80
+ case "claude":
81
+ await installOfficialClient(target);
82
+ console.log(JSON.stringify({ officialClients: officialClientStatuses() }, null, 2));
83
+ return;
84
+ case "all":
85
+ case "clients":
86
+ case "official-clients":
87
+ await updateOfficialClients();
88
+ console.log(JSON.stringify({ officialClients: officialClientStatuses() }, null, 2));
89
+ return;
90
+ default:
91
+ console.error("Usage: aurora install [codex|claude|all]");
92
+ process.exit(1);
93
+ }
94
+ }
95
+
73
96
  export async function runAuroraClaude(argv = process.argv.slice(2)) {
74
97
  await ensureLayout();
75
98
  await runClient("claude", argv);
@@ -86,9 +109,23 @@ async function startInteractive(args) {
86
109
  await init();
87
110
  }
88
111
  const client = await chooseClient();
112
+ await ensureOfficialClientForInteractive(client);
89
113
  await runClient(client, args);
90
114
  }
91
115
 
116
+ async function ensureOfficialClientForInteractive(client) {
117
+ const status = officialClientStatus(client);
118
+ if (status?.installed) return;
119
+ const action = await promptChoice(`${status?.name ?? client} is not installed`, [
120
+ { label: `Install ${status?.name ?? client} now`, value: "install" },
121
+ { label: "Exit", value: "exit" }
122
+ ]);
123
+ if (action !== "install") {
124
+ throw new Error(`${status?.name ?? client} is required. Run: aurora install ${client}`);
125
+ }
126
+ await installOfficialClient(client);
127
+ }
128
+
92
129
  async function init() {
93
130
  const existing = await readState();
94
131
  const account = await readAccount();
@@ -164,6 +201,9 @@ function usage(exitCode) {
164
201
  aurora init
165
202
  aurora claude [args...]
166
203
  aurora codex [args...]
204
+ aurora install codex
205
+ aurora install claude
206
+ aurora install all
167
207
  aurora install-clients
168
208
  aurora update-clients
169
209
  aurora status
@@ -84,8 +84,16 @@ export async function updateOfficialClients() {
84
84
  }
85
85
 
86
86
  export async function installOfficialClients() {
87
+ await installOfficialClient("claude");
88
+ await installOfficialClient("codex");
89
+ }
90
+
91
+ export async function installOfficialClient(client) {
92
+ const spec = OFFICIAL_CLIENTS[client];
93
+ if (!spec) throw new Error(`unknown official client: ${client}`);
87
94
  const npm = npmCommandSpec();
88
- const args = ["install", "-g", "@anthropic-ai/claude-code@latest", "@openai/codex@latest"];
95
+ const args = ["install", "-g", `${spec.packageName}@latest`];
96
+ console.error(`[aurora] installing ${spec.name}: ${npm.command} ${[...npm.args, ...args].join(" ")}`);
89
97
  await spawnAndWait(npm.command, [...npm.args, ...args], { ...process.env });
90
98
  }
91
99
 
@@ -93,12 +101,16 @@ export function isGlobalNpmLifecycle() {
93
101
  return process.env.npm_config_global === "true" || process.env.npm_config_location === "global";
94
102
  }
95
103
 
104
+ export function officialClientStatus(client) {
105
+ return officialClientStatuses().find(status => status.id === client) ?? null;
106
+ }
107
+
96
108
  function officialClientBin(client) {
97
109
  const spec = OFFICIAL_CLIENTS[client];
98
110
  if (!spec) throw new Error(`unknown official client: ${client}`);
99
111
  const bin = resolveOfficialClientBin(spec.binName);
100
112
  if (!bin) {
101
- throw new Error(`${spec.name} is not installed. Run: aurora install-clients`);
113
+ throw new Error(`${spec.name} is not installed. Run: aurora install ${client}`);
102
114
  }
103
115
  return bin;
104
116
  }
@@ -261,7 +273,12 @@ function npmCommandSpec() {
261
273
  if (npmExecPath.endsWith(".js")) {
262
274
  return { command: process.execPath, args: [npmExecPath] };
263
275
  }
264
- return { command: npmExecPath || "npm", args: [] };
276
+ if (npmExecPath) return { command: npmExecPath, args: [] };
277
+ const npmBin = findPathCommand("npm");
278
+ if (!npmBin) {
279
+ throw new Error("npm command was not found in PATH. Install Node.js/npm or add npm to PATH, then retry.");
280
+ }
281
+ return { command: npmBin, args: [] };
265
282
  }
266
283
 
267
284
  function windowsCommandSpec(command, args) {