@workclaw/cli 1.0.1 → 1.0.16
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 +165 -119
- package/dist/index-RP7oF6iQ.js +5032 -0
- package/dist/index.js +1 -1
- package/package.json +7 -5
- package/dist/bin/cli.d.ts +0 -3
- package/dist/bin/cli.d.ts.map +0 -1
- package/dist/index-M9uYCvsL.js +0 -1175
- package/dist/index.d.ts +0 -1
- package/dist/init/index.d.ts +0 -6
- package/dist/init/index.d.ts.map +0 -1
- package/dist/init/src/init.d.ts +0 -39
- package/dist/init/src/init.d.ts.map +0 -1
- package/dist/init/src/installer/base-installer.d.ts +0 -36
- package/dist/init/src/installer/base-installer.d.ts.map +0 -1
- package/dist/init/src/installer/box-installer.d.ts +0 -39
- package/dist/init/src/installer/box-installer.d.ts.map +0 -1
- package/dist/init/src/installer/index.d.ts +0 -4
- package/dist/init/src/installer/index.d.ts.map +0 -1
- package/dist/init/src/installer/local-installer.d.ts +0 -27
- package/dist/init/src/installer/local-installer.d.ts.map +0 -1
- package/dist/init/src/types/index.d.ts +0 -36
- package/dist/init/src/types/index.d.ts.map +0 -1
- package/dist/lib/command/base-command.d.ts +0 -16
- package/dist/lib/command/base-command.d.ts.map +0 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/utils/config-default.d.ts +0 -28
- package/dist/utils/config-default.d.ts.map +0 -1
- package/dist/utils/config.d.ts +0 -21
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/crypto.d.ts +0 -13
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/error.d.ts +0 -34
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/http.d.ts +0 -27
- package/dist/utils/http.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -16
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/path.d.ts +0 -23
- package/dist/utils/path.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,119 +1,165 @@
|
|
|
1
|
-
# WorkClaw CLI
|
|
2
|
-
|
|
3
|
-
WorkClaw CLI 是一个用于初始化和配置 WorkClaw 插件的命令行工具。
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
workclaw
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
workclaw
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
| --
|
|
50
|
-
| --
|
|
51
|
-
| --
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
# WorkClaw CLI
|
|
2
|
+
|
|
3
|
+
WorkClaw CLI 是一个用于初始化和配置 WorkClaw 插件的命令行工具。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 使用 npm 安装
|
|
9
|
+
npm install -g @workclaw/cli
|
|
10
|
+
|
|
11
|
+
# 使用 npx 直接运行(无需安装)
|
|
12
|
+
npx @workclaw/cli local
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
### 命令
|
|
18
|
+
|
|
19
|
+
本 CLI 提供两个命令:
|
|
20
|
+
|
|
21
|
+
| 命令 | 说明 |
|
|
22
|
+
|------|------|
|
|
23
|
+
| `workclaw local` | 本地账户安装(需要登录) |
|
|
24
|
+
| `workclaw box` | 盒子设备安装(无需登录) |
|
|
25
|
+
|
|
26
|
+
### 交互式初始化
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# 本地安装(需要手机号密码)
|
|
30
|
+
workclaw local
|
|
31
|
+
# 或使用 npx
|
|
32
|
+
npx @workclaw/cli local
|
|
33
|
+
|
|
34
|
+
# 盒子安装(需要 AppKey 和 AppSecret)
|
|
35
|
+
workclaw box
|
|
36
|
+
# 或使用 npx
|
|
37
|
+
npx @workclaw/cli box
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 命令行参数
|
|
41
|
+
|
|
42
|
+
#### local 命令参数
|
|
43
|
+
|
|
44
|
+
| 参数 | 缩写 | 说明 |
|
|
45
|
+
| ---------------- | -- | -------------- |
|
|
46
|
+
| --scenario | -s | 安装场景 |
|
|
47
|
+
| --env | -e | 环境 (test/prod) |
|
|
48
|
+
| --phone | 无 | 手机号码 |
|
|
49
|
+
| --user-pass | 无 | 用户密码 |
|
|
50
|
+
| --plugin-version | 无 | 插件版本号 |
|
|
51
|
+
| --debug | 无 | 调试模式 |
|
|
52
|
+
|
|
53
|
+
#### box 命令参数
|
|
54
|
+
|
|
55
|
+
| 参数 | 缩写 | 说明 |
|
|
56
|
+
| ---------------- | -- | -------------- |
|
|
57
|
+
| --scenario | -s | 安装场景 |
|
|
58
|
+
| --env | -e | 环境 (test/prod) |
|
|
59
|
+
| --app-key | 无 | App Key |
|
|
60
|
+
| --app-secret | 无 | App Secret |
|
|
61
|
+
| --plugin-version | 无 | 插件版本号 |
|
|
62
|
+
| --debug | 无 | 调试模式 |
|
|
63
|
+
|
|
64
|
+
### 安装场景
|
|
65
|
+
|
|
66
|
+
| 场景 | 说明 |
|
|
67
|
+
| ------------- | ------------ |
|
|
68
|
+
| windows-local | Windows 本地安装 |
|
|
69
|
+
| mac-local | macOS 本地安装 |
|
|
70
|
+
| linux-local | Linux 本地安装 |
|
|
71
|
+
|
|
72
|
+
### 环境
|
|
73
|
+
|
|
74
|
+
| 环境 | 说明 |
|
|
75
|
+
| ---- | ---- |
|
|
76
|
+
| test | 测试环境 |
|
|
77
|
+
| prod | 正式环境 |
|
|
78
|
+
|
|
79
|
+
## 示例
|
|
80
|
+
|
|
81
|
+
### 本地安装
|
|
82
|
+
|
|
83
|
+
#### 交互式安装(推荐新手使用)
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# 全局安装后运行
|
|
87
|
+
workclaw local
|
|
88
|
+
|
|
89
|
+
# 或使用 npx 直接运行
|
|
90
|
+
npx @workclaw/cli local
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### 仅指定手机号和密码
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
workclaw local --phone 13800138000 --user-pass your_password
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### 完整参数指定
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
workclaw local --scenario windows-local --env test --phone 13800138000 --user-pass your_password
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### 使用正式环境
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
workclaw local --env prod --phone 13800138000 --user-pass your_password
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### macOS 安装
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
workclaw local --scenario mac-local --phone 13800138000 --user-pass your_password
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Linux 安装
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
workclaw local --scenario linux-local --phone 13800138000 --user-pass your_password
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 盒子安装
|
|
124
|
+
|
|
125
|
+
盒子安装适用于不需要用户登录的场景,直接使用 AppKey 和 AppSecret 进行安装:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# 基本用法
|
|
129
|
+
workclaw box --app-key your_app_key --app-secret your_app_secret
|
|
130
|
+
|
|
131
|
+
# 指定环境
|
|
132
|
+
workclaw box --app-key your_app_key --app-secret your_app_secret --env prod
|
|
133
|
+
|
|
134
|
+
# 指定场景
|
|
135
|
+
workclaw box --app-key your_app_key --app-secret your_app_secret --scenario linux-local
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 指定插件版本
|
|
139
|
+
|
|
140
|
+
可以使用 `--plugin-version` 参数安装指定版本的插件(默认安装最新版):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# 安装指定版本
|
|
144
|
+
workclaw local --phone 13800138000 --user-pass your_password --plugin-version 1.0.0
|
|
145
|
+
workclaw box --app-key your_app_key --app-secret your_app_secret --plugin-version 1.0.0
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 调试模式
|
|
149
|
+
|
|
150
|
+
当安装失败时,可以使用 `--debug` 参数查看详细日志:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 本地安装 + 调试模式
|
|
154
|
+
workclaw local --phone 13800138000 --user-pass your_password --debug
|
|
155
|
+
|
|
156
|
+
# 盒子安装 + 调试模式
|
|
157
|
+
workclaw box --app-key your_app_key --app-secret your_app_secret --debug
|
|
158
|
+
|
|
159
|
+
# 完整参数 + 调试模式
|
|
160
|
+
workclaw local --scenario windows-local --env test --phone 13800138000 --user-pass your_password --debug
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## 许可证
|
|
164
|
+
|
|
165
|
+
MIT License
|