@zi.yi/openclaw-easy 1.0.0 → 1.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/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  > **One-command setup for [OpenClaw](https://github.com/anthropics/openclaw) with built-in API key.**
8
8
 
9
- OpenClaw 是一个自托管 AI 助手网关,可以连接 WhatsApp、Telegram、Discord 等聊天应用到 AI 编码助手。这个工具让你一键完成配置,内置 GLM-4-Flash 模型。
9
+ OpenClaw 是一个自托管 AI 助手网关,可以连接 WhatsApp、Telegram、Discord 等聊天应用到 AI 编码助手。这个工具让你一键完成配置,内置免费 OpenRouter 模型。
10
10
 
11
11
  ## 特点
12
12
 
@@ -15,6 +15,17 @@ OpenClaw 是一个自托管 AI 助手网关,可以连接 WhatsApp、Telegram
15
15
  - **一键安装** - 一条命令完成所有配置
16
16
  - **安全** - API key 加密存储
17
17
 
18
+ ## 平台支持
19
+
20
+ | 平台 | 支持程度 | 说明 |
21
+ |------|----------|------|
22
+ | **macOS** | ✅ 完全支持 | 守护进程、开机自启 |
23
+ | **Linux** | ✅ 完全支持 | systemd、开机自启 |
24
+ | **Windows + WSL2** | ✅ 完全支持 | 推荐方式 |
25
+ | **Windows 原生** | ⚠️ 有限支持 | 需手动启动,无守护进程 |
26
+
27
+ > 💡 **Windows 用户建议**:使用 WSL2 获得完整的后台运行体验。查看 [Windows 使用手册](windows-使用手册.md)
28
+
18
29
  ## 快速开始
19
30
 
20
31
  ### 安装
@@ -32,7 +43,7 @@ openclaw-easy
32
43
  ```
33
44
 
34
45
  默认配置:
35
- - 模型:`glm-4-flash`(通过 zai provider)
46
+ - 模型:`arcee-ai/trinity-large-preview:free`
36
47
 
37
48
  **方式二:使用自己的 API key**
38
49
 
@@ -69,7 +80,7 @@ npx openclaw agent --message "你好"
69
80
 
70
81
  ### Q: 内置的是什么模型?
71
82
 
72
- A: 内置的是 GLM-4-Flash 模型(通过 zai provider),适合日常使用。
83
+ A: 内置的是 OpenRouter Trinity 模型,适合日常使用。
73
84
 
74
85
  ### Q: 如何更换模型?
75
86
 
@@ -90,7 +101,7 @@ npx openclaw uninstall # 完全卸载 OpenClaw
90
101
 
91
102
  ```bash
92
103
  # 克隆仓库
93
- git clone https://github.com/hzzzzz-1/openclaw-easy.git
104
+ git clone https://github.com/ZiyiSpace/openclaw-easy.git
94
105
  cd openclaw-easy
95
106
 
96
107
  # 安装依赖
@@ -101,17 +112,17 @@ npm install -g .
101
112
  openclaw-easy
102
113
 
103
114
  # 发布到 npm(需要设置环境变量)
104
- BUILTIN_API_KEY="your-api-key" BUILTIN_MODEL="glm-4.7-flash" npm publish --access public
115
+ BUILTIN_API_KEY="your-api-key" BUILTIN_MODEL="arcee-ai/trinity-large-preview:free" npm publish --access public
105
116
  ```
106
117
 
107
118
  ## 致谢
108
119
 
109
120
  - [OpenClaw](https://github.com/anthropics/openclaw) - 核心项目
110
- - [GLM](https://open.bigmodel.cn/) - 提供内置 API 支持
121
+ - [OpenRouter](https://openrouter.ai/) - 提供 API 支持
111
122
 
112
123
  ## GitHub 仓库
113
124
 
114
- https://github.com/hzzzzz-1/openclaw-easy
125
+ https://github.com/ZiyiSpace/openclaw-easy
115
126
 
116
127
  ## License
117
128
 
@@ -10,6 +10,11 @@ import { createInterface } from "node:readline";
10
10
  const require = createRequire(import.meta.url);
11
11
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
12
 
13
+ // 平台检测
14
+ const isWindows = process.platform === 'win32';
15
+ const isMac = process.platform === 'darwin';
16
+ const isLinux = process.platform === 'linux';
17
+
13
18
  // 内部密钥(混淆)
14
19
  const _k = "openclaw-easy-secret-2026";
15
20
  const _0 = "d"; // API key
@@ -130,7 +135,7 @@ async function main() {
130
135
  } else {
131
136
  finalApiKey = userApiKey;
132
137
  console.log("\n✓ 使用你提供的 API key");
133
- // 用户用自己的 key,不强制使用 GLM 配置
138
+ // 用户用自己的 key,不强制使用内置模型配置
134
139
  finalModel = null;
135
140
  }
136
141
  } else {
@@ -199,21 +204,28 @@ async function main() {
199
204
  apiKeyParam = "--zai-api-key";
200
205
  }
201
206
 
207
+ // 构建命令参数
208
+ const args = [
209
+ openclawCli,
210
+ "onboard",
211
+ "--non-interactive",
212
+ "--accept-risk",
213
+ "--flow",
214
+ "quickstart",
215
+ "--auth-choice",
216
+ authChoice,
217
+ apiKeyParam,
218
+ finalApiKey,
219
+ ];
220
+
221
+ // 仅在非 Windows 平台安装守护进程
222
+ if (!isWindows) {
223
+ args.push("--install-daemon");
224
+ }
225
+
202
226
  const run = spawnSync(
203
227
  process.execPath,
204
- [
205
- openclawCli,
206
- "onboard",
207
- "--non-interactive",
208
- "--accept-risk",
209
- "--flow",
210
- "quickstart",
211
- "--auth-choice",
212
- authChoice,
213
- apiKeyParam,
214
- finalApiKey,
215
- "--install-daemon"
216
- ],
228
+ args,
217
229
  {
218
230
  stdio: "inherit",
219
231
  env: {
@@ -233,16 +245,32 @@ async function main() {
233
245
  if (finalModel && run.status === 0) {
234
246
  updateOpenClawConfig(finalModel);
235
247
 
236
- // 停止 gateway(LaunchAgent 会自动重启)
237
- console.log("\n正在重启 OpenClaw Gateway...");
238
- spawnSync(
239
- process.execPath,
240
- [openclawCli, "gateway", "--stop"],
241
- { stdio: "inherit" }
242
- );
243
- console.log("\n✓ 配置完成!Gateway 正在自动启动...");
244
- console.log("\n运行以下命令打开控制面板:");
245
- console.log(" npx openclaw dashboard");
248
+ if (isWindows) {
249
+ // Windows:手动启动提示
250
+ console.log("\n✓ 配置完成!");
251
+ console.log("\n" + "=".repeat(50));
252
+ console.log("Windows 用户请手动启动:");
253
+ console.log("=".repeat(50));
254
+ console.log("\n【第一步】在当前终端启动 Gateway:");
255
+ console.log(" npx openclaw gateway");
256
+ console.log("\n⚠️ 请保持此终端窗口开启,关闭会停止服务");
257
+ console.log("\n【第二步】打开新的终端,启动控制面板:");
258
+ console.log(" npx openclaw dashboard");
259
+ console.log("\n" + "=".repeat(50));
260
+ console.log("💡 提示:推荐使用 WSL2 获得完整的后台运行体验");
261
+ console.log("=".repeat(50) + "\n");
262
+ } else {
263
+ // macOS/Linux:自动重启
264
+ console.log("\n正在重启 OpenClaw Gateway...");
265
+ spawnSync(
266
+ process.execPath,
267
+ [openclawCli, "gateway", "--stop"],
268
+ { stdio: "inherit" }
269
+ );
270
+ console.log("\n✓ 配置完成!Gateway 正在自动启动...");
271
+ console.log("\n运行以下命令打开控制面板:");
272
+ console.log(" npx openclaw dashboard");
273
+ }
246
274
  }
247
275
 
248
276
  process.exit(run.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zi.yi/openclaw-easy",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "One-command setup for OpenClaw with built-in API key",
5
5
  "type": "module",
6
6
  "bin": {