create-openclaw-bot 5.6.6 → 5.6.8

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 +92 -41
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -186,7 +186,9 @@ function resolveNative9RouterDesktopLaunch() {
186
186
  args: ['-n', '-H', '0.0.0.0', '-p', '20128', '--skip-update'],
187
187
  env: {
188
188
  PORT: '20128',
189
- HOSTNAME: '0.0.0.0'
189
+ HOSTNAME: '0.0.0.0',
190
+ // Ensures 9router stores data in the user home dir, matching where sync script writes db.json
191
+ DATA_DIR: getNative9RouterDataDir(),
190
192
  }
191
193
  };
192
194
  }
@@ -198,10 +200,32 @@ function build9RouterSmartRouteSyncScript(dbPath) {
198
200
  const path = require('path');
199
201
  const dbPath = ${safeDbPath};
200
202
  const ROUTER='http://localhost:20128';
201
- const MODEL_PRIORITY = {
202
- openai: ['openai/gpt-4o', 'openai/gpt-4.1'],
203
- anthropic: ['anthropic/claude-sonnet-4', 'anthropic/claude-haiku-3.5'],
204
- gemini: ['gemini/gemini-2.5-flash', 'gemini/gemini-2.5-pro'],
203
+ const MODEL_PRIORITY = {
204
+ codex: ['cx/gpt-5.4', 'cx/gpt-5.3-codex', 'cx/gpt-5.3-codex-high', 'cx/gpt-5.2-codex', 'cx/gpt-5.2', 'cx/gpt-5.1-codex-max', 'cx/gpt-5.1-codex', 'cx/gpt-5.1', 'cx/gpt-5-codex'],
205
+ 'claude-code': ['cc/claude-opus-4-6', 'cc/claude-sonnet-4-6', 'cc/claude-opus-4-5-20251101', 'cc/claude-sonnet-4-5-20250929', 'cc/claude-haiku-4-5-20251001'],
206
+ github: ['gh/gpt-5.4', 'gh/gpt-5.3-codex', 'gh/gpt-5.2-codex', 'gh/gpt-5.2', 'gh/gpt-5.1-codex-max', 'gh/gpt-5.1-codex', 'gh/gpt-5.1', 'gh/gpt-5', 'gh/gpt-4.1', 'gh/gpt-4o', 'gh/claude-opus-4.6', 'gh/claude-sonnet-4.6', 'gh/claude-sonnet-4.5', 'gh/claude-opus-4.5', 'gh/claude-haiku-4.5', 'gh/gemini-3-pro-preview', 'gh/gemini-3-flash-preview', 'gh/gemini-2.5-pro'],
207
+ cursor: ['cu/default', 'cu/claude-4.6-opus-max', 'cu/claude-4.5-opus-high-thinking', 'cu/claude-4.5-sonnet-thinking', 'cu/claude-4.5-sonnet', 'cu/gpt-5.3-codex', 'cu/gpt-5.2-codex', 'cu/gemini-3-flash-preview'],
208
+ kilo: ['kc/anthropic/claude-sonnet-4-20250514', 'kc/anthropic/claude-opus-4-20250514', 'kc/google/gemini-2.5-pro', 'kc/google/gemini-2.5-flash', 'kc/openai/gpt-4.1', 'kc/deepseek/deepseek-chat'],
209
+ cline: ['cl/anthropic/claude-sonnet-4.6', 'cl/anthropic/claude-opus-4.6', 'cl/openai/gpt-5.3-codex', 'cl/openai/gpt-5.4', 'cl/google/gemini-3.1-pro-preview'],
210
+ 'gemini-cli': ['gc/gemini-3-flash-preview', 'gc/gemini-3-pro-preview'],
211
+ iflow: ['if/qwen3-coder-plus', 'if/kimi-k2', 'if/kimi-k2-thinking', 'if/glm-4.7', 'if/deepseek-r1', 'if/deepseek-v3.2', 'if/deepseek-v3', 'if/qwen3-max', 'if/qwen3-235b', 'if/iflow-rome-30ba3b'],
212
+ qwen: ['qw/qwen3-coder-plus', 'qw/qwen3-coder-flash', 'qw/vision-model', 'qw/coder-model'],
213
+ kiro: ['kr/claude-sonnet-4.5', 'kr/claude-haiku-4.5', 'kr/deepseek-3.2', 'kr/deepseek-3.1', 'kr/qwen3-coder-next'],
214
+ ollama: ['ollama/gemma4:e2b', 'ollama/gemma4:e4b', 'ollama/gemma4:26b', 'ollama/gemma4:31b', 'ollama/qwen3.5', 'ollama/kimi-k2.5', 'ollama/glm-5', 'ollama/glm-4.7-flash', 'ollama/minimax-m2.5', 'ollama/gpt-oss:120b'],
215
+ 'kimi-coding': ['kmc/kimi-k2.5', 'kmc/kimi-k2.5-thinking', 'kmc/kimi-latest'],
216
+ glm: ['glm/glm-5.1', 'glm/glm-5', 'glm/glm-4.7'],
217
+ 'glm-cn': ['glm/glm-5.1', 'glm/glm-5', 'glm/glm-4.7'],
218
+ minimax: ['minimax/MiniMax-M2.7', 'minimax/MiniMax-M2.5', 'minimax/MiniMax-M2.1'],
219
+ kimi: ['kimi/kimi-k2.5', 'kimi/kimi-k2.5-thinking', 'kimi/kimi-latest'],
220
+ deepseek: ['deepseek/deepseek-chat', 'deepseek/deepseek-reasoner'],
221
+ xai: ['xai/grok-4', 'xai/grok-4-fast-reasoning', 'xai/grok-code-fast-1'],
222
+ mistral: ['mistral/mistral-large-latest', 'mistral/codestral-latest'],
223
+ groq: ['groq/llama-3.3-70b-versatile', 'groq/openai/gpt-oss-120b'],
224
+ cerebras: ['cerebras/gpt-oss-120b'],
225
+ alicode: ['alicode/qwen3.5-plus', 'alicode/qwen3-coder-plus'],
226
+ openai: ['openai/gpt-4o', 'openai/gpt-4.1'],
227
+ anthropic: ['anthropic/claude-sonnet-4', 'anthropic/claude-haiku-3.5'],
228
+ gemini: ['gemini/gemini-2.5-flash', 'gemini/gemini-2.5-pro'],
205
229
  };
206
230
  const sync = async () => {
207
231
  try {
@@ -429,8 +453,10 @@ function resolveCommandOnPath(command) {
429
453
  async function writeNative9RouterSyncScript(projectDir) {
430
454
  const syncScriptPath = path.join(projectDir, '.openclaw', '9router-smart-route-sync.js');
431
455
  await fs.ensureDir(path.dirname(syncScriptPath));
432
- await fs.ensureDir(getProject9RouterDataDir(projectDir));
433
- await fs.writeFile(syncScriptPath, build9RouterSmartRouteSyncScript(path.join(getProject9RouterDataDir(projectDir), 'db.json')));
456
+ // Use native home data dir so sync script writes to same place 9router binary reads from
457
+ const nativeDataDir = getNative9RouterDataDir();
458
+ await fs.ensureDir(nativeDataDir);
459
+ await fs.writeFile(syncScriptPath, build9RouterSmartRouteSyncScript(path.join(nativeDataDir, 'db.json')));
434
460
  return syncScriptPath;
435
461
  }
436
462
 
@@ -881,19 +907,19 @@ function startNative9RouterPm2({ isVi, projectDir, appName, syncScriptPath }) {
881
907
  execFileSync('pm2', [
882
908
  'start',
883
909
  routerLaunch.command,
884
- '--name',
885
- routerAppName,
886
- '--cwd',
887
- normalizedProjectDir,
888
- '--interpreter',
889
- 'none',
890
- '--',
891
- ...routerLaunch.args
892
- ], {
893
- cwd: projectDir,
894
- stdio: 'inherit',
895
- env: { ...process.env, ...routerLaunch.env }
896
- });
910
+ '--name',
911
+ routerAppName,
912
+ '--cwd',
913
+ normalizedProjectDir,
914
+ '--interpreter',
915
+ 'none',
916
+ '--',
917
+ ...routerLaunch.args
918
+ ], {
919
+ cwd: projectDir,
920
+ stdio: 'inherit',
921
+ env: { ...process.env, ...routerLaunch.env }
922
+ });
897
923
  if (syncScriptPath) {
898
924
  const syncAppName = `${appName}-9router-sync`;
899
925
  try {
@@ -905,26 +931,33 @@ function startNative9RouterPm2({ isVi, projectDir, appName, syncScriptPath }) {
905
931
  } catch {
906
932
  // ignore missing app
907
933
  }
908
- execFileSync('pm2', [
909
- 'start',
910
- normalizedSyncScriptPath,
911
- '--name',
912
- syncAppName,
913
- '--cwd',
914
- normalizedProjectDir,
915
- '--interpreter',
916
- process.execPath
917
- ], {
918
- cwd: projectDir,
919
- stdio: 'inherit',
920
- env: process.env
921
- });
922
- }
923
- runPm2Save({ projectDir, isVi });
924
- console.log(chalk.green(`\n✅ ${isVi ? '9Router da duoc khoi dong qua PM2.' : '9Router is running via PM2.'}`));
925
- console.log(chalk.gray(isVi ? ` Xem log: pm2 logs ${routerAppName}` : ` View logs: pm2 logs ${routerAppName}`));
926
- }
927
-
934
+ try {
935
+ execFileSync('pm2', [
936
+ 'start',
937
+ normalizedSyncScriptPath,
938
+ '--name',
939
+ syncAppName,
940
+ '--cwd',
941
+ normalizedProjectDir,
942
+ '--interpreter',
943
+ process.execPath,
944
+ '--no-autorestart',
945
+ ], {
946
+ cwd: projectDir,
947
+ stdio: 'inherit',
948
+ env: process.env
949
+ });
950
+ } catch (syncErr) {
951
+ console.log(chalk.yellow(isVi
952
+ ? `\n⚠️ Khong the tu dong khoi dong sync script qua PM2.`
953
+ : `\n⚠️ Could not auto-start 9router sync script via PM2.`));
954
+ }
955
+ }
956
+ runPm2Save({ projectDir, isVi });
957
+ console.log(chalk.green(`\n✅ ${isVi ? '9Router da duoc khoi dong qua PM2.' : '9Router is running via PM2.'}`));
958
+ console.log(chalk.gray(isVi ? ` Xem log: pm2 logs ${routerAppName}` : ` View logs: pm2 logs ${routerAppName}`));
959
+ }
960
+
928
961
  async function ensureProjectRuntimeDirs(projectDir, isVi) {
929
962
  await fs.ensureDir(path.join(projectDir, '.openclaw'));
930
963
  await fs.ensureDir(getProject9RouterDataDir(projectDir));
@@ -2274,6 +2307,20 @@ async function main() {
2274
2307
  );
2275
2308
  // Generate ecosystem.config.js for PM2 native multi-bot
2276
2309
  if (deployMode === 'native') {
2310
+ // Also write config to ~/.openclaw/ — openclaw binary on Linux/Mac reads from home dir
2311
+ const homeClawDir = path.join(os.homedir(), '.openclaw');
2312
+ await fs.ensureDir(homeClawDir);
2313
+ const homeConfig = JSON.parse(JSON.stringify(sharedConfig));
2314
+ for (const agent of (homeConfig.agents && homeConfig.agents.list || [])) {
2315
+ // workspace is relative to projectDir (.openclaw/workspace-X); agentDir is relative to rootClawDir (agents/X/agent)
2316
+ if (agent.workspace && !path.isAbsolute(agent.workspace)) agent.workspace = path.join(projectDir, agent.workspace);
2317
+ if (agent.agentDir && !path.isAbsolute(agent.agentDir)) agent.agentDir = path.join(rootClawDir, agent.agentDir);
2318
+ }
2319
+ await fs.writeJson(path.join(homeClawDir, 'openclaw.json'), homeConfig, { spaces: 2 });
2320
+ if (Object.keys(authProfilesJson).length > 0) {
2321
+ await fs.writeJson(path.join(homeClawDir, 'auth-profiles.json'), authProfilesJson, { spaces: 2 });
2322
+ }
2323
+ const safeRootClawDir = rootClawDir.replace(/\\/g, '/');
2277
2324
  const pm2Apps = [
2278
2325
  ' {',
2279
2326
  ` name: 'openclaw-multibot',`,
@@ -2283,7 +2330,11 @@ async function main() {
2283
2330
  ` interpreter: 'none',`,
2284
2331
  ` autorestart: true,`,
2285
2332
  ` watch: false,`,
2286
- ` env: { NODE_ENV: 'production' }`,
2333
+ ` env: {`,
2334
+ ` NODE_ENV: 'production',`,
2335
+ ` OPENCLAW_HOME: '\',`,
2336
+ ` OPENCLAW_STATE_DIR: '\',`,
2337
+ ` }`,
2287
2338
  ' }',
2288
2339
  ].join('\n');
2289
2340
  const ecosystemContent = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-openclaw-bot",
3
- "version": "5.6.6",
3
+ "version": "5.6.8",
4
4
  "description": "Interactive CLI installer for OpenClaw Bot",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {