@oodarun/cli 0.1.8 → 0.1.10
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/dist/cli.js +51 -21
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2358,7 +2358,16 @@ async function setupClaudeAuth(projectName, token, claudeToken, onProgress, clau
|
|
|
2358
2358
|
});
|
|
2359
2359
|
}
|
|
2360
2360
|
onProgress({ step: "Setting up Claude auth..." });
|
|
2361
|
-
await writeFile(
|
|
2361
|
+
await writeFile(
|
|
2362
|
+
"/home/user/.claude.json",
|
|
2363
|
+
JSON.stringify({
|
|
2364
|
+
hasCompletedOnboarding: true,
|
|
2365
|
+
theme: "dark",
|
|
2366
|
+
numStartups: 10,
|
|
2367
|
+
autoUpdates: false,
|
|
2368
|
+
bypassPermissions: true
|
|
2369
|
+
})
|
|
2370
|
+
);
|
|
2362
2371
|
await writeFile("/tmp/claude-token", claudeToken);
|
|
2363
2372
|
await exec("sed -i '/CLAUDE_CODE_OAUTH_TOKEN/d' /home/user/.bashrc");
|
|
2364
2373
|
await exec('echo "export CLAUDE_CODE_OAUTH_TOKEN=$(cat /tmp/claude-token)" >> /home/user/.bashrc');
|
|
@@ -4611,6 +4620,30 @@ var CLIBridgeClient = class {
|
|
|
4611
4620
|
}
|
|
4612
4621
|
};
|
|
4613
4622
|
|
|
4623
|
+
// src/cli/claude-onboarding.ts
|
|
4624
|
+
function claudeCredentialTargets(vmHome) {
|
|
4625
|
+
return [
|
|
4626
|
+
// v2.x (current) — Linux credential store.
|
|
4627
|
+
{ dir: `${vmHome}/.claude`, file: `${vmHome}/.claude/.credentials.json` },
|
|
4628
|
+
// Legacy — older Claude Code builds.
|
|
4629
|
+
{ dir: `${vmHome}/.config/claude-code`, file: `${vmHome}/.config/claude-code/auth.json` }
|
|
4630
|
+
];
|
|
4631
|
+
}
|
|
4632
|
+
function mergeOnboardingConfig(existing, projectRoot) {
|
|
4633
|
+
const d = { ...existing };
|
|
4634
|
+
const startups = typeof d.numStartups === "number" ? d.numStartups : 0;
|
|
4635
|
+
d.numStartups = Math.max(startups, 10);
|
|
4636
|
+
d.hasCompletedOnboarding = true;
|
|
4637
|
+
if (d.theme === void 0) d.theme = "dark";
|
|
4638
|
+
if (d.installMethod === void 0) d.installMethod = "cli";
|
|
4639
|
+
d.autoUpdates = false;
|
|
4640
|
+
d.bypassPermissions = true;
|
|
4641
|
+
const trusted = Array.isArray(d.trustedDirectories) ? [...d.trustedDirectories] : [];
|
|
4642
|
+
if (!trusted.includes(projectRoot)) trusted.push(projectRoot);
|
|
4643
|
+
d.trustedDirectories = trusted;
|
|
4644
|
+
return d;
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4614
4647
|
// src/cli/session.ts
|
|
4615
4648
|
var IDLE_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
4616
4649
|
var IDLE_WARNING_MS = 25 * 60 * 1e3;
|
|
@@ -4729,31 +4762,28 @@ async function connectAndRunClaude(projectName, apiToken, claudeToken, projectUr
|
|
|
4729
4762
|
const keychainCreds = getClaudeKeychainCredentials();
|
|
4730
4763
|
if (keychainCreds) {
|
|
4731
4764
|
const authJson = JSON.stringify(keychainCreds);
|
|
4732
|
-
|
|
4733
|
-
|
|
4765
|
+
for (const { dir, file } of claudeCredentialTargets(vmHome)) {
|
|
4766
|
+
await client.exec(`sudo mkdir -p ${dir}`);
|
|
4767
|
+
await client.writeFile(file, authJson);
|
|
4768
|
+
}
|
|
4769
|
+
await client.exec(`chmod 600 ${vmHome}/.claude/.credentials.json 2>/dev/null; true`);
|
|
4734
4770
|
await client.exec(`sudo chmod -R a+rX ${vmHome}/.config/claude-code 2>/dev/null`);
|
|
4735
4771
|
} else {
|
|
4736
4772
|
console.log(` ${c.yellow}!${c.reset} ${c.gray}No keychain creds \u2014 OAuth token may expire without refresh.${c.reset}`);
|
|
4737
4773
|
console.log(` ${c.gray} Tip: Run ${c.cyan}claude login${c.gray} locally so ooda can use the refresh token.${c.reset}`);
|
|
4738
4774
|
}
|
|
4739
4775
|
}
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
if
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
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`
|
|
4776
|
+
const claudeJsonPath = `${vmHome}/.claude.json`;
|
|
4777
|
+
const existingClaudeJson = await client.readFile(claudeJsonPath).catch(() => "{}");
|
|
4778
|
+
let claudeJson = {};
|
|
4779
|
+
try {
|
|
4780
|
+
const parsed = JSON.parse(existingClaudeJson);
|
|
4781
|
+
if (parsed && typeof parsed === "object") claudeJson = parsed;
|
|
4782
|
+
} catch {
|
|
4783
|
+
}
|
|
4784
|
+
await client.writeFile(
|
|
4785
|
+
claudeJsonPath,
|
|
4786
|
+
JSON.stringify(mergeOnboardingConfig(claudeJson, projectRoot))
|
|
4757
4787
|
);
|
|
4758
4788
|
await client.exec(`sudo chmod -R a+rX ${projectRoot} 2>/dev/null`);
|
|
4759
4789
|
await client.exec(`sudo mkdir -p ${projectRoot}/.claude/commands`);
|
|
@@ -5343,7 +5373,7 @@ async function deployFromGitHubFlow(target, apiToken, claudeToken) {
|
|
|
5343
5373
|
}
|
|
5344
5374
|
|
|
5345
5375
|
// src/cli/index.ts
|
|
5346
|
-
var CLI_VERSION = "0.1.
|
|
5376
|
+
var CLI_VERSION = "0.1.9";
|
|
5347
5377
|
function formatMutationError(result) {
|
|
5348
5378
|
const parts = [];
|
|
5349
5379
|
if (result.status !== void 0) parts.push(String(result.status));
|