codeam-cli 2.4.0 → 2.4.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.
Files changed (2) hide show
  1. package/dist/index.js +39 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -179,7 +179,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
179
179
  // package.json
180
180
  var package_default = {
181
181
  name: "codeam-cli",
182
- version: "2.4.0",
182
+ version: "2.4.1",
183
183
  description: "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands \u2014 from anywhere.",
184
184
  main: "dist/index.js",
185
185
  bin: {
@@ -5299,21 +5299,36 @@ async function deploy() {
5299
5299
  }
5300
5300
  claudeStep.stop("\u2713 Claude CLI installed");
5301
5301
  const localClaudeDir = path8.join(os6.homedir(), ".claude");
5302
- if (fs8.existsSync(localClaudeDir) && fs8.statSync(localClaudeDir).isDirectory()) {
5302
+ const haveLocalClaude = fs8.existsSync(localClaudeDir) && fs8.statSync(localClaudeDir).isDirectory();
5303
+ if (haveLocalClaude) {
5303
5304
  const copyStep = fe();
5304
5305
  copyStep.start("Copying local Claude config to workspace\u2026");
5305
5306
  try {
5306
5307
  await provider.uploadDirectory(workspace.id, localClaudeDir, "/home/codespace/.claude");
5307
5308
  copyStep.stop("\u2713 Claude config copied \u2014 no re-auth needed");
5308
5309
  } catch (err) {
5309
- copyStep.stop("\u26A0 Could not copy Claude config \u2014 you may need to login on the workspace");
5310
+ copyStep.stop("\u26A0 Could not copy Claude config \u2014 falling back to remote login");
5310
5311
  void err;
5312
+ await runRemoteClaudeLogin(provider, workspace.id);
5311
5313
  }
5312
5314
  } else {
5313
5315
  wt(
5314
- "No local ~/.claude config found. You can authenticate Claude in the workspace shell when needed.",
5315
- "Heads up"
5316
+ [
5317
+ "No local ~/.claude config found.",
5318
+ "We can run `claude login` inside the workspace right now \u2014 the URL",
5319
+ "will print here, you open it in your browser, paste the code back,",
5320
+ "and the workspace gets authenticated. (Skip if you'd rather do it",
5321
+ "manually later from inside the codespace.)"
5322
+ ].join("\n"),
5323
+ "Claude credentials"
5316
5324
  );
5325
+ const proceed = await ot2({
5326
+ message: "Run `claude login` on the workspace now?",
5327
+ initialValue: true
5328
+ });
5329
+ if (!q(proceed) && proceed) {
5330
+ await runRemoteClaudeLogin(provider, workspace.id);
5331
+ }
5317
5332
  }
5318
5333
  const cliStep = fe();
5319
5334
  cliStep.start("Installing codeam-cli on workspace\u2026");
@@ -5341,6 +5356,25 @@ async function deploy() {
5341
5356
  gt(import_picocolors7.default.yellow(`Pairing exited with code ${code}. Run "codeam pair" inside the codespace if needed.`));
5342
5357
  }
5343
5358
  }
5359
+ async function runRemoteClaudeLogin(provider, workspaceId) {
5360
+ wt(
5361
+ [
5362
+ "A login URL will print below. Open it in your local browser, sign in,",
5363
+ "and paste any code Claude asks for back into this terminal."
5364
+ ].join("\n"),
5365
+ "Authenticating Claude on workspace"
5366
+ );
5367
+ const result = await provider.streamCommand(
5368
+ workspaceId,
5369
+ 'bash -lc "claude login || claude /login || true"'
5370
+ );
5371
+ if (result.code !== 0) {
5372
+ wt(
5373
+ "claude login exited non-zero. You can re-run it manually inside the codespace later.",
5374
+ "Heads up"
5375
+ );
5376
+ }
5377
+ }
5344
5378
  async function pickProvider() {
5345
5379
  const ready = PROVIDERS.filter((prov) => prov.available);
5346
5380
  if (ready.length === 1) return ready[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands — from anywhere.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {