mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 09:00:44 +00:00
21 lines
645 B
JavaScript
21 lines
645 B
JavaScript
import fs from "node:fs";
|
|
|
|
const [scenario, configPath] = process.argv.slice(2);
|
|
if (!scenario || !configPath) {
|
|
throw new Error("usage: write-config.mjs <reset|skills> <config-path>");
|
|
}
|
|
|
|
const config = {
|
|
reset: {
|
|
meta: {},
|
|
agents: { defaults: { workspace: "/root/old" } },
|
|
gateway: { mode: "remote", remote: { url: "ws://old.example:18789", token: "old-token" } },
|
|
},
|
|
skills: { meta: {}, skills: { allowBundled: ["__none__"], install: { nodeManager: "bun" } } },
|
|
}[scenario];
|
|
if (!config) {
|
|
throw new Error(`unknown config scenario: ${scenario}`);
|
|
}
|
|
|
|
fs.writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`);
|