@oodarun/cli 0.1.9 → 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 +35 -22
- 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');
|
|
@@ -4620,24 +4629,19 @@ function claudeCredentialTargets(vmHome) {
|
|
|
4620
4629
|
{ dir: `${vmHome}/.config/claude-code`, file: `${vmHome}/.config/claude-code/auth.json` }
|
|
4621
4630
|
];
|
|
4622
4631
|
}
|
|
4623
|
-
function
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
d =
|
|
4628
|
-
if
|
|
4629
|
-
|
|
4630
|
-
d
|
|
4631
|
-
d
|
|
4632
|
-
d.
|
|
4633
|
-
|
|
4634
|
-
d
|
|
4635
|
-
d
|
|
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`;
|
|
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;
|
|
4641
4645
|
}
|
|
4642
4646
|
|
|
4643
4647
|
// src/cli/session.ts
|
|
@@ -4769,8 +4773,17 @@ async function connectAndRunClaude(projectName, apiToken, claudeToken, projectUr
|
|
|
4769
4773
|
console.log(` ${c.gray} Tip: Run ${c.cyan}claude login${c.gray} locally so ooda can use the refresh token.${c.reset}`);
|
|
4770
4774
|
}
|
|
4771
4775
|
}
|
|
4772
|
-
|
|
4773
|
-
|
|
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))
|
|
4774
4787
|
);
|
|
4775
4788
|
await client.exec(`sudo chmod -R a+rX ${projectRoot} 2>/dev/null`);
|
|
4776
4789
|
await client.exec(`sudo mkdir -p ${projectRoot}/.claude/commands`);
|
|
@@ -5360,7 +5373,7 @@ async function deployFromGitHubFlow(target, apiToken, claudeToken) {
|
|
|
5360
5373
|
}
|
|
5361
5374
|
|
|
5362
5375
|
// src/cli/index.ts
|
|
5363
|
-
var CLI_VERSION = "0.1.
|
|
5376
|
+
var CLI_VERSION = "0.1.9";
|
|
5364
5377
|
function formatMutationError(result) {
|
|
5365
5378
|
const parts = [];
|
|
5366
5379
|
if (result.status !== void 0) parts.push(String(result.status));
|