create-openclaw-bot 4.0.1 → 4.0.2
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/LICENSE +21 -0
- package/README.md +43 -23
- package/README.vi.md +45 -23
- package/cli.js +90 -22
- package/docs/preview.png +0 -0
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tuan Minh Hole (Kent)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,28 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
# 🦞 OpenClaw Setup
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v4.0.1-0EA5E9?style=for-the-badge" alt="Version 4.0.1" /></a>
|
|
7
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup?tab=MIT-1-ov-file"><img src="https://img.shields.io/badge/LICENSE-MIT-success?style=for-the-badge" alt="MIT License" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/v/create-openclaw-bot?style=for-the-badge&label=CLI&color=2563EB&logo=npm&logoColor=white" alt="NPM Version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/dm/create-openclaw-bot?style=for-the-badge&color=22c55e" alt="NPM Downloads" /></a>
|
|
10
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup/stargazers"><img src="https://img.shields.io/github/stars/tuanminhhole/openclaw-setup?style=for-the-badge&color=eab308&logo=github&logoColor=white" alt="GitHub Stars" /></a>
|
|
11
|
+
</p>
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
[](https://openclaw.ai)
|
|
9
|
-
[](https://www.docker.com/)
|
|
10
|
-
[](https://t.me/BotFather)
|
|
11
|
-
[](#supported-channels)
|
|
13
|
+
An interactive <strong>CLI tool</strong> and <strong>Setup Wizard</strong> to deploy your own free AI Bot on Telegram or Zalo in minutes.
|
|
12
14
|
|
|
13
|
-
<
|
|
15
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup">
|
|
16
|
+
<img src="docs/preview.png" alt="OpenClaw Setup Hero Image" width="100%" style="border-radius: 8px; margin: 16px 0; border: 1px solid #333;" />
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<p style="margin-top: 16px;">
|
|
20
|
+
<img src="https://flagcdn.com/24x18/gb.png" alt="English" width="24" height="18" style="vertical-align: sub;"> <strong>English</strong> ·
|
|
21
|
+
<img src="https://flagcdn.com/24x18/vn.png" alt="Tiếng Việt" width="24" height="18" style="vertical-align: sub;"> <a href="README.vi.md">Tiếng Việt</a>
|
|
22
|
+
</p>
|
|
14
23
|
|
|
15
24
|
</div>
|
|
16
25
|
|
|
17
26
|
---
|
|
18
27
|
|
|
28
|
+
## 🆕 What's new in v4.0.1
|
|
29
|
+
- 🪄 **Fully Automated Setup**: Say goodbye to downloading ZIP files and manually copying configs. Everything is now fully automated with a single action.
|
|
30
|
+
- ⚡ **One-Command Install (`npx create-openclaw-bot`)**: Extremely convenient for VPS/SSH users — the script automatically creates the project directory, sets up the environment, and triggers `docker compose up -d` instantly.
|
|
31
|
+
- 🚀 **Zero-Restart Deployment**: Details like API Keys and Bot Tokens (which you input during setup) are automatically injected into `.env` before the bot boots for the first time. No restarts required!
|
|
32
|
+
- 🌐 **Browser Automation Setup**: Updated Windows Task Scheduler and Debug Mode scripts for smoother interaction with Web Apps.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
19
36
|
## ✨ Features
|
|
20
37
|
|
|
21
38
|
- 🤖 **Multi-channel** — Telegram, Zalo Bot API, or Zalo Personal
|
|
22
39
|
- 🧠 **Multi-provider AI** — Google Gemini, Claude, GPT-4o/Codex, OpenRouter, Ollama, 9Router
|
|
23
40
|
- 🧩 **Skills** — Web Search, Browser Automation, Memory, RAG, Code Interpreter, Image Gen...
|
|
24
41
|
- 🔌 **Plugins** — Voice Call, Matrix, MS Teams, Nostr
|
|
25
|
-
- 🔀 **9Router Proxy** —
|
|
26
|
-
- 🧙 **Setup Wizard** — Beautiful dark-themed
|
|
42
|
+
- 🔀 **9Router Proxy** — Auto-route your bot's traffic effectively!
|
|
43
|
+
- 🧙 **Setup Wizard** — Beautiful interactive shell (CLI) or dark-themed Web UI
|
|
27
44
|
- 🆓 **100% Free** — Google Gemini API free tier + Docker
|
|
28
45
|
- 🔒 **Secure** — API keys stay on your machine, never exposed
|
|
29
46
|
- ⚡ **3 minutes** — From zero to working AI bot
|
|
@@ -71,7 +88,20 @@ You need **3 things** (all free):
|
|
|
71
88
|
|
|
72
89
|
## 🚀 Quick Start
|
|
73
90
|
|
|
74
|
-
### Option A —
|
|
91
|
+
### 1️⃣ Option A — Interactive CLI (`npx`) [Recommended]
|
|
92
|
+
|
|
93
|
+
The fastest way to install OpenClaw is using the interactive NPM package.
|
|
94
|
+
|
|
95
|
+
1. **Open your Terminal (or Command Prompt).**
|
|
96
|
+
2. **Run the command:**
|
|
97
|
+
```bash
|
|
98
|
+
npx create-openclaw-bot
|
|
99
|
+
```
|
|
100
|
+
3. **Follow the interactive prompts** to configure your bot, keys, and paths!
|
|
101
|
+
|
|
102
|
+
<details>
|
|
103
|
+
<summary><b>2️⃣ Option B — GUI Setup Wizard (Web UI)</b></summary>
|
|
104
|
+
<br>
|
|
75
105
|
|
|
76
106
|
1. **Clone this repo:**
|
|
77
107
|
```bash
|
|
@@ -82,21 +112,11 @@ You need **3 things** (all free):
|
|
|
82
112
|
2. **Open `index.html`** in your browser — the Setup Wizard will guide you through:
|
|
83
113
|
- Choose your channel (Telegram / Zalo)
|
|
84
114
|
- Configure bot name, personality, AI model
|
|
85
|
-
-
|
|
86
|
-
- Generate all config files
|
|
115
|
+
- Generate all config files and `setup-openclaw.bat`
|
|
87
116
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
4. **Build & Run:**
|
|
91
|
-
```bash
|
|
92
|
-
cd docker/openclaw
|
|
93
|
-
docker compose build
|
|
94
|
-
docker compose up -d
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
5. **Test your bot** — send a message on Telegram or Zalo! 🎉
|
|
117
|
+
</details>
|
|
98
118
|
|
|
99
|
-
### Option
|
|
119
|
+
### 3️⃣ Option C — AI Agent (Antigravity)
|
|
100
120
|
|
|
101
121
|
1. Open [Antigravity IDE](https://antigravity.dev/)
|
|
102
122
|
2. Open this repo as workspace
|
package/README.vi.md
CHANGED
|
@@ -2,30 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
# 🦞 OpenClaw Setup
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v4.0.1-0EA5E9?style=for-the-badge" alt="Version 4.0.1" /></a>
|
|
7
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup?tab=MIT-1-ov-file"><img src="https://img.shields.io/badge/LICENSE-MIT-success?style=for-the-badge" alt="MIT License" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/v/create-openclaw-bot?style=for-the-badge&label=CLI&color=2563EB&logo=npm&logoColor=white" alt="NPM Version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/dm/create-openclaw-bot?style=for-the-badge&color=22c55e" alt="NPM Downloads" /></a>
|
|
10
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup/stargazers"><img src="https://img.shields.io/github/stars/tuanminhhole/openclaw-setup?style=for-the-badge&color=eab308&logo=github&logoColor=white" alt="GitHub Stars" /></a>
|
|
11
|
+
</p>
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
[](https://openclaw.ai)
|
|
9
|
-
[](https://www.docker.com/)
|
|
10
|
-
[](https://t.me/BotFather)
|
|
11
|
-
[](#kênh-hỗ-trợ)
|
|
13
|
+
Một công cụ trực quan <strong>Setup Wizard (UI)</strong> & <strong>CLI</strong> để tự tay build Bot AI trên Telegram và Zalo chỉ trong vài phút.
|
|
12
14
|
|
|
13
|
-
<
|
|
15
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup">
|
|
16
|
+
<img src="docs/preview.png" alt="OpenClaw Setup Hero Image" width="100%" style="border-radius: 8px; margin: 16px 0; border: 1px solid #333;" />
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<p style="margin-top: 16px;">
|
|
20
|
+
<img src="https://flagcdn.com/24x18/vn.png" alt="Tiếng Việt" width="24" height="18" style="vertical-align: sub;"> <strong>Tiếng Việt</strong> ·
|
|
21
|
+
<img src="https://flagcdn.com/24x18/gb.png" alt="English" width="24" height="18" style="vertical-align: sub;"> <a href="README.md">English</a>
|
|
22
|
+
</p>
|
|
14
23
|
|
|
15
24
|
</div>
|
|
16
25
|
|
|
17
26
|
---
|
|
18
27
|
|
|
28
|
+
## 🆕 Có gì mới ở bản 4.0.1
|
|
29
|
+
- 🪄 **Tự động hóa hoàn toàn**: Tạm biệt việc tải file ZIP và copy config thủ công! Giờ đây mọi thứ diễn ra tự động chỉ với 1 lượt click.
|
|
30
|
+
- ⚡ **Chỉ 1 lệnh duy nhất (`npx create-openclaw-bot`)**: Cực kỳ tiện lợi cho ae cài qua VPS/SSH — script sẽ tự động tạo thư mục, khởi tạo môi trường và tự động kích hoạt `docker compose up -d` ngay sau khi nhập xong.
|
|
31
|
+
- 🚀 **Zero-Restart Deployment**: API Keys và config được inject trực tiếp vào thư mục (bạn vẫn cần nhập từ Terminal, máy sẽ tự sinh vào file `.env` trước khi bot chạy lần đầu). Không cần phải restart lại container mất thời gian nữa.
|
|
32
|
+
- 🌐 **Browser Automation Setup**: Cập nhật tự động sinh file chạy Windows Task Scheduler và bật file thiết lập Debug mode tự động. Mở Zalo Mini app ngon lành.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
19
36
|
## ✨ Tính năng
|
|
20
37
|
|
|
21
38
|
- 🤖 **Đa kênh** — Telegram, Zalo Bot API, hoặc Zalo Cá nhân
|
|
22
39
|
- 🧠 **Đa model AI** — Google Gemini, Claude, GPT-4o, Ollama, OpenRouter, 9Router
|
|
23
40
|
- 🧩 **Skills** — Web Search, Browser Automation, Memory, RAG, Code Interpreter, Image Gen...
|
|
24
41
|
- 🔌 **Plugins** — Voice Call, Matrix, MS Teams, Nostr
|
|
25
|
-
- 🔀 **9Router Proxy** —
|
|
26
|
-
- 🧙 **Setup Wizard** —
|
|
42
|
+
- 🔀 **9Router Proxy** — Hệ thống Auto-route điều phối Bot tuyệt vời.
|
|
43
|
+
- 🧙 **Setup Wizard** — Chạy thẳng qua Terminal CLI hoặc giao diện web Web UI 4 bước
|
|
27
44
|
- 🆓 **100% Miễn phí** — Google Gemini API free tier + Docker
|
|
28
|
-
- 🔒 **An toàn** — API key
|
|
45
|
+
- 🔒 **An toàn** — API key không bao giờ bị lộ ra ngoài
|
|
46
|
+
- ⚡ **Siêu tốc** — Build thành công trong 3 phút
|
|
29
47
|
|
|
30
48
|
---
|
|
31
49
|
|
|
@@ -70,7 +88,20 @@ Bạn cần **3 thứ** (miễn phí hết):
|
|
|
70
88
|
|
|
71
89
|
## 🚀 Bắt đầu nhanh
|
|
72
90
|
|
|
73
|
-
### Cách A —
|
|
91
|
+
### 1️⃣ Cách A — Cài đặt bằng Terminal CLI (`npx`) [Tốt nhất]
|
|
92
|
+
|
|
93
|
+
Dùng NPX là cách cài chuẩn nhất:
|
|
94
|
+
|
|
95
|
+
1. **Mở Terminal (hoặc Command Prompt).**
|
|
96
|
+
2. **Gõ lệnh sau:**
|
|
97
|
+
```bash
|
|
98
|
+
npx create-openclaw-bot
|
|
99
|
+
```
|
|
100
|
+
3. **Làm theo các bước gợi ý trên Terminal** để đặt tên cho bot, setup tokens và nơi chứa file thư mục của bot.
|
|
101
|
+
|
|
102
|
+
<details>
|
|
103
|
+
<summary><b>2️⃣ Cách B — Cài đặt bằng Giao diện Setup Web (Web UI)</b></summary>
|
|
104
|
+
<br>
|
|
74
105
|
|
|
75
106
|
1. **Clone repo:**
|
|
76
107
|
```bash
|
|
@@ -82,21 +113,12 @@ Bạn cần **3 thứ** (miễn phí hết):
|
|
|
82
113
|
- Chọn kênh (Telegram / Zalo)
|
|
83
114
|
- Chọn AI model và plugins
|
|
84
115
|
- Cấu hình tên bot, tính cách
|
|
85
|
-
-
|
|
86
|
-
- Tự động generate tất cả config files
|
|
87
|
-
|
|
88
|
-
3. **Tạo file `.env`** (làm theo hướng dẫn trong wizard)
|
|
116
|
+
- Tự động generate tất cả config files về file `setup-openclaw.bat`
|
|
89
117
|
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
cd docker/openclaw
|
|
93
|
-
docker compose build
|
|
94
|
-
docker compose up -d
|
|
95
|
-
```
|
|
118
|
+
</details>
|
|
96
119
|
|
|
97
|
-
5. **Test bot** — gửi tin nhắn trên Telegram hoặc Zalo! 🎉
|
|
98
120
|
|
|
99
|
-
### Cách
|
|
121
|
+
### 3️⃣ Cách C — Dùng AI Agent (Antigravity)
|
|
100
122
|
|
|
101
123
|
1. Mở [Antigravity IDE](https://antigravity.dev/)
|
|
102
124
|
2. Mở repo này làm workspace
|
package/cli.js
CHANGED
|
@@ -142,47 +142,115 @@ async function main() {
|
|
|
142
142
|
}
|
|
143
143
|
await fs.writeFile(path.join(projectDir, 'docker', 'openclaw', '.env'), envContent);
|
|
144
144
|
|
|
145
|
-
const dockerfile = `FROM
|
|
146
|
-
|
|
145
|
+
const dockerfile = `FROM node:22-slim
|
|
146
|
+
|
|
147
|
+
RUN apt-get update && apt-get install -y git curl${selectedSkills.includes('browser') ? ' socat' : ''} && rm -rf /var/lib/apt/lists/*
|
|
148
|
+
|
|
149
|
+
RUN npm install -g openclaw@latest
|
|
150
|
+
${selectedSkills.includes('browser') ? 'RUN npm install -g agent-browser playwright && npx playwright install chromium --with-deps && ln -f -s /root/.cache/ms-playwright/chromium-*/chrome-linux*/chrome /usr/bin/google-chrome\\n' : ''}
|
|
151
|
+
WORKDIR /root/.openclaw
|
|
152
|
+
|
|
153
|
+
EXPOSE 18791
|
|
154
|
+
|
|
155
|
+
CMD sh -c "node -e \\\\"const fs=require('fs'),p='/root/.openclaw/openclaw.json';if(fs.existsSync(p)){const c=JSON.parse(fs.readFileSync(p,'utf8'));c.tools=Object.assign({},c.tools,{profile:'full'});c.gateway=Object.assign({},c.gateway,{port:18791,bind:'0.0.0.0'});fs.writeFileSync(p,JSON.stringify(c,null,2));}\\\\" && ${selectedSkills.includes('browser') ? 'socat TCP-LISTEN:9222,fork,reuseaddr TCP:host.docker.internal:9222 & ' : ''}(sleep 5 && openclaw devices approve --latest 2>/dev/null || true) & openclaw gateway run"`;
|
|
156
|
+
|
|
147
157
|
await fs.writeFile(path.join(projectDir, 'docker', 'openclaw', 'Dockerfile'), dockerfile);
|
|
148
158
|
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
let compose = '';
|
|
160
|
+
if (providerKey === '9router') {
|
|
161
|
+
compose = `services:
|
|
162
|
+
ai-bot:
|
|
151
163
|
build: .
|
|
164
|
+
container_name: openclaw-bot
|
|
152
165
|
restart: always
|
|
153
|
-
env_file:
|
|
166
|
+
env_file:
|
|
167
|
+
- .env
|
|
168
|
+
depends_on:
|
|
169
|
+
- 9router
|
|
170
|
+
${selectedSkills.includes('browser') ? ` extra_hosts:
|
|
171
|
+
- "host.docker.internal:host-gateway"
|
|
172
|
+
` : ''} volumes:
|
|
173
|
+
- ../../.openclaw:/root/.openclaw
|
|
174
|
+
ports:
|
|
175
|
+
- "18789:18789"
|
|
176
|
+
|
|
177
|
+
9router:
|
|
178
|
+
image: node:22-slim
|
|
179
|
+
container_name: 9router
|
|
180
|
+
restart: always
|
|
181
|
+
entrypoint: >
|
|
182
|
+
/bin/sh -c "npm install -g 9router && [ ! -f /root/.9router/db.json ] && echo '{\\"combos\\":[{\\"id\\":\\"smart-route\\",\\"name\\":\\"smart-route\\",\\"alias\\":\\"smart-route\\",\\"models\\":[\\"cx/gpt-5.4\\",\\"ag/claude-opus-4-6-thinking\\",\\"cc/claude-opus-4-6\\",\\"gh/gpt-5.4\\",\\"ag/gemini-3.1-pro-high\\",\\"cc/claude-sonnet-4-6\\",\\"gh/claude-opus-4.6\\"]}]}' > /root/.9router/db.json; 9router"
|
|
183
|
+
environment:
|
|
184
|
+
- NINEROUTER_PORT=18789
|
|
185
|
+
- NINEROUTER_SECURE=false
|
|
154
186
|
volumes:
|
|
155
|
-
- ../../.
|
|
156
|
-
|
|
187
|
+
- ../../.9router:/root/.9router`;
|
|
188
|
+
} else {
|
|
189
|
+
compose = `services:
|
|
190
|
+
ai-bot:
|
|
191
|
+
build: .
|
|
192
|
+
container_name: openclaw-bot
|
|
193
|
+
restart: always
|
|
194
|
+
env_file: .env
|
|
157
195
|
${selectedSkills.includes('browser') ? ` extra_hosts:
|
|
158
196
|
- "host.docker.internal:host-gateway"
|
|
159
|
-
` : ''}
|
|
197
|
+
` : ''} volumes:
|
|
198
|
+
- ../../.openclaw:/root/.openclaw`;
|
|
199
|
+
}
|
|
200
|
+
|
|
160
201
|
await fs.writeFile(path.join(projectDir, 'docker', 'openclaw', 'docker-compose.yml'), compose);
|
|
161
202
|
|
|
162
|
-
|
|
203
|
+
const authProfileObj = {};
|
|
204
|
+
if (providerKey && !provider.isLocal) {
|
|
205
|
+
const authProviderName = providerKey === '9router' ? '9router' : 'openai';
|
|
206
|
+
authProfileObj[authProviderName] = [{
|
|
207
|
+
type: "api_key",
|
|
208
|
+
field: "key",
|
|
209
|
+
order: 1,
|
|
210
|
+
value: providerKey === '9router' ? "9r-dummy" : providerKeyVal
|
|
211
|
+
}];
|
|
212
|
+
if (providerKey !== '9router' && providerKey !== 'openai' && provider.baseURL) {
|
|
213
|
+
authProfileObj[authProviderName][0].url = provider.baseURL;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const agentId = botName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/-$/, '') || 'chat';
|
|
218
|
+
const modelsPrimary = providerKey === '9router' ? '9router/smart-route' : (providerKey === 'google' ? 'google/gemini-2.5-flash' : 'openai/gpt-4o');
|
|
219
|
+
|
|
220
|
+
await fs.ensureDir(path.join(projectDir, '.openclaw', 'agents', agentId, 'agent'));
|
|
221
|
+
await fs.writeJson(path.join(projectDir, '.openclaw', 'auth-profiles.json'), authProfileObj, { spaces: 2 });
|
|
222
|
+
await fs.writeJson(path.join(projectDir, '.openclaw', 'agents', agentId, 'agent', 'auth-profiles.json'), authProfileObj, { spaces: 2 });
|
|
163
223
|
|
|
164
224
|
const botConfig = {
|
|
165
|
-
meta: {
|
|
225
|
+
meta: { lastTouchedVersion: '2026.3.24' },
|
|
166
226
|
agents: {
|
|
167
227
|
defaults: {
|
|
168
|
-
model: { primary:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
}
|
|
228
|
+
model: { primary: modelsPrimary, fallbacks: [] },
|
|
229
|
+
compaction: { mode: 'safeguard' }
|
|
230
|
+
},
|
|
231
|
+
list: [{
|
|
232
|
+
id: agentId,
|
|
233
|
+
model: { primary: modelsPrimary, fallbacks: [] }
|
|
234
|
+
}]
|
|
176
235
|
},
|
|
177
|
-
|
|
236
|
+
commands: { native: 'auto', nativeSkills: 'auto', restart: true, ownerDisplay: 'raw' },
|
|
237
|
+
channels: {},
|
|
238
|
+
tools: { profile: 'full' },
|
|
239
|
+
gateway: {
|
|
240
|
+
port: 18791, mode: 'local', bind: '0.0.0.0',
|
|
241
|
+
auth: { mode: 'token', token: 'cli-dummy-token-xyz123' }
|
|
242
|
+
}
|
|
178
243
|
};
|
|
244
|
+
|
|
245
|
+
const identityContent = `# ${botName}\n\n${botDesc}\n\n${isVi ? 'Bạn là một trợ lý AI phân tích và tự động hóa do Kent đào tạo và cấu hình.' : 'You are an AI assistant configured by Kent.'}`;
|
|
246
|
+
await fs.writeFile(path.join(projectDir, '.openclaw', 'agents', agentId, 'agent', 'IDENTITY.md'), identityContent);
|
|
179
247
|
|
|
180
248
|
if (channelKey === 'telegram') {
|
|
181
|
-
botConfig.channels['telegram'] = { enabled: true };
|
|
249
|
+
botConfig.channels['telegram'] = { enabled: true, mode: 'polling' };
|
|
182
250
|
} else if (channelKey === 'zalo-personal') {
|
|
183
|
-
botConfig.channels['zalo
|
|
251
|
+
botConfig.channels['zalo'] = { enabled: true, provider: 'client', autoReply: true };
|
|
184
252
|
} else if (channelKey === 'zalo-bot') {
|
|
185
|
-
botConfig.channels['zalo
|
|
253
|
+
botConfig.channels['zalo'] = { enabled: true, provider: 'official_account' };
|
|
186
254
|
}
|
|
187
255
|
|
|
188
256
|
await fs.writeJson(path.join(projectDir, '.openclaw', 'openclaw.json'), botConfig, { spaces: 2 });
|
package/docs/preview.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-openclaw-bot",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "Interactive CLI for
|
|
3
|
+
"version": "4.0.2",
|
|
4
|
+
"description": "Interactive CLI installer for OpenClaw Bot",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-openclaw-bot": "./cli.js"
|