codexmate 0.0.21 → 0.0.22

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.
Files changed (114) hide show
  1. package/README.md +389 -284
  2. package/README.zh.md +321 -0
  3. package/cli/agents-files.js +224 -162
  4. package/cli/archive-helpers.js +446 -446
  5. package/cli/auth-profiles.js +359 -359
  6. package/cli/builtin-proxy.js +1044 -580
  7. package/cli/claude-proxy.js +998 -998
  8. package/cli/config-bootstrap.js +384 -384
  9. package/cli/config-health.js +338 -338
  10. package/cli/openai-bridge.js +950 -0
  11. package/cli/openclaw-config.js +629 -629
  12. package/cli/session-usage.concurrent.js +28 -0
  13. package/cli/session-usage.js +112 -0
  14. package/cli/session-usage.models.js +176 -0
  15. package/cli/skills.js +1141 -1141
  16. package/cli/zip-commands.js +510 -510
  17. package/cli.js +13214 -13129
  18. package/lib/cli-file-utils.js +151 -151
  19. package/lib/cli-models-utils.js +419 -419
  20. package/lib/cli-network-utils.js +164 -164
  21. package/lib/cli-path-utils.js +69 -69
  22. package/lib/cli-session-utils.js +121 -121
  23. package/lib/cli-sessions.js +386 -386
  24. package/lib/cli-utils.js +155 -155
  25. package/lib/download-artifacts.js +77 -77
  26. package/lib/mcp-stdio.js +440 -440
  27. package/lib/task-orchestrator.js +869 -869
  28. package/lib/text-diff.js +303 -303
  29. package/lib/workflow-engine.js +340 -340
  30. package/package.json +74 -74
  31. package/res/json5.min.js +1 -1
  32. package/res/logo.png +0 -0
  33. package/res/vue.global.prod.js +13 -13
  34. package/web-ui/app.js +575 -530
  35. package/web-ui/index.html +34 -33
  36. package/web-ui/logic.agents-diff.mjs +386 -386
  37. package/web-ui/logic.claude.mjs +168 -168
  38. package/web-ui/logic.mjs +5 -5
  39. package/web-ui/logic.runtime.mjs +128 -124
  40. package/web-ui/logic.sessions.mjs +614 -581
  41. package/web-ui/modules/api.mjs +90 -90
  42. package/web-ui/modules/app.computed.dashboard.mjs +126 -113
  43. package/web-ui/modules/app.computed.index.mjs +17 -15
  44. package/web-ui/modules/app.computed.main-tabs.mjs +198 -195
  45. package/web-ui/modules/app.computed.session.mjs +653 -507
  46. package/web-ui/modules/app.constants.mjs +15 -15
  47. package/web-ui/modules/app.methods.agents.mjs +544 -493
  48. package/web-ui/modules/app.methods.claude-config.mjs +174 -174
  49. package/web-ui/modules/app.methods.codex-config.mjs +795 -640
  50. package/web-ui/modules/app.methods.index.mjs +92 -88
  51. package/web-ui/modules/app.methods.install.mjs +161 -149
  52. package/web-ui/modules/app.methods.navigation.mjs +619 -619
  53. package/web-ui/modules/app.methods.openclaw-core.mjs +814 -814
  54. package/web-ui/modules/app.methods.openclaw-editing.mjs +372 -372
  55. package/web-ui/modules/app.methods.openclaw-persist.mjs +369 -369
  56. package/web-ui/modules/app.methods.providers.mjs +404 -363
  57. package/web-ui/modules/app.methods.runtime.mjs +323 -323
  58. package/web-ui/modules/app.methods.session-actions.mjs +537 -520
  59. package/web-ui/modules/app.methods.session-browser.mjs +626 -626
  60. package/web-ui/modules/app.methods.session-timeline.mjs +448 -448
  61. package/web-ui/modules/app.methods.session-trash.mjs +422 -422
  62. package/web-ui/modules/app.methods.startup-claude.mjs +405 -412
  63. package/web-ui/modules/app.methods.task-orchestration.mjs +471 -471
  64. package/web-ui/modules/config-mode.computed.mjs +126 -126
  65. package/web-ui/modules/config-template-confirm-pref.mjs +33 -0
  66. package/web-ui/modules/i18n.mjs +1609 -0
  67. package/web-ui/modules/plugins.computed.mjs +220 -0
  68. package/web-ui/modules/plugins.methods.mjs +620 -0
  69. package/web-ui/modules/plugins.storage.mjs +37 -0
  70. package/web-ui/modules/skills.computed.mjs +107 -107
  71. package/web-ui/modules/skills.methods.mjs +481 -481
  72. package/web-ui/partials/index/layout-footer.html +13 -13
  73. package/web-ui/partials/index/layout-header.html +461 -402
  74. package/web-ui/partials/index/modal-config-template-agents.html +175 -125
  75. package/web-ui/partials/index/modal-confirm-toast.html +32 -32
  76. package/web-ui/partials/index/modal-health-check.html +72 -72
  77. package/web-ui/partials/index/modal-openclaw-config.html +280 -280
  78. package/web-ui/partials/index/modal-skills.html +200 -184
  79. package/web-ui/partials/index/modals-basic.html +165 -156
  80. package/web-ui/partials/index/panel-config-claude.html +138 -126
  81. package/web-ui/partials/index/panel-config-codex.html +234 -237
  82. package/web-ui/partials/index/panel-config-openclaw.html +78 -78
  83. package/web-ui/partials/index/panel-docs.html +147 -130
  84. package/web-ui/partials/index/panel-market.html +174 -174
  85. package/web-ui/partials/index/panel-orchestration.html +397 -397
  86. package/web-ui/partials/index/panel-plugins.html +243 -0
  87. package/web-ui/partials/index/panel-sessions.html +292 -292
  88. package/web-ui/partials/index/panel-settings.html +258 -190
  89. package/web-ui/partials/index/panel-usage.html +353 -213
  90. package/web-ui/session-helpers.mjs +573 -559
  91. package/web-ui/source-bundle.cjs +233 -233
  92. package/web-ui/styles/base-theme.css +264 -271
  93. package/web-ui/styles/controls-forms.css +362 -360
  94. package/web-ui/styles/docs-panel.css +247 -182
  95. package/web-ui/styles/feedback.css +108 -108
  96. package/web-ui/styles/health-check-dialog.css +144 -144
  97. package/web-ui/styles/layout-shell.css +596 -376
  98. package/web-ui/styles/modals-core.css +464 -464
  99. package/web-ui/styles/navigation-panels.css +382 -348
  100. package/web-ui/styles/openclaw-structured.css +266 -266
  101. package/web-ui/styles/plugins-panel.css +518 -0
  102. package/web-ui/styles/responsive.css +456 -450
  103. package/web-ui/styles/sessions-list.css +400 -400
  104. package/web-ui/styles/sessions-preview.css +411 -411
  105. package/web-ui/styles/sessions-toolbar-trash.css +268 -243
  106. package/web-ui/styles/sessions-usage.css +851 -628
  107. package/web-ui/styles/settings-panel.css +166 -0
  108. package/web-ui/styles/skills-list.css +303 -296
  109. package/web-ui/styles/skills-market.css +396 -335
  110. package/web-ui/styles/task-orchestration.css +776 -776
  111. package/web-ui/styles/titles-cards.css +408 -408
  112. package/web-ui/styles.css +20 -18
  113. package/web-ui.html +17 -17
  114. package/README.en.md +0 -349
package/README.md CHANGED
@@ -1,284 +1,389 @@
1
- <div align="center">
2
-
3
- <img src="res/logo.png" alt="Codex Mate logo" width="180" />
4
-
5
- # Codex Mate
6
-
7
- **Codex / Claude Code / OpenClaw 的本地配置与会话管理工具**
8
-
9
- [![Build](https://img.shields.io/github/actions/workflow/status/SakuraByteCore/codexmate/release.yml?label=build)](https://github.com/SakuraByteCore/codexmate/actions/workflows/release.yml)
10
- [![Version](https://img.shields.io/npm/v/codexmate?label=version&registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/codexmate)
11
- [![Downloads](https://img.shields.io/npm/dt/codexmate?label=downloads)](https://www.npmjs.com/package/codexmate)
12
- [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
13
- [![Node](https://img.shields.io/badge/node-%3E%3D14.0.0-green.svg)](https://nodejs.org/)
14
-
15
- [快速开始](#快速开始) · [命令速查](#命令速查) · [Web 界面](#web-界面) · [MCP](#mcp) · [English](README.en.md)
16
-
17
- </div>
18
-
19
- ---
20
-
21
- ## 这是什么?
22
-
23
- Codex Mate 提供一套本地优先的 CLI + Web UI,用于统一管理:
24
-
25
- - Codex provider / model 切换与配置写入
26
- - Claude Code 配置方案(写入 `~/.claude/settings.json`)
27
- - OpenClaw JSON5 配置与 Workspace `AGENTS.md`
28
- - Codex / Claude Code Skills 市场(安装目标切换、本地 skills 管理、跨应用导入、ZIP 分发)
29
- - Codex / Claude 本地会话浏览、筛选、导出、删除与 Usage 统计概览
30
- - 任务编排(规划中,未开放)
31
-
32
- 项目不依赖云端托管,配置写入你的本地文件,便于审计和回滚。Skills 市场同样坚持本地优先,只操作本地目录,不依赖远程在线市场。
33
-
34
- ## 功能对比
35
-
36
- | 维度 | Codex Mate | 手动维护配置 |
37
- | --- | --- | --- |
38
- | 多工具管理 | Codex + Claude Code + OpenClaw 统一入口 | 多文件、多目录分散修改 |
39
- | 使用方式 | CLI + 本地 Web UI | 纯手改 TOML / JSON / JSON5 |
40
- | 会话处理 | 支持浏览、筛选、Usage 统计、导出、批量清理 | 需要手动定位和处理文件 |
41
- | Skills 复用 | 本地 Skills 市场 + 跨应用导入 + ZIP 分发 | 目录手动复制,容易遗漏 |
42
- | 使用可见性 | 统一查看配置、会话、Usage 与运行状态 | 依赖手工翻文件和零散命令 |
43
- | 可回滚性 | 首次接管前自动备份 | 易误覆盖、回滚成本高 |
44
- | 自动化接入 | 提供 MCP stdio(默认只读) | 需自行封装脚本 |
45
-
46
- ## 核心特性
47
-
48
- **配置管理**
49
- - provider / model 切换(`switch` / `use`)
50
- - Codex `config.toml` 模板确认后写入
51
- - Claude Code 多配置方案管理与一键应用
52
- - 分享命令前缀切换(`npm start` / `codexmate`),用于复制 provider / Claude 导入命令,选择持久化到浏览器本地缓存
53
- - OpenClaw JSON5 配置方案管理
54
-
55
- **会话管理**
56
- - 同页查看 Codex Claude 会话
57
- - 支持本地会话置顶,置顶状态持久化保存并优先排序显示
58
- - 关键词搜索、来源筛选、cwd 路径筛选
59
- - Usage 子页:近 7 / 近 30 天会话趋势、消息趋势、来源占比、高频路径
60
- - 会话导出 Markdown
61
- - 会话与消息级删除(支持批量)
62
-
63
- **Skills 市场**
64
- - Codex Claude Code 之间切换 skills 安装目标
65
- - 查看本地已安装 skills、根目录与状态
66
- - 扫描 `Codex` / `Claude Code` / `Agents` 可导入来源
67
- - 支持跨应用导入、ZIP 导入 / 导出、批量删除
68
-
69
- **任务编排(规划中,未开放)**
70
- - 当前版本暂未开放
71
-
72
- **工程能力**
73
- - MCP stdio 能力(tools/resources/prompts
74
- - Zip 压缩/解压(优先系统工具,失败回退 JS 库)
75
-
76
- ## 架构总览
77
-
78
- ### 一图看懂(从“做什么”到“产生什么效果”)
79
-
80
- ```mermaid
81
- flowchart LR
82
- subgraph You["你"]
83
- CLI["CLI 命令"]
84
- WEB["Web UI"]
85
- MCP["MCP 调用"]
86
- end
87
-
88
- subgraph Mate["Codex Mate(本地控制台)"]
89
- API["本地 HTTP API"]
90
- CFG["配置管理"]
91
- SESS["会话/Usage 管理"]
92
- SKL["Skills 管理"]
93
- end
94
-
95
- subgraph Files["只操作你的本地文件(可审计/可回滚)"]
96
- CODEX["~/.codex/*"]
97
- CLAUDE["~/.claude/settings.json"]
98
- OPENCLAW["~/.openclaw/*.json5 + ~/.openclaw/openclaw.json + workspace/AGENTS.md"]
99
- SKILLS["~/.{codex,claude,agents}/skills"]
100
- SESSFILES["sessions / usage / trash / runs"]
101
- end
102
-
103
- CLI --> API
104
- WEB --> API
105
- MCP --> API
106
-
107
- API --> CFG
108
- API --> SESS
109
- API --> SKL
110
-
111
- CFG --> CODEX
112
- CFG --> CLAUDE
113
- CFG --> OPENCLAW
114
- SKL --> SKILLS
115
- SESS --> SESSFILES
116
- ```
117
-
118
- ### 能力 → 作用对象 → 用户收益(直观对照)
119
-
120
- | 能力 | 作用对象(本地) | 你能直接得到什么 |
121
- | --- | --- | --- |
122
- | 配置管理(Codex / Claude / OpenClaw) | `~/.codex/*`、`~/.claude/settings.json`、`~/.openclaw/*` | 一键切换 provider/model、管理多套配置、写入前后可控与可回滚 |
123
- | 会话与 Usage | sessions / usage 聚合 / trash | 更快定位会话、筛选导出、批量清理、查看趋势与占比 |
124
- | Skills 市场 | `~/.{codex,claude,agents}/skills` | 本地安装/导入/导出/分发(ZIP),跨应用复用更省事 |
125
- | MCP(stdio) | 本地 API / 文件能力 | 让外部工具以“可控权限”调用本地能力(默认只读) |
126
-
127
- ## 快速开始
128
-
129
- ### npm 全局安装
130
-
131
- ```bash
132
- npm install -g codexmate
133
- codexmate setup
134
- codexmate status
135
- codexmate run
136
- ```
137
-
138
- 默认监听 `0.0.0.0:3737`,支持局域网访问,并尝试自动打开浏览器。
139
-
140
- > 安全提示:默认监听会在当前局域网暴露未鉴权的管理界面。若包含 API Key、provider 配置或 skills 管理,请仅在可信网络中使用;如需仅本机访问,可设置 `CODEXMATE_HOST=127.0.0.1` 或启动时传入 `--host 127.0.0.1`。
141
-
142
- ### 从源码运行
143
-
144
- ```bash
145
- git clone https://github.com/SakuraByteCore/codexmate.git
146
- cd codexmate
147
- npm install
148
- npm start run
149
- ```
150
-
151
- ### 测试 / CI(只启动服务)
152
-
153
- ```bash
154
- npm start run --no-browser
155
- ```
156
-
157
- > 约定:自动化测试仅验证服务与 API,不依赖打开页面。
158
-
159
- ### 开发辅助脚本
160
-
161
- ```bash
162
- npm run reset
163
- npm run reset 79
164
- ```
165
-
166
- - `npm run reset`:交互输入 PR 编号;留空则回到默认 `origin/main`
167
- - `npm run reset 79`:直接同步到 PR `#79` 的最新 head 快照
168
- - 脚本会自动完成本地分支切换、工作区清理、未跟踪文件清理与最终状态校验
169
-
170
- ## 命令速查
171
-
172
- | 命令 | 说明 |
173
- | --- | --- |
174
- | `codexmate status` | 查看当前配置状态 |
175
- | `codexmate setup` | 交互式初始化 |
176
- | `codexmate list` / `codexmate models` | 查看提供商 / 模型 |
177
- | `codexmate switch <provider>` / `codexmate use <model>` | 切换 provider / model |
178
- | `codexmate add <name> <URL> [API_KEY]` | 添加提供商 |
179
- | `codexmate delete <name>` | 删除提供商 |
180
- | `codexmate claude <BaseURL> <API_KEY> [model]` | 写入 Claude Code 配置 |
181
- | `codexmate workflow <list\|get\|validate\|run\|runs>` | MCP 工作流管理 |
182
- | `codexmate codex [args...] [--follow-up <文本> 可重复]` | Codex CLI 透传入口(默认补 `--yolo`,可追加 queued follow-up) |
183
- | `codexmate qwen [args...]` | Qwen CLI 透传入口 |
184
- | `codexmate run [--host <HOST>] [--no-browser]` | 启动 Web UI |
185
- | `codexmate mcp serve [--read-only\|--allow-write]` | 启动 MCP stdio 服务 |
186
- | `codexmate export-session --source <codex\|claude> ...` | 导出会话为 Markdown |
187
- | `codexmate zip <path> [--max:0-9]` / `codexmate unzip <zip> [out]` | 压缩 / 解压 |
188
- | `codexmate unzip-ext <zip-dir> [out] [--ext:suffix[,suffix...]] [--no-recursive]` | 批量提取目录下 ZIP 内指定后缀文件(默认 `.json`,默认递归) |
189
-
190
- ### Codex follow-up 追加(可选)
191
-
192
- ```bash
193
- codexmate codex --follow-up "先扫描项目" --follow-up "再修复失败测试"
194
- codexmate codex --model gpt-5.3-codex --follow-up "步骤1" --follow-up "步骤2"
195
- ```
196
-
197
- > 说明:`--follow-up` / `--queued-follow-up` 都可用,支持重复。
198
-
199
- ## Web 界面
200
-
201
- ### Codex 配置模式
202
- - provider / model 切换
203
- - 模型管理
204
- - `~/.codex/AGENTS.md` 编辑
205
-
206
- ### Claude Code 配置模式
207
- - 多配置方案管理
208
- - 默认写入 `~/.claude/settings.json`
209
- - 支持复制分享导入命令
210
-
211
- ### OpenClaw 配置模式
212
- - JSON5 多方案管理
213
- - 应用到 `~/.openclaw/openclaw.json`
214
- - 管理 `~/.openclaw/workspace/AGENTS.md`
215
-
216
- ### 会话模式
217
- - Codex + Claude 会话统一列表
218
- - Browser / Usage 双子视图切换
219
- - 支持本地会话置顶、持久化保存与置顶优先排序
220
- - 搜索、筛选、导出、删除、批量清理
221
- - Usage 视图提供近 7 / 30 天会话趋势、消息趋势、来源占比与高频路径统计
222
- - 费用估算当前只统计可识别模型单价的非 Claude 会话
223
-
224
- ### Skills 市场标签页
225
- - `Codex` `Claude Code` 之间切换 skills 安装目标
226
- - 展示当前目标的本地 skills 根目录、已安装项和可导入项
227
- - 扫描 `Codex` / `Claude Code` / `Agents` 目录中的可导入来源
228
- - 支持跨应用导入、ZIP 导入 / 导出、批量删除
229
-
230
- ### 设置标签页
231
- - 支持切换分享命令前缀:`npm start` / `codexmate`
232
- - 影响 Web UI 中复制出来的 provider 分享命令与 Claude 导入命令
233
- - 选择持久化到浏览器本地缓存,刷新页面后仍保留
234
-
235
- ## MCP
236
-
237
- > 传输:`stdio`
238
-
239
- - 传输:仅 `stdio`
240
- - 默认:只读工具集
241
- - 写入开启:`--allow-write` 或 `CODEXMATE_MCP_ALLOW_WRITE=1`
242
- - 包含域:`tools`、`resources`、`prompts`
243
-
244
- 示例:
245
-
246
- ```bash
247
- codexmate mcp serve --read-only
248
- codexmate mcp serve --allow-write
249
- ```
250
-
251
- ## 配置文件
252
-
253
- - `~/.codex/config.toml`
254
- - `~/.codex/auth.json`
255
- - `~/.codex/models.json`
256
- - `~/.codex/provider-current-models.json`
257
- - `~/.claude/settings.json`
258
- - `~/.openclaw/openclaw.json`
259
- - `~/.openclaw/workspace/AGENTS.md`
260
-
261
- ## 环境变量
262
-
263
- | 变量 | 默认值 | 说明 |
264
- | --- | --- | --- |
265
- | `CODEXMATE_PORT` | `3737` | Web 服务端口 |
266
- | `CODEXMATE_HOST` | `0.0.0.0` | Web 服务监听地址(如需仅本机访问,显式设为 `127.0.0.1`) |
267
- | `CODEXMATE_NO_BROWSER` | 未设置 | 设为 `1` 后不自动打开浏览器 |
268
- | `CODEXMATE_MCP_ALLOW_WRITE` | 未设置 | 设为 `1` 后默认允许 MCP 写工具 |
269
- | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | 设为 `1` 时首次可强制重建托管配置 |
270
-
271
- ## 技术栈
272
-
273
- - Node.js
274
- - Vue.js 3(Web UI)
275
- - 原生 HTTP Server
276
- - `@iarna/toml`、`json5`
277
-
278
- ## 参与贡献
279
-
280
- Issue Pull Request 可按需提交。
281
-
282
- ## License
283
-
284
- Apache-2.0
1
+ <div align="center">
2
+
3
+ <img src="res/logo.png" alt="Codex Mate logo" width="180" />
4
+
5
+ # Codex Mate
6
+
7
+ **Local-first control panel for Codex / Claude Code / OpenClaw configs, sessions, and usage analytics.**
8
+
9
+ [![Build](https://img.shields.io/github/actions/workflow/status/SakuraByteCore/codexmate/release.yml?label=build&style=flat)](https://github.com/SakuraByteCore/codexmate/actions/workflows/release.yml)
10
+ [![Version](https://img.shields.io/npm/v/codexmate?label=version&style=flat)](https://www.npmjs.com/package/codexmate)
11
+ [![Downloads](https://img.shields.io/npm/dt/codexmate?label=downloads&style=flat)](https://www.npmjs.com/package/codexmate)
12
+ [![Node](https://img.shields.io/node/v/codexmate?label=Node.js&style=flat&logo=node.js&logoColor=white)](https://nodejs.org/)
13
+ [![License](https://img.shields.io/npm/l/codexmate?label=license&style=flat)](LICENSE)
14
+ [![Stars](https://img.shields.io/github/stars/SakuraByteCore/codexmate?label=stars&style=flat)](https://github.com/SakuraByteCore/codexmate/stargazers)
15
+ [![Issues](https://img.shields.io/github/issues/SakuraByteCore/codexmate?label=issues&style=flat)](https://github.com/SakuraByteCore/codexmate/issues)
16
+
17
+ [Docs](https://sakurabytecore.github.io/codexmate/) · [Quick Start](#quick-start) · [Commands](#command-reference) · [Web UI](#web-ui) · [MCP](#mcp) · [中文](README.zh.md)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## What Is This?
24
+
25
+ Codex Mate is a local-first CLI + Web UI for unified management of:
26
+
27
+ - Codex provider/model switching and config writes
28
+ - Claude Code profiles (writes to `~/.claude/settings.json`)
29
+ - Claude Code `CLAUDE.md` editing (writes to `~/.claude/CLAUDE.md`)
30
+ - OpenClaw JSON5 profiles and workspace `AGENTS.md`
31
+ - Local skills market for Codex / Claude Code (target switching, local skills management, cross-app import, ZIP distribution)
32
+ - Local Codex/Claude sessions (list/filter/export/delete) with Usage analytics overview
33
+ - Plugins (Prompt templates): reusable templates with variables and one-click copy
34
+
35
+ It works on local files directly and does not require cloud hosting. The skills market is also local-first: it operates on local directories and does not depend on a remote marketplace.
36
+
37
+ ## Comparison
38
+
39
+ | Dimension | Codex Mate | Manual File Editing |
40
+ | --- | --- | --- |
41
+ | Multi-tool management | Codex + Claude Code + OpenClaw in one entry | Different files and folders per tool |
42
+ | Operation mode | CLI + local Web UI | Manual TOML/JSON/JSON5 edits |
43
+ | Session handling | Browse/filter/Usage analytics/export/batch cleanup | Manual file location and processing |
44
+ | Skills reuse | Local skills market + cross-app import + ZIP distribution | Manual folder copy and reconciliation |
45
+ | Operational visibility | Unified view of config, sessions, and Usage summaries | Depends on manual file inspection and scattered commands |
46
+ | Rollback readiness | Backup before first takeover | Easy to overwrite by mistake |
47
+ | Automation integration | MCP stdio (read-only by default) | Requires custom scripting |
48
+
49
+ ## Core Features
50
+
51
+ **Configuration**
52
+ - Provider/model switching (`switch`, `use`)
53
+ - Codex `config.toml` template confirmation before write
54
+ - Claude Code profile management and apply
55
+ - Claude Code `CLAUDE.md` editing (writes to `~/.claude/CLAUDE.md`)
56
+ - OpenClaw JSON5 profile management
57
+
58
+ **Session Management**
59
+ - Unified Codex + Claude session list
60
+ - Local session pinning with persistent pinned state and pinned-first ordering
61
+ - Keyword/source/cwd filters
62
+ - Usage subview with 7d / 30d session trends, message trends, source share, and top paths
63
+ - Markdown export
64
+ - Session-level and message-level delete (supports batch)
65
+
66
+ **Skills Market**
67
+ - Switch the skills install target between Codex and Claude Code
68
+ - Inspect local installed skills, root paths, and status
69
+ - Scan importable sources from `Codex` / `Claude Code` / `Agents`
70
+ - Support cross-app import, ZIP import/export, and batch delete
71
+
72
+ **Plugins**
73
+ - Prompt templates: save, edit, and reuse prompts with variables
74
+ - Compose + copy workflow for fast prompt iteration (stored locally in browser storage)
75
+
76
+ **Engineering Utilities**
77
+ - MCP stdio domains (`tools`, `resources`, `prompts`)
78
+ - Built-in proxy controls (`proxy`)
79
+ - Auth profile management (`auth`)
80
+ - Zip/unzip utilities
81
+
82
+ ## Architecture
83
+
84
+ ### At a glance (what it does → what you get)
85
+
86
+ ```mermaid
87
+ flowchart LR
88
+ subgraph You["You"]
89
+ CLI["CLI"]
90
+ WEB["Web UI"]
91
+ MCP["MCP (stdio)"]
92
+ end
93
+
94
+ subgraph Mate["Codex Mate (local control panel)"]
95
+ API["Local HTTP API"]
96
+ CFG["Config management"]
97
+ SESS["Sessions & Usage"]
98
+ SKL["Skills management"]
99
+ PLG["Plugins: Prompt templates"]
100
+ end
101
+
102
+ subgraph Files["Local files only (auditable & reversible)"]
103
+ CODEX["~/.codex/*"]
104
+ CLAUDE["~/.claude/settings.json + CLAUDE.md"]
105
+ OPENCLAW["~/.openclaw/*.json5 + ~/.openclaw/openclaw.json + workspace/AGENTS.md"]
106
+ SKILLS["~/.{codex,claude,agents}/skills"]
107
+ STATE["sessions / usage / trash / runs"]
108
+ BROWSER["Browser storage (templates)"]
109
+ end
110
+
111
+ CLI --> API
112
+ WEB --> API
113
+ MCP --> API
114
+ WEB --> PLG
115
+
116
+ API --> CFG
117
+ API --> SESS
118
+ API --> SKL
119
+ PLG --> BROWSER
120
+
121
+ CFG --> CODEX
122
+ CFG --> CLAUDE
123
+ CFG --> OPENCLAW
124
+ SKL --> SKILLS
125
+ SESS --> STATE
126
+ ```
127
+
128
+ ### Capability → Local target → Outcome
129
+
130
+ | Capability | Local target | What you get |
131
+ | --- | --- | --- |
132
+ | Config management (Codex / Claude / OpenClaw) | `~/.codex/*`, `~/.claude/settings.json`, `~/.claude/CLAUDE.md`, `~/.openclaw/*` | Faster provider/model switching, multi-profile management, safer writes with backups |
133
+ | Sessions & Usage | sessions / usage aggregates / trash | Quickly locate sessions, filter/export, batch cleanup, and view trends |
134
+ | Skills market | `~/.{codex,claude,agents}/skills` | Local install/import/export (ZIP), cross-app reuse |
135
+ | Plugins (Prompt templates) | Browser storage | Reusable prompt templates with variables and one-click copy |
136
+ | MCP (stdio) | local API + file operations | Integrate with external tools under controllable permissions (read-only by default) |
137
+
138
+ ## Quick Start
139
+
140
+ ### Install from npm
141
+
142
+ ```bash
143
+ npm install -g codexmate
144
+ codexmate setup
145
+ codexmate status
146
+ codexmate run
147
+ ```
148
+
149
+ Default listen address is `0.0.0.0:3737` for LAN access, and browser auto-open is enabled by default.
150
+
151
+ > Safety note: the unauthenticated management UI is exposed to your current LAN by default. Use trusted networks only; for local-only access, set `CODEXMATE_HOST=127.0.0.1` or pass `--host 127.0.0.1`.
152
+
153
+ ### Install Codex CLI / Claude Code CLI (optional)
154
+
155
+ Codex Mate can pass through to the official CLIs (e.g. `codexmate codex ...`). Install them first:
156
+
157
+ ```bash
158
+ # Codex CLI (default)
159
+ npm install -g @openai/codex
160
+
161
+ # Codex CLI on Termux (Android)
162
+ npm install -g @mmmbuto/codex-cli-termux@latest
163
+
164
+ # Claude Code
165
+ npm install -g @anthropic-ai/claude-code
166
+ ```
167
+
168
+ ### Run from source
169
+
170
+ ```bash
171
+ git clone https://github.com/SakuraByteCore/codexmate.git
172
+ cd codexmate
173
+ npm install
174
+ npm start run
175
+ ```
176
+
177
+ ### Tests / CI (service only)
178
+
179
+ ```bash
180
+ npm start run --no-browser
181
+ ```
182
+
183
+ > Convention: automated tests validate service and API behavior only, without opening browser pages.
184
+
185
+ ### Developer helper scripts
186
+
187
+ ```bash
188
+ npm run reset
189
+ npm run reset 79
190
+ ```
191
+
192
+ - `npm run reset`: prompt for a PR number; leave it blank to return to default `origin/main`
193
+ - `npm run reset 79`: sync directly to the latest head snapshot of PR `#79`
194
+ - The script also handles local branch switching, workspace cleanup, untracked file cleanup, and final state validation
195
+
196
+ ## Command Reference
197
+
198
+ | Command | Description |
199
+ | --- | --- |
200
+ | `codexmate status` | Show current config status |
201
+ | `codexmate setup` | Interactive setup |
202
+ | `codexmate list` / `codexmate models` | List providers / models |
203
+ | `codexmate switch <provider>` / `codexmate use <model>` | Switch provider / model |
204
+ | `codexmate add <name> <URL> [API_KEY]` | Add provider |
205
+ | `codexmate delete <name>` | Delete provider |
206
+ | `codexmate claude <BaseURL> <API_KEY> [model]` | Write Claude Code config |
207
+ | `codexmate auth <list\|import\|switch\|delete\|status>` | Auth profile management |
208
+ | `codexmate proxy <status\|set\|apply\|enable\|start\|stop>` | Built-in proxy management |
209
+ | `codexmate workflow <list\|get\|validate\|run\|runs>` | MCP workflow management |
210
+ | `codexmate codex [args...] [--follow-up <text> repeatable]` | Codex CLI passthrough entrypoint (auto-adds `--yolo`, supports queued follow-up appends) |
211
+ | `codexmate qwen [args...]` | Qwen CLI passthrough entrypoint |
212
+ | `codexmate run [--host <HOST>] [--no-browser]` | Start Web UI |
213
+ | `codexmate mcp serve [--read-only\|--allow-write]` | Start MCP stdio server |
214
+ | `codexmate export-session --source <codex\|claude> ...` | Export session to Markdown |
215
+ | `codexmate zip <path> [--max:0-9]` / `codexmate unzip <zip> [out]` | Zip / unzip |
216
+ | `codexmate unzip-ext <zip-dir> [out] [--ext:suffix[,suffix...]] [--no-recursive]` | Extract files with target suffixes from ZIP files in a directory (default `.json`, recursive by default) |
217
+
218
+ ### Codex Follow-up Append (Optional)
219
+
220
+ ```bash
221
+ codexmate codex --follow-up "scan repository first" --follow-up "then fix failing tests"
222
+ codexmate codex --model gpt-5.3-codex --follow-up "step1" --follow-up "step2"
223
+ ```
224
+
225
+ > Note: both `--follow-up` and `--queued-follow-up` are accepted and repeatable.
226
+
227
+ ## Web UI
228
+
229
+ ### Codex Mode
230
+ - Provider/model switching
231
+ - Model list management
232
+ - `~/.codex/AGENTS.md` editing
233
+
234
+ ### Claude Code Mode
235
+ - Multi-profile management
236
+ - Default write to `~/.claude/settings.json`
237
+ - `~/.claude/CLAUDE.md` editing
238
+ - Shareable import command copy
239
+
240
+ ### OpenClaw Mode
241
+ - JSON5 multi-profile management
242
+ - Apply to `~/.openclaw/openclaw.json`
243
+ - Manage `~/.openclaw/workspace/AGENTS.md`
244
+
245
+ ### Plugins Mode (Prompt Templates)
246
+ - Entry: switch to **Plugins** → **Prompt Templates**
247
+ - Manage custom templates (JSON import/export)
248
+ - Variables: in **Manage**, you can “Add variable” (inserts `{{var}}`) and fill variable values in the Variables panel
249
+ - Generate & copy: after filling variables, copy the final rendered prompt from **Preview**
250
+ - Built-in template: ships a single read-only template for light code-comment polishing
251
+
252
+ ### Sessions Mode
253
+ - Unified Codex + Claude sessions
254
+ - Browser / Usage subview switching
255
+ - Local pin/unpin with persistent storage and pinned-first ordering
256
+ - Search, filter, export, delete, batch cleanup
257
+ - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
258
+
259
+ ### Skills Market Tab
260
+ - Switch the skills install target between `Codex` and `Claude Code`
261
+ - Show the current local skills root, installed items, and importable items
262
+ - Scan importable sources under `Codex` / `Claude Code` / `Agents`
263
+ - Support cross-app import, ZIP import/export, and batch delete
264
+
265
+ ## MCP
266
+
267
+ > Transport: `stdio`
268
+
269
+ - Default: read-only tools
270
+ - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
271
+ - Domains: `tools`, `resources`, `prompts`
272
+
273
+ Examples:
274
+
275
+ ```bash
276
+ codexmate mcp serve --read-only
277
+ codexmate mcp serve --allow-write
278
+ ```
279
+
280
+ ## Config Files
281
+
282
+ - `~/.codex/config.toml`
283
+ - `~/.codex/auth.json`
284
+ - `~/.codex/models.json`
285
+ - `~/.codex/provider-current-models.json`
286
+ - `~/.claude/settings.json`
287
+ - `~/.claude/CLAUDE.md`
288
+ - `~/.openclaw/openclaw.json`
289
+ - `~/.openclaw/workspace/AGENTS.md`
290
+
291
+ ## Environment Variables
292
+
293
+ | Variable | Default | Description |
294
+ | --- | --- | --- |
295
+ | `CODEXMATE_PORT` | `3737` | Web server port |
296
+ | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
297
+ | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
298
+ | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
299
+ | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
300
+
301
+ ## Tech Stack
302
+
303
+ - Node.js
304
+ - Vue.js 3 (Web UI)
305
+ - Native HTTP server
306
+ - `@iarna/toml`, `json5`
307
+
308
+ ## Contributing
309
+
310
+ Issues and pull requests are accepted.
311
+
312
+ ## License
313
+
314
+ Apache-2.0
315
+
316
+ ### Claude Code Mode
317
+ - Multi-profile management
318
+ - Default write to `~/.claude/settings.json`
319
+ - `~/.claude/CLAUDE.md` editing
320
+ - Shareable import command copy
321
+
322
+ ### OpenClaw Mode
323
+ - JSON5 multi-profile management
324
+ - Apply to `~/.openclaw/openclaw.json`
325
+ - Manage `~/.openclaw/workspace/AGENTS.md`
326
+
327
+ ### Sessions Mode
328
+ - Unified Codex + Claude sessions
329
+ - Browser / Usage subview switching
330
+ - Local pin/unpin with persistent storage and pinned-first ordering
331
+ - Search, filter, export, delete, batch cleanup
332
+ - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
333
+
334
+ ### Skills Market Tab
335
+ - Switch the skills install target between `Codex` and `Claude Code`
336
+ - Show the current local skills root, installed items, and importable items
337
+ - Scan importable sources under `Codex` / `Claude Code` / `Agents`
338
+ - Support cross-app import, ZIP import/export, and batch delete
339
+
340
+ ## MCP
341
+
342
+ > Transport: `stdio`
343
+
344
+ - Default: read-only tools
345
+ - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
346
+ - Domains: `tools`, `resources`, `prompts`
347
+
348
+ Examples:
349
+
350
+ ```bash
351
+ codexmate mcp serve --read-only
352
+ codexmate mcp serve --allow-write
353
+ ```
354
+
355
+ ## Config Files
356
+
357
+ - `~/.codex/config.toml`
358
+ - `~/.codex/auth.json`
359
+ - `~/.codex/models.json`
360
+ - `~/.codex/provider-current-models.json`
361
+ - `~/.claude/settings.json`
362
+ - `~/.claude/CLAUDE.md`
363
+ - `~/.openclaw/openclaw.json`
364
+ - `~/.openclaw/workspace/AGENTS.md`
365
+
366
+ ## Environment Variables
367
+
368
+ | Variable | Default | Description |
369
+ | --- | --- | --- |
370
+ | `CODEXMATE_PORT` | `3737` | Web server port |
371
+ | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
372
+ | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
373
+ | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
374
+ | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
375
+
376
+ ## Tech Stack
377
+
378
+ - Node.js
379
+ - Vue.js 3 (Web UI)
380
+ - Native HTTP server
381
+ - `@iarna/toml`, `json5`
382
+
383
+ ## Contributing
384
+
385
+ Issues and pull requests are accepted.
386
+
387
+ ## License
388
+
389
+ Apache-2.0