clawdock 0.2.0 → 0.2.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.
- package/dist/index.js +16 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -303,10 +303,10 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
303
303
|
const model = opts.model || rt.model;
|
|
304
304
|
const runtimeSpec = opts.runtime || rt.runtime || "openclaw@latest";
|
|
305
305
|
if (!provider || !apiKey) {
|
|
306
|
-
console.
|
|
307
|
-
console.
|
|
308
|
-
console.
|
|
309
|
-
|
|
306
|
+
console.log("\u2139\uFE0F No runtime credentials configured \u2014 launching without provider override.");
|
|
307
|
+
console.log(" To set defaults: clawdock credentials set");
|
|
308
|
+
console.log(" Or pass --provider and --api-key");
|
|
309
|
+
console.log();
|
|
310
310
|
}
|
|
311
311
|
const [runtimeName, runtimeVersion] = runtimeSpec.split("@");
|
|
312
312
|
console.log(`\u{1F50D} Checking runtime: ${runtimeName}...`);
|
|
@@ -386,12 +386,12 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
386
386
|
console.error(" Run without --no-pull to download first.");
|
|
387
387
|
process.exit(1);
|
|
388
388
|
}
|
|
389
|
-
const resolvedModel = model || `${provider}/claude-sonnet-4
|
|
389
|
+
const resolvedModel = model || (provider ? `${provider}/claude-sonnet-4` : null);
|
|
390
390
|
console.log(`
|
|
391
391
|
\u{1F980} Starting ${owner}/${slug}...`);
|
|
392
392
|
console.log(` Runtime: ${runtimeSpec}`);
|
|
393
393
|
console.log(` Workspace: ${workspaceDir}`);
|
|
394
|
-
console.log(` Model: ${resolvedModel}`);
|
|
394
|
+
if (resolvedModel) console.log(` Model: ${resolvedModel}`);
|
|
395
395
|
console.log();
|
|
396
396
|
if (runtimeName === "openclaw") {
|
|
397
397
|
try {
|
|
@@ -403,8 +403,9 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
403
403
|
} catch {
|
|
404
404
|
console.log(` Registering agent "${agentName}"...`);
|
|
405
405
|
try {
|
|
406
|
+
const modelFlag = resolvedModel ? ` --model ${resolvedModel}` : "";
|
|
406
407
|
execSync(
|
|
407
|
-
`openclaw agents add ${agentName} --workspace ${workspaceDir}
|
|
408
|
+
`openclaw agents add ${agentName} --workspace ${workspaceDir}${modelFlag} --non-interactive`,
|
|
408
409
|
{ stdio: "inherit" }
|
|
409
410
|
);
|
|
410
411
|
} catch (err) {
|
|
@@ -412,13 +413,14 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
412
413
|
process.exit(1);
|
|
413
414
|
}
|
|
414
415
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
416
|
+
if (provider && apiKey) {
|
|
417
|
+
const agentDir = path.join(os.homedir(), ".openclaw", "agents", agentName, "agent");
|
|
418
|
+
fs.mkdirSync(agentDir, { recursive: true });
|
|
419
|
+
const authProfilesPath = path.join(agentDir, "auth-profiles.json");
|
|
420
|
+
const authProfiles = {};
|
|
421
|
+
authProfiles[provider] = { type: "api-key", apiKey };
|
|
422
|
+
fs.writeFileSync(authProfilesPath, JSON.stringify(authProfiles, null, 2));
|
|
423
|
+
}
|
|
422
424
|
const child = spawn(
|
|
423
425
|
runtimeBin,
|
|
424
426
|
["agent", "--agent", agentName, "--prompt", "Hello! I just pulled you from ClawDock. Introduce yourself."],
|