codexmate 0.0.21 → 0.0.23

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 (115) hide show
  1. package/README.md +390 -284
  2. package/README.zh.md +322 -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 +626 -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 +202 -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 +177 -149
  52. package/web-ui/modules/app.methods.navigation.mjs +662 -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 +691 -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 +417 -412
  63. package/web-ui/modules/app.methods.task-orchestration.mjs +556 -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 +1823 -0
  67. package/web-ui/modules/plugins.computed.mjs +3 -0
  68. package/web-ui/modules/plugins.methods.mjs +3 -0
  69. package/web-ui/modules/plugins.storage.mjs +11 -0
  70. package/web-ui/modules/sessions-filters-url.mjs +85 -0
  71. package/web-ui/modules/skills.computed.mjs +107 -107
  72. package/web-ui/modules/skills.methods.mjs +481 -481
  73. package/web-ui/partials/index/layout-footer.html +13 -13
  74. package/web-ui/partials/index/layout-header.html +461 -402
  75. package/web-ui/partials/index/modal-config-template-agents.html +175 -125
  76. package/web-ui/partials/index/modal-confirm-toast.html +32 -32
  77. package/web-ui/partials/index/modal-health-check.html +72 -72
  78. package/web-ui/partials/index/modal-openclaw-config.html +280 -280
  79. package/web-ui/partials/index/modal-skills.html +200 -184
  80. package/web-ui/partials/index/modals-basic.html +165 -156
  81. package/web-ui/partials/index/panel-config-claude.html +159 -126
  82. package/web-ui/partials/index/panel-config-codex.html +255 -237
  83. package/web-ui/partials/index/panel-config-openclaw.html +78 -78
  84. package/web-ui/partials/index/panel-docs.html +147 -130
  85. package/web-ui/partials/index/panel-market.html +174 -174
  86. package/web-ui/partials/index/panel-orchestration.html +388 -397
  87. package/web-ui/partials/index/panel-plugins.html +273 -0
  88. package/web-ui/partials/index/panel-sessions.html +298 -292
  89. package/web-ui/partials/index/panel-settings.html +258 -190
  90. package/web-ui/partials/index/panel-usage.html +353 -213
  91. package/web-ui/session-helpers.mjs +573 -559
  92. package/web-ui/source-bundle.cjs +233 -233
  93. package/web-ui/styles/base-theme.css +264 -271
  94. package/web-ui/styles/controls-forms.css +369 -360
  95. package/web-ui/styles/docs-panel.css +247 -182
  96. package/web-ui/styles/feedback.css +108 -108
  97. package/web-ui/styles/health-check-dialog.css +144 -144
  98. package/web-ui/styles/layout-shell.css +602 -376
  99. package/web-ui/styles/modals-core.css +464 -464
  100. package/web-ui/styles/navigation-panels.css +390 -348
  101. package/web-ui/styles/openclaw-structured.css +266 -266
  102. package/web-ui/styles/plugins-panel.css +523 -0
  103. package/web-ui/styles/responsive.css +456 -450
  104. package/web-ui/styles/sessions-list.css +400 -400
  105. package/web-ui/styles/sessions-preview.css +411 -411
  106. package/web-ui/styles/sessions-toolbar-trash.css +268 -243
  107. package/web-ui/styles/sessions-usage.css +879 -628
  108. package/web-ui/styles/settings-panel.css +166 -0
  109. package/web-ui/styles/skills-list.css +303 -296
  110. package/web-ui/styles/skills-market.css +406 -335
  111. package/web-ui/styles/task-orchestration.css +822 -776
  112. package/web-ui/styles/titles-cards.css +408 -408
  113. package/web-ui/styles.css +20 -18
  114. package/web-ui.html +17 -17
  115. package/README.en.md +0 -349
package/README.md CHANGED
@@ -1,284 +1,390 @@
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
+ - Task orchestration: plan/queue/run/review local tasks
35
+
36
+ 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.
37
+
38
+ ## Comparison
39
+
40
+ | Dimension | Codex Mate | Manual File Editing |
41
+ | --- | --- | --- |
42
+ | Multi-tool management | Codex + Claude Code + OpenClaw in one entry | Different files and folders per tool |
43
+ | Operation mode | CLI + local Web UI | Manual TOML/JSON/JSON5 edits |
44
+ | Session handling | Browse/filter/Usage analytics/export/batch cleanup | Manual file location and processing |
45
+ | Skills reuse | Local skills market + cross-app import + ZIP distribution | Manual folder copy and reconciliation |
46
+ | Operational visibility | Unified view of config, sessions, and Usage summaries | Depends on manual file inspection and scattered commands |
47
+ | Rollback readiness | Backup before first takeover | Easy to overwrite by mistake |
48
+ | Automation integration | MCP stdio (read-only by default) | Requires custom scripting |
49
+
50
+ ## Core Features
51
+
52
+ **Configuration**
53
+ - Provider/model switching (`switch`, `use`)
54
+ - Codex `config.toml` template confirmation before write
55
+ - Claude Code profile management and apply
56
+ - Claude Code `CLAUDE.md` editing (writes to `~/.claude/CLAUDE.md`)
57
+ - OpenClaw JSON5 profile management
58
+
59
+ **Session Management**
60
+ - Unified Codex + Claude session list
61
+ - Local session pinning with persistent pinned state and pinned-first ordering
62
+ - Keyword/source/cwd filters
63
+ - Usage subview with 7d / 30d session trends, message trends, source share, and top paths
64
+ - Markdown export
65
+ - Session-level and message-level delete (supports batch)
66
+
67
+ **Skills Market**
68
+ - Switch the skills install target between Codex and Claude Code
69
+ - Inspect local installed skills, root paths, and status
70
+ - Scan importable sources from `Codex` / `Claude Code` / `Agents`
71
+ - Support cross-app import, ZIP import/export, and batch delete
72
+
73
+ **Plugins**
74
+ - Prompt templates: save, edit, and reuse prompts with variables
75
+ - Compose + copy workflow for fast prompt iteration (stored locally in browser storage)
76
+
77
+ **Engineering Utilities**
78
+ - MCP stdio domains (`tools`, `resources`, `prompts`)
79
+ - Built-in proxy controls (`proxy`)
80
+ - Auth profile management (`auth`)
81
+ - Zip/unzip utilities
82
+
83
+ ## Architecture
84
+
85
+ ### At a glance (what it does → what you get)
86
+
87
+ ```mermaid
88
+ flowchart LR
89
+ subgraph You["You"]
90
+ CLI["CLI"]
91
+ WEB["Web UI"]
92
+ MCP["MCP (stdio)"]
93
+ end
94
+
95
+ subgraph Mate["Codex Mate (local control panel)"]
96
+ API["Local HTTP API"]
97
+ CFG["Config management"]
98
+ SESS["Sessions & Usage"]
99
+ SKL["Skills management"]
100
+ PLG["Plugins: Prompt templates"]
101
+ end
102
+
103
+ subgraph Files["Local files only (auditable & reversible)"]
104
+ CODEX["~/.codex/*"]
105
+ CLAUDE["~/.claude/settings.json + CLAUDE.md"]
106
+ OPENCLAW["~/.openclaw/*.json5 + ~/.openclaw/openclaw.json + workspace/AGENTS.md"]
107
+ SKILLS["~/.{codex,claude,agents}/skills"]
108
+ STATE["sessions / usage / trash / runs"]
109
+ BROWSER["Browser storage (templates)"]
110
+ end
111
+
112
+ CLI --> API
113
+ WEB --> API
114
+ MCP --> API
115
+ WEB --> PLG
116
+
117
+ API --> CFG
118
+ API --> SESS
119
+ API --> SKL
120
+ PLG --> BROWSER
121
+
122
+ CFG --> CODEX
123
+ CFG --> CLAUDE
124
+ CFG --> OPENCLAW
125
+ SKL --> SKILLS
126
+ SESS --> STATE
127
+ ```
128
+
129
+ ### Capability → Local target → Outcome
130
+
131
+ | Capability | Local target | What you get |
132
+ | --- | --- | --- |
133
+ | Config management (Codex / Claude / OpenClaw) | `~/.codex/*`, `~/.claude/settings.json`, `~/.claude/CLAUDE.md`, `~/.openclaw/*` | Faster provider/model switching, multi-profile management, safer writes with backups |
134
+ | Sessions & Usage | sessions / usage aggregates / trash | Quickly locate sessions, filter/export, batch cleanup, and view trends |
135
+ | Skills market | `~/.{codex,claude,agents}/skills` | Local install/import/export (ZIP), cross-app reuse |
136
+ | Plugins (Prompt templates) | Browser storage | Reusable prompt templates with variables and one-click copy |
137
+ | MCP (stdio) | local API + file operations | Integrate with external tools under controllable permissions (read-only by default) |
138
+
139
+ ## Quick Start
140
+
141
+ ### Install from npm
142
+
143
+ ```bash
144
+ npm install -g codexmate
145
+ codexmate setup
146
+ codexmate status
147
+ codexmate run
148
+ ```
149
+
150
+ Default listen address is `0.0.0.0:3737` for LAN access, and browser auto-open is enabled by default.
151
+
152
+ > 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`.
153
+
154
+ ### Install Codex CLI / Claude Code CLI (optional)
155
+
156
+ Codex Mate can pass through to the official CLIs (e.g. `codexmate codex ...`). Install them first:
157
+
158
+ ```bash
159
+ # Codex CLI (default)
160
+ npm install -g @openai/codex
161
+
162
+ # Codex CLI on Termux (Android)
163
+ npm install -g @mmmbuto/codex-cli-termux@latest
164
+
165
+ # Claude Code
166
+ npm install -g @anthropic-ai/claude-code
167
+ ```
168
+
169
+ ### Run from source
170
+
171
+ ```bash
172
+ git clone https://github.com/SakuraByteCore/codexmate.git
173
+ cd codexmate
174
+ npm install
175
+ npm start run
176
+ ```
177
+
178
+ ### Tests / CI (service only)
179
+
180
+ ```bash
181
+ npm start run --no-browser
182
+ ```
183
+
184
+ > Convention: automated tests validate service and API behavior only, without opening browser pages.
185
+
186
+ ### Developer helper scripts
187
+
188
+ ```bash
189
+ npm run reset
190
+ npm run reset 79
191
+ ```
192
+
193
+ - `npm run reset`: prompt for a PR number; leave it blank to return to default `origin/main`
194
+ - `npm run reset 79`: sync directly to the latest head snapshot of PR `#79`
195
+ - The script also handles local branch switching, workspace cleanup, untracked file cleanup, and final state validation
196
+
197
+ ## Command Reference
198
+
199
+ | Command | Description |
200
+ | --- | --- |
201
+ | `codexmate status` | Show current config status |
202
+ | `codexmate setup` | Interactive setup |
203
+ | `codexmate list` / `codexmate models` | List providers / models |
204
+ | `codexmate switch <provider>` / `codexmate use <model>` | Switch provider / model |
205
+ | `codexmate add <name> <URL> [API_KEY]` | Add provider |
206
+ | `codexmate delete <name>` | Delete provider |
207
+ | `codexmate claude <BaseURL> <API_KEY> [model]` | Write Claude Code config |
208
+ | `codexmate auth <list\|import\|switch\|delete\|status>` | Auth profile management |
209
+ | `codexmate proxy <status\|set\|apply\|enable\|start\|stop>` | Built-in proxy management |
210
+ | `codexmate workflow <list\|get\|validate\|run\|runs>` | MCP workflow management |
211
+ | `codexmate codex [args...] [--follow-up <text> repeatable]` | Codex CLI passthrough entrypoint (auto-adds `--yolo`, supports queued follow-up appends) |
212
+ | `codexmate qwen [args...]` | Qwen CLI passthrough entrypoint |
213
+ | `codexmate run [--host <HOST>] [--no-browser]` | Start Web UI |
214
+ | `codexmate mcp serve [--read-only\|--allow-write]` | Start MCP stdio server |
215
+ | `codexmate export-session --source <codex\|claude> ...` | Export session to Markdown |
216
+ | `codexmate zip <path> [--max:0-9]` / `codexmate unzip <zip> [out]` | Zip / unzip |
217
+ | `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) |
218
+
219
+ ### Codex Follow-up Append (Optional)
220
+
221
+ ```bash
222
+ codexmate codex --follow-up "scan repository first" --follow-up "then fix failing tests"
223
+ codexmate codex --model gpt-5.3-codex --follow-up "step1" --follow-up "step2"
224
+ ```
225
+
226
+ > Note: both `--follow-up` and `--queued-follow-up` are accepted and repeatable.
227
+
228
+ ## Web UI
229
+
230
+ ### Codex Mode
231
+ - Provider/model switching
232
+ - Model list management
233
+ - `~/.codex/AGENTS.md` editing
234
+
235
+ ### Claude Code Mode
236
+ - Multi-profile management
237
+ - Default write to `~/.claude/settings.json`
238
+ - `~/.claude/CLAUDE.md` editing
239
+ - Shareable import command copy
240
+
241
+ ### OpenClaw Mode
242
+ - JSON5 multi-profile management
243
+ - Apply to `~/.openclaw/openclaw.json`
244
+ - Manage `~/.openclaw/workspace/AGENTS.md`
245
+
246
+ ### Plugins Mode (Prompt Templates)
247
+ - Entry: switch to **Plugins** → **Prompt Templates**
248
+ - Manage custom templates (JSON import/export)
249
+ - Variables: in **Manage**, you can “Add variable” (inserts `{{var}}`) and fill variable values in the Variables panel
250
+ - Generate & copy: after filling variables, copy the final rendered prompt from **Preview**
251
+ - Built-in template: ships a single read-only template for light code-comment polishing
252
+
253
+ ### Sessions Mode
254
+ - Unified Codex + Claude sessions
255
+ - Browser / Usage subview switching
256
+ - Local pin/unpin with persistent storage and pinned-first ordering
257
+ - Search, filter, export, delete, batch cleanup
258
+ - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
259
+
260
+ ### Skills Market Tab
261
+ - Switch the skills install target between `Codex` and `Claude Code`
262
+ - Show the current local skills root, installed items, and importable items
263
+ - Scan importable sources under `Codex` / `Claude Code` / `Agents`
264
+ - Support cross-app import, ZIP import/export, and batch delete
265
+
266
+ ## MCP
267
+
268
+ > Transport: `stdio`
269
+
270
+ - Default: read-only tools
271
+ - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
272
+ - Domains: `tools`, `resources`, `prompts`
273
+
274
+ Examples:
275
+
276
+ ```bash
277
+ codexmate mcp serve --read-only
278
+ codexmate mcp serve --allow-write
279
+ ```
280
+
281
+ ## Config Files
282
+
283
+ - `~/.codex/config.toml`
284
+ - `~/.codex/auth.json`
285
+ - `~/.codex/models.json`
286
+ - `~/.codex/provider-current-models.json`
287
+ - `~/.claude/settings.json`
288
+ - `~/.claude/CLAUDE.md`
289
+ - `~/.openclaw/openclaw.json`
290
+ - `~/.openclaw/workspace/AGENTS.md`
291
+
292
+ ## Environment Variables
293
+
294
+ | Variable | Default | Description |
295
+ | --- | --- | --- |
296
+ | `CODEXMATE_PORT` | `3737` | Web server port |
297
+ | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
298
+ | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
299
+ | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
300
+ | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
301
+
302
+ ## Tech Stack
303
+
304
+ - Node.js
305
+ - Vue.js 3 (Web UI)
306
+ - Native HTTP server
307
+ - `@iarna/toml`, `json5`
308
+
309
+ ## Contributing
310
+
311
+ Issues and pull requests are accepted.
312
+
313
+ ## License
314
+
315
+ Apache-2.0
316
+
317
+ ### Claude Code Mode
318
+ - Multi-profile management
319
+ - Default write to `~/.claude/settings.json`
320
+ - `~/.claude/CLAUDE.md` editing
321
+ - Shareable import command copy
322
+
323
+ ### OpenClaw Mode
324
+ - JSON5 multi-profile management
325
+ - Apply to `~/.openclaw/openclaw.json`
326
+ - Manage `~/.openclaw/workspace/AGENTS.md`
327
+
328
+ ### Sessions Mode
329
+ - Unified Codex + Claude sessions
330
+ - Browser / Usage subview switching
331
+ - Local pin/unpin with persistent storage and pinned-first ordering
332
+ - Search, filter, export, delete, batch cleanup
333
+ - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
334
+
335
+ ### Skills Market Tab
336
+ - Switch the skills install target between `Codex` and `Claude Code`
337
+ - Show the current local skills root, installed items, and importable items
338
+ - Scan importable sources under `Codex` / `Claude Code` / `Agents`
339
+ - Support cross-app import, ZIP import/export, and batch delete
340
+
341
+ ## MCP
342
+
343
+ > Transport: `stdio`
344
+
345
+ - Default: read-only tools
346
+ - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
347
+ - Domains: `tools`, `resources`, `prompts`
348
+
349
+ Examples:
350
+
351
+ ```bash
352
+ codexmate mcp serve --read-only
353
+ codexmate mcp serve --allow-write
354
+ ```
355
+
356
+ ## Config Files
357
+
358
+ - `~/.codex/config.toml`
359
+ - `~/.codex/auth.json`
360
+ - `~/.codex/models.json`
361
+ - `~/.codex/provider-current-models.json`
362
+ - `~/.claude/settings.json`
363
+ - `~/.claude/CLAUDE.md`
364
+ - `~/.openclaw/openclaw.json`
365
+ - `~/.openclaw/workspace/AGENTS.md`
366
+
367
+ ## Environment Variables
368
+
369
+ | Variable | Default | Description |
370
+ | --- | --- | --- |
371
+ | `CODEXMATE_PORT` | `3737` | Web server port |
372
+ | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
373
+ | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
374
+ | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
375
+ | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
376
+
377
+ ## Tech Stack
378
+
379
+ - Node.js
380
+ - Vue.js 3 (Web UI)
381
+ - Native HTTP server
382
+ - `@iarna/toml`, `json5`
383
+
384
+ ## Contributing
385
+
386
+ Issues and pull requests are accepted.
387
+
388
+ ## License
389
+
390
+ Apache-2.0