create-openclaw-bot 5.0.2 → 5.0.3
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/cli.js +28 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -5,8 +5,9 @@ import fs from 'fs-extra';
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import { spawn, execSync } from 'child_process';
|
|
8
|
-
const TELEGRAM_RELAY_PLUGIN_ID = 'telegram-multibot-relay';
|
|
9
|
-
|
|
8
|
+
const TELEGRAM_RELAY_PLUGIN_ID = 'openclaw-telegram-multibot-relay';
|
|
9
|
+
// Use plain npm package name — clawhub: protocol not supported in all OpenClaw versions
|
|
10
|
+
const TELEGRAM_RELAY_PLUGIN_SPEC = TELEGRAM_RELAY_PLUGIN_ID;
|
|
10
11
|
|
|
11
12
|
// Install command: only use clawhub: spec (published to ClawHub)
|
|
12
13
|
function buildRelayPluginInstallCommand(prefix = 'openclaw') {
|
|
@@ -1130,6 +1131,31 @@ ${hasBrowserDesktop ? ` extra_hosts:
|
|
|
1130
1131
|
buildTelegramPostInstallChecklist({ isVi, bots, groupId }),
|
|
1131
1132
|
'utf8',
|
|
1132
1133
|
);
|
|
1134
|
+
// Generate ecosystem.config.js for PM2 native multi-bot
|
|
1135
|
+
if (deployMode === 'native') {
|
|
1136
|
+
const pm2Apps = agentMetas.map((meta) => [
|
|
1137
|
+
' {',
|
|
1138
|
+
` name: '${meta.agentId}',`,
|
|
1139
|
+
` script: 'openclaw',`,
|
|
1140
|
+
` args: '--agent ${meta.agentId}',`,
|
|
1141
|
+
` cwd: '${projectDir.replace(/\\/g, '/')}',`,
|
|
1142
|
+
` interpreter: 'none',`,
|
|
1143
|
+
` autorestart: true,`,
|
|
1144
|
+
` watch: false,`,
|
|
1145
|
+
` env: { NODE_ENV: 'production' }`,
|
|
1146
|
+
' }',
|
|
1147
|
+
].join('\n')).join(',\n');
|
|
1148
|
+
const ecosystemContent = [
|
|
1149
|
+
'// PM2 ecosystem — run: pm2 start ecosystem.config.js',
|
|
1150
|
+
'module.exports = {',
|
|
1151
|
+
' apps: [',
|
|
1152
|
+
pm2Apps,
|
|
1153
|
+
' ]',
|
|
1154
|
+
'};',
|
|
1155
|
+
'',
|
|
1156
|
+
].join('\n');
|
|
1157
|
+
await fs.writeFile(path.join(projectDir, 'ecosystem.config.js'), ecosystemContent);
|
|
1158
|
+
}
|
|
1133
1159
|
installRelayPluginForProject(projectDir, isVi);
|
|
1134
1160
|
if (Object.keys(authProfilesJson).length > 0) {
|
|
1135
1161
|
await fs.writeJson(path.join(rootClawDir, 'auth-profiles.json'), authProfilesJson, { spaces: 2 });
|