fogact 1.1.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/LICENSE +21 -0
- package/README.md +244 -0
- package/README.zh-CN.md +244 -0
- package/bin/cli.js +9 -0
- package/bin/web-server.js +1434 -0
- package/config/upstream.example.json +14 -0
- package/frontend/activate.html +249 -0
- package/frontend/admin/admin-panel-v2.js +1899 -0
- package/frontend/admin/index.html +705 -0
- package/frontend/assets/market-ui.css +1876 -0
- package/frontend/color-test.html +136 -0
- package/frontend/index.html +191 -0
- package/frontend/user/assets/AnnouncementDetail-Dvxmwz0A.js +12 -0
- package/frontend/user/assets/Announcements-CS1tF2mx.js +11 -0
- package/frontend/user/assets/CardBind-CsCxihhP.js +21 -0
- package/frontend/user/assets/CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl.js +1 -0
- package/frontend/user/assets/CardDescription.vue_vue_type_script_setup_true_lang-D-v5Pl7F.js +1 -0
- package/frontend/user/assets/CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5.js +1 -0
- package/frontend/user/assets/Dashboard-rPsmltm5.js +51 -0
- package/frontend/user/assets/DashboardLayout-BUCWGlXC.css +1 -0
- package/frontend/user/assets/DashboardLayout-DDkxHYFj.js +80 -0
- package/frontend/user/assets/Input.vue_vue_type_script_setup_true_lang-B0SyPmYb.js +6 -0
- package/frontend/user/assets/Label.vue_vue_type_script_setup_true_lang-CxYORSgN.js +1 -0
- package/frontend/user/assets/Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ.js +1 -0
- package/frontend/user/assets/QuotaPack-B_tJ7Psm.js +6 -0
- package/frontend/user/assets/Renewal-BSDhDmwv.js +6 -0
- package/frontend/user/assets/ScrollArea.vue_vue_type_script_setup_true_lang-DMYwcfpz.js +1 -0
- package/frontend/user/assets/Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_.js +1 -0
- package/frontend/user/assets/Settings-CBdAa3lw.js +11 -0
- package/frontend/user/assets/TooltipTrigger.vue_vue_type_script_setup_true_lang-DtSBjzGo.js +16 -0
- package/frontend/user/assets/Welcome-7IfzEli4.css +1 -0
- package/frontend/user/assets/Welcome-Dtfp6oER.js +1 -0
- package/frontend/user/assets/_plugin-vue_export-helper-5cjT4u0R.js +16 -0
- package/frontend/user/assets/activity-wYWtyqTJ.js +6 -0
- package/frontend/user/assets/announcement-35mOnjRL.js +16 -0
- package/frontend/user/assets/calendar-BFNuCata.js +6 -0
- package/frontend/user/assets/chart-vendor-CULJE59K.js +37 -0
- package/frontend/user/assets/chevron-down-kDbuU1Py.js +6 -0
- package/frontend/user/assets/chevron-right-BayASIm0.js +6 -0
- package/frontend/user/assets/eye-CY62vip0.js +6 -0
- package/frontend/user/assets/gauge-C5NQ-mV8.js +6 -0
- package/frontend/user/assets/index-B8QSyYhS.css +1 -0
- package/frontend/user/assets/index-Da98HOxL.js +91 -0
- package/frontend/user/assets/link-2-DT5R5nGO.js +6 -0
- package/frontend/user/assets/package-rUbExUEn.js +6 -0
- package/frontend/user/assets/plus-CQc6C8wG.js +11 -0
- package/frontend/user/assets/refresh-cw-Y9hCloPL.js +6 -0
- package/frontend/user/assets/useUserPageRefresh-BYZvpNR9.js +1 -0
- package/frontend/user/assets/zap-l5zbZqrM.js +11 -0
- package/frontend/user/index.html +67 -0
- package/install.sh +402 -0
- package/lib/commands/activate.js +144 -0
- package/lib/commands/restore.js +102 -0
- package/lib/commands/test.js +40 -0
- package/lib/config/claude.js +81 -0
- package/lib/config/codex.js +164 -0
- package/lib/config/upstream.js +79 -0
- package/lib/index.js +164 -0
- package/lib/platforms/claude-code.js +35 -0
- package/lib/platforms/codex-cli.js +35 -0
- package/lib/platforms/editor-codex.js +138 -0
- package/lib/platforms/index.js +32 -0
- package/lib/platforms/openclaw.js +118 -0
- package/lib/platforms/opencode.js +89 -0
- package/lib/services/activation-orchestrator.js +666 -0
- package/lib/services/backup-service.js +162 -0
- package/lib/services/cliproxy-api.js +174 -0
- package/lib/services/database.js +461 -0
- package/lib/services/newapi.js +97 -0
- package/lib/services/node-service.js +49 -0
- package/lib/utils/json-file.js +33 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FogMaly
|
|
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
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# FogAct
|
|
2
|
+
|
|
3
|
+
[简体中文](./README.zh-CN.md) | English
|
|
4
|
+
|
|
5
|
+
FogAct is a multi-platform activation helper for Codex, Claude Code, OpenCode and OpenClaw. It provides one-command VPS bootstrap, activation-code based setup, direct NewAPI key setup, config backup/restore, and a local Web UI.
|
|
6
|
+
|
|
7
|
+
## 🚀 One-command Install
|
|
8
|
+
|
|
9
|
+
Run the terminal activation menu directly with npx:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx fogact
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Do not use `npm fogact`; npm treats that as a built-in npm subcommand. Use `npx fogact`.
|
|
16
|
+
|
|
17
|
+
For a clean VPS without Node.js/npm, copy this command. It can install Node.js automatically when missing, install the latest `fogact` npm package, and prepare the CLI without requiring git or npx.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Install and activate Codex with an activation code:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- \
|
|
27
|
+
--service codex \
|
|
28
|
+
--code YOUR_ACTIVATION_CODE \
|
|
29
|
+
--cliproxy-api-base https://your-activator.example.com
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Install and activate Claude Code with an activation code:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- \
|
|
36
|
+
--service claude \
|
|
37
|
+
--code YOUR_ACTIVATION_CODE \
|
|
38
|
+
--cliproxy-api-base https://your-activator.example.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Install and activate directly with a NewAPI key:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- \
|
|
45
|
+
--service codex \
|
|
46
|
+
--base-url https://newapi.example.com \
|
|
47
|
+
--api-key sk-your-upstream-key
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Start the local Web UI after install:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- --web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> Minimum bootstrap requirement: the machine needs `curl` or `wget` to download the script. The script handles Node.js/npm installation on common Linux distributions.
|
|
57
|
+
|
|
58
|
+
## What It Does
|
|
59
|
+
|
|
60
|
+
- Installs and exposes `fogact` and `fogact-web` commands, with legacy `cliproxy-activator`, `cliproxy-web`, `fogidc-activator`, and `fogidc-web` aliases.
|
|
61
|
+
- Activates Codex CLI and Claude Code by writing their local config files.
|
|
62
|
+
- Optionally configures OpenCode, OpenClaw, VSCode Codex plugin, and Cursor Codex plugin when selected or detected.
|
|
63
|
+
- Reads activation-code capabilities so users only see supported services/platforms.
|
|
64
|
+
- Verifies direct NewAPI keys through `/v1/models` before writing config.
|
|
65
|
+
- Backs up existing config before writing changes.
|
|
66
|
+
- Provides a local Web UI for users, admin management, activation codes, and settings.
|
|
67
|
+
|
|
68
|
+
## Supported Targets
|
|
69
|
+
|
|
70
|
+
| Target | Service | Default behavior |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| Codex CLI | Codex | Creates `~/.codex/config.toml` and `~/.codex/auth.json` |
|
|
73
|
+
| Claude Code | Claude | Creates `~/.claude/settings.json` and `~/.claude.json` |
|
|
74
|
+
| OpenCode | Codex / Claude | Configures when installed or selected with `--all` / `--platforms` |
|
|
75
|
+
| OpenClaw | Codex / Claude | Configures when installed or selected with `--all` / `--platforms` |
|
|
76
|
+
| VSCode Codex plugin | Codex | Patches only when compatible plugin files are detected |
|
|
77
|
+
| Cursor Codex plugin | Codex | Patches only when compatible plugin files are detected |
|
|
78
|
+
|
|
79
|
+
## Install Options
|
|
80
|
+
|
|
81
|
+
### npx
|
|
82
|
+
|
|
83
|
+
Run the activator directly, matching the `npx yunyi-activator` style:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx fogact
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### npm global install
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install -g fogact
|
|
93
|
+
fogact
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### GitHub source
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/FogMaly/cliproxy-activator.git
|
|
100
|
+
cd cliproxy-activator
|
|
101
|
+
npm install
|
|
102
|
+
node bin/cli.js --help
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### GitHub bootstrap from source
|
|
106
|
+
|
|
107
|
+
The bootstrap installs from npm by default. To clone and run directly from GitHub source instead:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- --method github
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Activation Usage
|
|
114
|
+
|
|
115
|
+
### Activation code / CDK mode
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
export CLIPROXY_API_BASE="https://your-activator.example.com"
|
|
119
|
+
fogact wizard --code YOUR_ACTIVATION_CODE --yes
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Activate a specific service:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
fogact wizard --service codex --code YOUR_ACTIVATION_CODE --yes
|
|
126
|
+
fogact wizard --service claude --code YOUR_ACTIVATION_CODE --yes
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Activate selected platforms only:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
fogact wizard --service codex --platforms codex-cli,opencode --yes
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Direct NewAPI mode
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
export NEWAPI_BASE_URL="https://newapi.example.com"
|
|
139
|
+
export NEWAPI_API_KEY="sk-your-upstream-key"
|
|
140
|
+
fogact activate --service codex --yes
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Skip upstream verification for local dry-runs:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
fogact activate --service codex --api-key sk-test --yes --skip-verify
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Legacy node-switching activation-code mode is still available:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
fogact activate --service codex --code YOUR_ACTIVATION_CODE --legacy
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Web UI
|
|
156
|
+
|
|
157
|
+
Start the local Web UI:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
fogact-web
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Or from this repository:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npm run web
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Default endpoints:
|
|
170
|
+
|
|
171
|
+
- User UI: `http://localhost:34020/`
|
|
172
|
+
- Admin UI: `http://localhost:34020/admin/`
|
|
173
|
+
|
|
174
|
+
Useful environment variables:
|
|
175
|
+
|
|
176
|
+
- `PORT`: override the default port `34020`
|
|
177
|
+
- `ADMIN_PASSWORD`: override the default admin password `admin123`
|
|
178
|
+
- `SERVER_TIMEZONE`: override the default timezone `Asia/Shanghai`
|
|
179
|
+
- `NEWAPI_BASE_URL`: upstream NewAPI base URL for CLI activation
|
|
180
|
+
- `NEWAPI_API_KEY`: upstream NewAPI key for CLI activation
|
|
181
|
+
- `CLIPROXY_API_BASE`: activation-code backend URL for CLI code mode
|
|
182
|
+
- `CLIPROXY_UPSTREAM_CONFIG`: custom path for upstream config JSON
|
|
183
|
+
- `FOGIDC_BACKUP_DIR`: custom backup directory for activation config backups
|
|
184
|
+
|
|
185
|
+
## Commands
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
fogact
|
|
189
|
+
fogact web
|
|
190
|
+
fogact interactive
|
|
191
|
+
fogact wizard [--code <activation-code>] [--platforms <ids>]
|
|
192
|
+
fogact activate --service <claude|codex> [--api-key <key>] [--yes]
|
|
193
|
+
fogact activate --service <claude|codex> --code <activation-code> --legacy
|
|
194
|
+
fogact test
|
|
195
|
+
fogact restore --service <claude|codex>
|
|
196
|
+
fogact-web
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Activation Code Capabilities
|
|
200
|
+
|
|
201
|
+
The wizard supports capability-scoped activation codes. The code verification API can return fields such as `service`, `services`, `platforms`, `targets`, or `capabilities`; the CLI normalizes them and filters activation choices automatically.
|
|
202
|
+
|
|
203
|
+
Examples:
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{ "service": "codex" }
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{ "capabilities": { "services": ["claude"], "platforms": ["claude-code", "opencode"] } }
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Supported platform ids are `codex-cli`, `claude-code`, `opencode`, `openclaw`, `vscode-codex-plugin`, and `cursor-codex-plugin`.
|
|
214
|
+
|
|
215
|
+
## Config Paths
|
|
216
|
+
|
|
217
|
+
- Codex CLI: `~/.codex/config.toml` and `~/.codex/auth.json`
|
|
218
|
+
- Claude Code: `~/.claude/settings.json` and `~/.claude.json`
|
|
219
|
+
- OpenCode: `~/.config/opencode/opencode.json`
|
|
220
|
+
- OpenClaw: `~/.openclaw/openclaw.json`
|
|
221
|
+
- Backups: `~/.fogact/backups/`
|
|
222
|
+
|
|
223
|
+
## Development
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npm install
|
|
227
|
+
npm test
|
|
228
|
+
npm run web
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Project layout:
|
|
232
|
+
|
|
233
|
+
- `bin/`: CLI and web server entry points
|
|
234
|
+
- `lib/`: command, service, platform and config implementation
|
|
235
|
+
- `frontend/`: static frontend assets
|
|
236
|
+
- `install.sh`: clean VPS bootstrap installer
|
|
237
|
+
- `docs/`: implementation notes and delivery documents
|
|
238
|
+
- `scripts/`: helper scripts
|
|
239
|
+
- `test/`: lightweight test scripts
|
|
240
|
+
- `data/`: local runtime data, intentionally not committed
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT. See `LICENSE`.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# FogAct
|
|
2
|
+
|
|
3
|
+
FogAct 是一个多平台激活辅助工具,支持 Codex、Claude Code、OpenCode 和 OpenClaw。它提供全新 VPS 一键安装、激活码/CDK 激活、NewAPI Key 直连激活、配置备份/恢复,以及本地 Web 管理界面。
|
|
4
|
+
|
|
5
|
+
[English](./README.md) | 简体中文
|
|
6
|
+
|
|
7
|
+
## 🚀 一键安装
|
|
8
|
+
|
|
9
|
+
直接用 npx 拉起终端激活菜单:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx fogact
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
不要使用 `npm fogact`;npm 会把它当作 npm 内置子命令。正确方式是 `npx fogact`。
|
|
16
|
+
|
|
17
|
+
如果是没有 Node.js/npm 的干净 VPS,再复制下面命令即可。脚本会在缺少 Node.js 时自动安装 Node.js,然后安装最新的 `fogact` npm 包;不要求机器预装 git 或 npx。
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
使用激活码安装并激活 Codex:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- \
|
|
27
|
+
--service codex \
|
|
28
|
+
--code YOUR_ACTIVATION_CODE \
|
|
29
|
+
--cliproxy-api-base https://your-activator.example.com
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
使用激活码安装并激活 Claude Code:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- \
|
|
36
|
+
--service claude \
|
|
37
|
+
--code YOUR_ACTIVATION_CODE \
|
|
38
|
+
--cliproxy-api-base https://your-activator.example.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
使用 NewAPI Key 直连安装并激活:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- \
|
|
45
|
+
--service codex \
|
|
46
|
+
--base-url https://newapi.example.com \
|
|
47
|
+
--api-key sk-your-upstream-key
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
安装后启动本地 Web UI:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- --web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> 最低引导要求:机器至少需要 `curl` 或 `wget` 用来下载脚本。常见 Linux 发行版上的 Node.js/npm 安装会由脚本自动处理。
|
|
57
|
+
|
|
58
|
+
## 功能说明
|
|
59
|
+
|
|
60
|
+
- 安装并提供 `fogact`、`fogact-web` 命令,同时保留 `cliproxy-activator`、`cliproxy-web`、`fogidc-activator`、`fogidc-web` 兼容别名。
|
|
61
|
+
- 为 Codex CLI 和 Claude Code 写入本地配置文件完成激活。
|
|
62
|
+
- 可按需配置 OpenCode、OpenClaw、VSCode Codex 插件和 Cursor Codex 插件。
|
|
63
|
+
- 会读取激活码能力范围,只展示该激活码支持的服务和平台。
|
|
64
|
+
- NewAPI Key 直连模式会先通过 `/v1/models` 验证可用性。
|
|
65
|
+
- 写入配置前会自动备份已有配置。
|
|
66
|
+
- 提供本地 Web UI,用于用户页、管理后台、激活码和上游设置管理。
|
|
67
|
+
|
|
68
|
+
## 支持目标
|
|
69
|
+
|
|
70
|
+
| 目标 | 服务 | 默认行为 |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| Codex CLI | Codex | 创建 `~/.codex/config.toml` 和 `~/.codex/auth.json` |
|
|
73
|
+
| Claude Code | Claude | 创建 `~/.claude/settings.json` 和 `~/.claude.json` |
|
|
74
|
+
| OpenCode | Codex / Claude | 已安装或通过 `--all` / `--platforms` 选择时配置 |
|
|
75
|
+
| OpenClaw | Codex / Claude | 已安装或通过 `--all` / `--platforms` 选择时配置 |
|
|
76
|
+
| VSCode Codex 插件 | Codex | 仅在检测到兼容插件文件时修补 |
|
|
77
|
+
| Cursor Codex 插件 | Codex | 仅在检测到兼容插件文件时修补 |
|
|
78
|
+
|
|
79
|
+
## 安装方式
|
|
80
|
+
|
|
81
|
+
### npx
|
|
82
|
+
|
|
83
|
+
直接运行激活器,操作方式对齐 `npx yunyi-activator`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx fogact
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### npm 全局安装
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install -g fogact
|
|
93
|
+
fogact
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### GitHub 源码
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/FogMaly/cliproxy-activator.git
|
|
100
|
+
cd cliproxy-activator
|
|
101
|
+
npm install
|
|
102
|
+
node bin/cli.js --help
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 通过 GitHub bootstrap 安装源码版
|
|
106
|
+
|
|
107
|
+
bootstrap 默认安装 npm 包。如果想直接克隆并运行 GitHub 源码版:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
curl -fsSL https://raw.githubusercontent.com/FogMaly/cliproxy-activator/main/install.sh | sh -s -- --method github
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 激活用法
|
|
114
|
+
|
|
115
|
+
### 激活码 / CDK 模式
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
export CLIPROXY_API_BASE="https://your-activator.example.com"
|
|
119
|
+
fogact wizard --code YOUR_ACTIVATION_CODE --yes
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
指定服务:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
fogact wizard --service codex --code YOUR_ACTIVATION_CODE --yes
|
|
126
|
+
fogact wizard --service claude --code YOUR_ACTIVATION_CODE --yes
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
只激活指定平台:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
fogact wizard --service codex --platforms codex-cli,opencode --yes
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### NewAPI Key 直连模式
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
export NEWAPI_BASE_URL="https://newapi.example.com"
|
|
139
|
+
export NEWAPI_API_KEY="sk-your-upstream-key"
|
|
140
|
+
fogact activate --service codex --yes
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
本地测试时跳过上游验证:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
fogact activate --service codex --api-key sk-test --yes --skip-verify
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
旧版节点切换激活码模式仍然保留:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
fogact activate --service codex --code YOUR_ACTIVATION_CODE --legacy
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Web UI
|
|
156
|
+
|
|
157
|
+
启动本地 Web UI:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
fogact-web
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
或在源码仓库中运行:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npm run web
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
默认地址:
|
|
170
|
+
|
|
171
|
+
- 用户页面:`http://localhost:34020/`
|
|
172
|
+
- 管理后台:`http://localhost:34020/admin/`
|
|
173
|
+
|
|
174
|
+
常用环境变量:
|
|
175
|
+
|
|
176
|
+
- `PORT`:覆盖默认端口 `34020`
|
|
177
|
+
- `ADMIN_PASSWORD`:覆盖默认管理密码 `admin123`
|
|
178
|
+
- `SERVER_TIMEZONE`:覆盖默认时区 `Asia/Shanghai`
|
|
179
|
+
- `NEWAPI_BASE_URL`:CLI 激活使用的 NewAPI 上游地址
|
|
180
|
+
- `NEWAPI_API_KEY`:CLI 激活使用的 NewAPI Key
|
|
181
|
+
- `CLIPROXY_API_BASE`:激活码模式使用的激活后台地址
|
|
182
|
+
- `CLIPROXY_UPSTREAM_CONFIG`:自定义上游配置 JSON 路径
|
|
183
|
+
- `FOGIDC_BACKUP_DIR`:自定义激活配置备份目录
|
|
184
|
+
|
|
185
|
+
## 命令列表
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
fogact
|
|
189
|
+
fogact web
|
|
190
|
+
fogact interactive
|
|
191
|
+
fogact wizard [--code <activation-code>] [--platforms <ids>]
|
|
192
|
+
fogact activate --service <claude|codex> [--api-key <key>] [--yes]
|
|
193
|
+
fogact activate --service <claude|codex> --code <activation-code> --legacy
|
|
194
|
+
fogact test
|
|
195
|
+
fogact restore --service <claude|codex>
|
|
196
|
+
fogact-web
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## 激活码能力范围
|
|
200
|
+
|
|
201
|
+
向导支持按能力范围限制激活码。校验接口可返回 `service`、`services`、`platforms`、`targets` 或 `capabilities` 等字段;CLI 会自动归一化并过滤可选服务和平台。
|
|
202
|
+
|
|
203
|
+
示例:
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{ "service": "codex" }
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{ "capabilities": { "services": ["claude"], "platforms": ["claude-code", "opencode"] } }
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
支持的平台 ID:`codex-cli`、`claude-code`、`opencode`、`openclaw`、`vscode-codex-plugin`、`cursor-codex-plugin`。
|
|
214
|
+
|
|
215
|
+
## 配置路径
|
|
216
|
+
|
|
217
|
+
- Codex CLI:`~/.codex/config.toml` 和 `~/.codex/auth.json`
|
|
218
|
+
- Claude Code:`~/.claude/settings.json` 和 `~/.claude.json`
|
|
219
|
+
- OpenCode:`~/.config/opencode/opencode.json`
|
|
220
|
+
- OpenClaw:`~/.openclaw/openclaw.json`
|
|
221
|
+
- 备份目录:`~/.fogact/backups/`
|
|
222
|
+
|
|
223
|
+
## 开发
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npm install
|
|
227
|
+
npm test
|
|
228
|
+
npm run web
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
项目结构:
|
|
232
|
+
|
|
233
|
+
- `bin/`:CLI 和 Web 服务入口
|
|
234
|
+
- `lib/`:命令、服务、平台和配置实现
|
|
235
|
+
- `frontend/`:静态前端资源
|
|
236
|
+
- `install.sh`:全新 VPS bootstrap 安装脚本
|
|
237
|
+
- `docs/`:实现说明和交付文档
|
|
238
|
+
- `scripts/`:辅助脚本
|
|
239
|
+
- `test/`:轻量测试脚本
|
|
240
|
+
- `data/`:本地运行数据,不提交仓库
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT. See `LICENSE`.
|