@oodarun/cli 0.1.8 → 0.1.9

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/cli.js +35 -18
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4611,6 +4611,35 @@ var CLIBridgeClient = class {
4611
4611
  }
4612
4612
  };
4613
4613
 
4614
+ // src/cli/claude-onboarding.ts
4615
+ function claudeCredentialTargets(vmHome) {
4616
+ return [
4617
+ // v2.x (current) — Linux credential store.
4618
+ { dir: `${vmHome}/.claude`, file: `${vmHome}/.claude/.credentials.json` },
4619
+ // Legacy — older Claude Code builds.
4620
+ { dir: `${vmHome}/.config/claude-code`, file: `${vmHome}/.config/claude-code/auth.json` }
4621
+ ];
4622
+ }
4623
+ function buildOnboardingSkipCommand(claudeJsonPath, projectRoot) {
4624
+ return `python3 -c "
4625
+ import json, os
4626
+ p = '${claudeJsonPath}'
4627
+ d = {}
4628
+ if os.path.exists(p):
4629
+ with open(p) as f: d = json.load(f)
4630
+ d['numStartups'] = max(d.get('numStartups', 0), 10)
4631
+ d['hasCompletedOnboarding'] = True
4632
+ d.setdefault('theme', 'dark')
4633
+ d.setdefault('installMethod', 'cli')
4634
+ d['autoUpdates'] = False
4635
+ d['bypassPermissions'] = True
4636
+ d.setdefault('trustedDirectories', [])
4637
+ if '${projectRoot}' not in d['trustedDirectories']:
4638
+ d['trustedDirectories'].append('${projectRoot}')
4639
+ with open(p, 'w') as f: json.dump(d, f)
4640
+ " 2>/dev/null`;
4641
+ }
4642
+
4614
4643
  // src/cli/session.ts
4615
4644
  var IDLE_TIMEOUT_MS = 30 * 60 * 1e3;
4616
4645
  var IDLE_WARNING_MS = 25 * 60 * 1e3;
@@ -4729,8 +4758,11 @@ async function connectAndRunClaude(projectName, apiToken, claudeToken, projectUr
4729
4758
  const keychainCreds = getClaudeKeychainCredentials();
4730
4759
  if (keychainCreds) {
4731
4760
  const authJson = JSON.stringify(keychainCreds);
4732
- await client.exec(`sudo mkdir -p ${vmHome}/.config/claude-code`);
4733
- await client.writeFile(`${vmHome}/.config/claude-code/auth.json`, authJson);
4761
+ for (const { dir, file } of claudeCredentialTargets(vmHome)) {
4762
+ await client.exec(`sudo mkdir -p ${dir}`);
4763
+ await client.writeFile(file, authJson);
4764
+ }
4765
+ await client.exec(`chmod 600 ${vmHome}/.claude/.credentials.json 2>/dev/null; true`);
4734
4766
  await client.exec(`sudo chmod -R a+rX ${vmHome}/.config/claude-code 2>/dev/null`);
4735
4767
  } else {
4736
4768
  console.log(` ${c.yellow}!${c.reset} ${c.gray}No keychain creds \u2014 OAuth token may expire without refresh.${c.reset}`);
@@ -4738,22 +4770,7 @@ async function connectAndRunClaude(projectName, apiToken, claudeToken, projectUr
4738
4770
  }
4739
4771
  }
4740
4772
  await client.exec(
4741
- `python3 -c "
4742
- import json, os
4743
- p = '${vmHome}/.claude.json'
4744
- d = {}
4745
- if os.path.exists(p):
4746
- with open(p) as f: d = json.load(f)
4747
- d['numStartups'] = max(d.get('numStartups', 0), 10)
4748
- d['hasCompletedOnboarding'] = True
4749
- d.setdefault('installMethod', 'cli')
4750
- d['autoUpdates'] = False
4751
- d['bypassPermissions'] = True
4752
- d.setdefault('trustedDirectories', [])
4753
- if '${projectRoot}' not in d['trustedDirectories']:
4754
- d['trustedDirectories'].append('${projectRoot}')
4755
- with open(p, 'w') as f: json.dump(d, f)
4756
- " 2>/dev/null`
4773
+ buildOnboardingSkipCommand(`${vmHome}/.claude.json`, projectRoot)
4757
4774
  );
4758
4775
  await client.exec(`sudo chmod -R a+rX ${projectRoot} 2>/dev/null`);
4759
4776
  await client.exec(`sudo mkdir -p ${projectRoot}/.claude/commands`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oodarun/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Launch Claude Code on cloud dev environments",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",