codexmate 0.0.10 → 0.0.13

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 (50) hide show
  1. package/README.md +52 -12
  2. package/README.zh-CN.md +52 -12
  3. package/cli.js +3491 -563
  4. package/{CHANGELOG.md → doc/CHANGELOG.md} +6 -0
  5. package/{CHANGELOG.zh-CN.md → doc/CHANGELOG.zh-CN.md} +6 -0
  6. package/lib/mcp-stdio.js +440 -0
  7. package/package.json +22 -2
  8. package/res/logo.png +0 -0
  9. package/web-ui/app.js +1171 -149
  10. package/web-ui/index.html +1605 -0
  11. package/web-ui/logic.mjs +21 -21
  12. package/web-ui/styles.css +3213 -0
  13. package/web-ui.html +7 -3967
  14. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -27
  15. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  16. package/.github/workflows/ci.yml +0 -26
  17. package/.github/workflows/release.yml +0 -159
  18. package/.planning/.fix-attempts +0 -1
  19. package/.planning/.lock +0 -6
  20. package/.planning/.verify-cache.json +0 -14
  21. package/.planning/CHECKPOINT.json +0 -46
  22. package/.planning/DESIGN.md +0 -26
  23. package/.planning/HISTORY.json +0 -124
  24. package/.planning/PLAN.md +0 -69
  25. package/.planning/REVIEW.md +0 -41
  26. package/.planning/STATE.md +0 -12
  27. package/.planning/STATS.json +0 -13
  28. package/.planning/VERIFICATION.md +0 -70
  29. package/.planning/daude-code-plan.md +0 -51
  30. package/.planning/research/architecture.md +0 -32
  31. package/.planning/research/conventions.md +0 -36
  32. package/.planning/task_1-REVIEW.md +0 -29
  33. package/.planning/task_1-SUMMARY.md +0 -32
  34. package/.planning/task_2-REVIEW.md +0 -24
  35. package/.planning/task_2-SUMMARY.md +0 -37
  36. package/.planning/task_3-REVIEW.md +0 -25
  37. package/.planning/task_3-SUMMARY.md +0 -31
  38. package/cmd/publish-npm.cmd +0 -65
  39. package/tests/e2e/helpers.js +0 -214
  40. package/tests/e2e/recent-health.e2e.js +0 -142
  41. package/tests/e2e/run.js +0 -154
  42. package/tests/e2e/test-claude.js +0 -21
  43. package/tests/e2e/test-config.js +0 -124
  44. package/tests/e2e/test-health-speed.js +0 -79
  45. package/tests/e2e/test-openclaw.js +0 -47
  46. package/tests/e2e/test-session-search.js +0 -114
  47. package/tests/e2e/test-sessions.js +0 -69
  48. package/tests/e2e/test-setup.js +0 -159
  49. package/tests/unit/run.mjs +0 -29
  50. package/tests/unit/web-ui-logic.test.mjs +0 -186
package/README.md CHANGED
@@ -1,11 +1,24 @@
1
1
  # Codex Mate
2
2
 
3
- > A lightweight AI configuration assistant: quickly switch Codex providers/models and Claude Code configs, with a unified session browser
3
+ <div align="center">
4
4
 
5
- [![Build](https://img.shields.io/github/actions/workflow/status/ymkiux/codexmate/release.yml?label=build)](https://github.com/ymkiux/codexmate/actions/workflows/release.yml) [![Version](https://img.shields.io/npm/v/codexmate?label=version&registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/codexmate) [![Status](https://img.shields.io/badge/status-alpha-orange)](https://github.com/ymkiux/codexmate)
6
- [![Maintain](https://img.shields.io/github/commit-activity/m/ymkiux/codexmate?label=maintain%2Fmonth)](https://github.com/ymkiux/codexmate/commits) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) [![Node](https://img.shields.io/badge/node-%3E%3D14.0.0-green.svg)](https://nodejs.org)
5
+ <img src="res/logo.png" alt="Codex Mate logo" width="110">
7
6
 
8
- English | [Chinese](README.zh-CN.md)
7
+ [![Build](https://img.shields.io/github/actions/workflow/status/ymkiux/codexmate/release.yml?label=build)](https://github.com/ymkiux/codexmate/actions/workflows/release.yml)
8
+ [![Version](https://img.shields.io/npm/v/codexmate?label=version&registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/codexmate)
9
+ [![Downloads](https://img.shields.io/npm/dt/codexmate?label=downloads)](https://www.npmjs.com/package/codexmate)
10
+ [![Status](https://img.shields.io/badge/status-alpha-orange)](https://github.com/ymkiux/codexmate)
11
+ [![Maintain](https://img.shields.io/github/commit-activity/m/ymkiux/codexmate?label=maintain%2Fmonth)](https://github.com/ymkiux/codexmate/commits)
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
+ **A lightweight AI configuration assistant: quickly switch Codex providers/models and Claude Code configs, with a unified session browser**
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ <p align="center">English · <a href="README.zh-CN.md">中文版</a></p>
9
22
 
10
23
  ![Codex Mate Web UI](res/screenshot.png)
11
24
 
@@ -15,12 +28,12 @@ One tool to switch Codex/Claude Code providers & models and manage/browse local
15
28
 
16
29
  ## What You Get
17
30
 
18
- - One-command provider/model switching
19
- - Local config control with backups
20
- - Lightweight Web UI instead of heavy clients
21
- - Unified session browser (view/export/resume when available)
22
- - Session management: list/filter/export/delete local sessions; keyword search supports Codex and Claude
23
- - New in 0.0.9: Claude sessions are searchable by keywords (e.g., `claude code`, `claude-code`, numeric tokens)
31
+ - One-command provider/model switching
32
+ - Local config control with backups
33
+ - Lightweight Web UI instead of heavy clients
34
+ - Unified session browser (view/export/resume when available)
35
+ - Session management: list/filter/export/delete local sessions; keyword search supports Codex and Claude
36
+ - New in 0.0.10: Claude sessions are searchable by keywords (e.g., `claude code`, `claude-code`, numeric tokens)
24
37
 
25
38
  ## Feature Overview
26
39
 
@@ -29,7 +42,7 @@ One tool to switch Codex/Claude Code providers & models and manage/browse local
29
42
  | Codex Config | Switching providers/models is painful | Provider/model switching, model management, CLI + Web entry points, template-confirmed writes |
30
43
  | Claude Code Config | Multiple profiles and inconsistent write paths | Profile management, default write to `~/.claude/settings.json` |
31
44
  | OpenClaw Config | OpenClaw configs are scattered | JSON5 profiles, apply to `~/.openclaw/openclaw.json`, AGENTS workspace management |
32
- | Session Browser | Local sessions are hard to track | List/filter sessions, keyword search (Codex + Claude), export to Markdown, copy resume command (when available), delete and batch cleanup |
45
+ | Session Browser | Local sessions are hard to track | List/filter sessions, keyword search (Codex + Claude), export to Markdown, copy resume command (when available), delete and batch cleanup |
33
46
  | Utilities | Compression/extraction requires extra tools | 7-Zip preferred, JS fallback |
34
47
 
35
48
  ## Why Codex Mate
@@ -156,8 +169,30 @@ npm link
156
169
  | `codexmate add-model <model>` | Add a model |
157
170
  | `codexmate delete-model <model>` | Delete a model |
158
171
  | `codexmate run` | Start the Web UI |
172
+ | `codexmate mcp [serve] [--transport stdio] [--allow-write\|--read-only]` | Start MCP server over stdio (default read-only) |
159
173
  | `codexmate export-session --source <codex|claude> (--session-id <ID>|--file <PATH>) [--output <PATH>] [--max-messages <N|all|Infinity>]` | Export a session to Markdown |
160
174
 
175
+ ## MCP (stdio)
176
+
177
+ - Transport: `stdio` only
178
+ - Default mode: read-only tool set
179
+ - Write tools: enable by `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
180
+ - Sensitive fields in `codexmate.claude.settings.get` are returned as masked values
181
+
182
+ ```bash
183
+ # Read-only (recommended for external agents)
184
+ codexmate mcp serve --read-only
185
+
186
+ # Enable write tools explicitly
187
+ codexmate mcp serve --allow-write
188
+ ```
189
+
190
+ Provided MCP domains:
191
+
192
+ - `tools`: status/provider/model/session/auth/proxy and config operations
193
+ - `resources`: status/providers/sessions snapshots
194
+ - `prompts`: built-in diagnose/switch/export templates
195
+
161
196
  ## Web UI
162
197
 
163
198
  Start the Web UI (auto opens browser):
@@ -358,7 +393,7 @@ Note: 7-Zip is optional. If missing, the built-in JS library is used. `--max` on
358
393
 
359
394
  ## Release (GitHub Actions)
360
395
 
361
- Create a tag that matches `package.json` (for example `v0.0.8`). Then run the `release` workflow in GitHub Actions and input that tag. It will create a GitHub Release and attach the `npm pack` `.tgz` artifact.
396
+ Create a tag that matches `package.json` (for example `v0.0.9`). Then run the `release` workflow in GitHub Actions and input that tag. It will create a GitHub Release and attach the `npm pack` `.tgz` artifact.
362
397
 
363
398
  ## License
364
399
 
@@ -368,6 +403,11 @@ Apache-2.0 © [ymkiux](https://github.com/ymkiux)
368
403
 
369
404
  Issues and pull requests are welcome.
370
405
 
406
+ ## Changelog
407
+
408
+ See [doc/CHANGELOG.md](doc/CHANGELOG.md) for the English version.
409
+ See [doc/CHANGELOG.zh-CN.md](doc/CHANGELOG.zh-CN.md) for the Chinese version.
410
+
371
411
  ---
372
412
 
373
413
  Made with [ymkiux](https://github.com/ymkiux)
package/README.zh-CN.md CHANGED
@@ -1,11 +1,24 @@
1
1
  # Codex Mate
2
2
 
3
- > 轻量级 AI 工具配置助手:快速切换 Codex 提供商/模型与 Claude Code 配置,并统一管理两者会话
3
+ <div align="center">
4
4
 
5
- [![Build](https://img.shields.io/github/actions/workflow/status/ymkiux/codexmate/release.yml?label=build)](https://github.com/ymkiux/codexmate/actions/workflows/release.yml) [![Version](https://img.shields.io/npm/v/codexmate?label=version&registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/codexmate) [![Status](https://img.shields.io/badge/status-alpha-orange)](https://github.com/ymkiux/codexmate)
6
- [![Maintain](https://img.shields.io/github/commit-activity/m/ymkiux/codexmate?label=maintain%2Fmonth)](https://github.com/ymkiux/codexmate/commits) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) [![Node](https://img.shields.io/badge/node-%3E%3D14.0.0-green.svg)](https://nodejs.org)
5
+ <img src="res/logo.png" alt="Codex Mate logo" width="110">
7
6
 
8
- [English](README.md) | 中文
7
+ [![Build](https://img.shields.io/github/actions/workflow/status/ymkiux/codexmate/release.yml?label=build)](https://github.com/ymkiux/codexmate/actions/workflows/release.yml)
8
+ [![Version](https://img.shields.io/npm/v/codexmate?label=version&registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/codexmate)
9
+ [![Downloads](https://img.shields.io/npm/dt/codexmate?label=downloads)](https://www.npmjs.com/package/codexmate)
10
+ [![Status](https://img.shields.io/badge/status-alpha-orange)](https://github.com/ymkiux/codexmate)
11
+ [![Maintain](https://img.shields.io/github/commit-activity/m/ymkiux/codexmate?label=maintain%2Fmonth)](https://github.com/ymkiux/codexmate/commits)
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
+ **轻量级 AI 配置助手:快速切换 Codex 提供商/模型与 Claude Code 配置,统一浏览本地会话**
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ <p align="center"><a href="README.md">English</a> · 中文</p>
9
22
 
10
23
  ![Codex Mate Web UI](res/screenshot.png)
11
24
 
@@ -16,17 +29,17 @@ Codex Mate 让 Codex 与 Claude Code 的提供商/模型切换变成“一条命
16
29
  ## 你能获得什么
17
30
 
18
31
  - 更快的模型/提供商切换
19
- - 更可控的本地配置管理
20
- - 可视化 Web 操作,降低命令行负担
21
- - 配置变更可回溯、有备份
22
- - Codex + Claude Code 统一会话浏览(查看/导出/可用时复制恢复命令)
23
- - 0.0.9 新增:Claude 会话支持关键词搜索(含 `claude code` / `claude-code` / 数字关键词)
32
+ - 更可控的本地配置管理
33
+ - 可视化 Web 操作,降低命令行负担
34
+ - 配置变更可回溯、有备份
35
+ - Codex + Claude Code 统一会话浏览(查看/导出/可用时复制恢复命令)
36
+ - 0.0.10 新增:Claude 会话支持关键词搜索(含 `claude code` / `claude-code` / 数字关键词)
24
37
 
25
38
  ## 概览
26
39
 
27
40
  一键切换 Codex/Claude Code 提供商与模型,并把本地会话统一管理/浏览/导出。
28
41
 
29
- - 会话管理:列表/筛选/导出/删除 Codex/Claude 本地会话;关键词搜索支持 Codex/Claude
42
+ - 会话管理:列表/筛选/导出/删除 Codex/Claude 本地会话;关键词搜索支持 Codex/Claude
30
43
 
31
44
  ## 功能总览
32
45
 
@@ -35,7 +48,7 @@ Codex Mate 让 Codex 与 Claude Code 的提供商/模型切换变成“一条命
35
48
  | Codex 配置 | 多提供商/多模型切换麻烦 | 提供商/模型切换、模型管理、CLI + Web 双入口、模板确认写入 |
36
49
  | Claude Code 配置 | 多方案共存、写入路径不统一 | 多配置方案管理、默认写入 `~/.claude/settings.json` |
37
50
  | OpenClaw 配置 | OpenClaw 配置分散 | JSON5 多配置管理、应用到 `~/.openclaw/openclaw.json`、Workspace 指令文件管理 |
38
- | 会话浏览 | 本地会话难以追踪 | 会话列表/筛选、关键词搜索(支持 Codex/Claude)、Markdown 导出、可用时复制恢复命令、删除与批量清理 |
51
+ | 会话浏览 | 本地会话难以追踪 | 会话列表/筛选、关键词搜索(支持 Codex/Claude)、Markdown 导出、可用时复制恢复命令、删除与批量清理 |
39
52
  | 附属工具 | 压缩/解压需额外工具 | 优先 7-Zip,JS 库兜底 |
40
53
 
41
54
  ## 为什么选 Codex Mate
@@ -162,8 +175,30 @@ npm link
162
175
  | `codexmate add-model <模型名称>` | 添加模型 |
163
176
  | `codexmate delete-model <模型名称>` | 删除模型 |
164
177
  | `codexmate run` | 启动 Web 界面 |
178
+ | `codexmate mcp [serve] [--transport stdio] [--allow-write\|--read-only]` | 启动 MCP stdio 服务(默认只读) |
165
179
  | `codexmate export-session --source <codex|claude> (--session-id <ID>|--file <PATH>) [--output <PATH>] [--max-messages <N|all|Infinity>]` | 导出指定会话为 Markdown |
166
180
 
181
+ ## MCP(stdio)
182
+
183
+ - 传输方式:仅支持 `stdio`
184
+ - 默认模式:只读工具集
185
+ - 写入工具开启方式:`--allow-write` 或 `CODEXMATE_MCP_ALLOW_WRITE=1`
186
+ - `codexmate.claude.settings.get` 的敏感字段默认脱敏返回
187
+
188
+ ```bash
189
+ # 只读(推荐给外部 Agent 接入)
190
+ codexmate mcp serve --read-only
191
+
192
+ # 显式开启写工具
193
+ codexmate mcp serve --allow-write
194
+ ```
195
+
196
+ 当前提供的 MCP 能力:
197
+
198
+ - `tools`:状态/提供商/模型/会话/认证/代理/配置等操作
199
+ - `resources`:status/providers/sessions 快照资源
200
+ - `prompts`:诊断/安全切换/会话导出模板
201
+
167
202
  ## Web 界面
168
203
 
169
204
  启动 Web 界面(自动打开浏览器):
@@ -364,7 +399,7 @@ codexmate unzip ./backup.zip D:/restored
364
399
 
365
400
  ## 发布(GitHub Actions)
366
401
 
367
- 创建与 `package.json` 版本一致的标签(例如 `v0.0.8`)。然后在 GitHub Actions 中手动运行 `release` 工作流并输入该标签,系统会创建 GitHub Release,并附带 `npm pack` 生成的 `.tgz` 产物。
402
+ 创建与 `package.json` 版本一致的标签(例如 `v0.0.9`)。然后在 GitHub Actions 中手动运行 `release` 工作流并输入该标签,系统会创建 GitHub Release,并附带 `npm pack` 生成的 `.tgz` 产物。
368
403
 
369
404
  ## 许可证
370
405
 
@@ -374,6 +409,11 @@ Apache-2.0 © [ymkiux](https://github.com/ymkiux)
374
409
 
375
410
  欢迎提交 Issue 和 Pull Request。
376
411
 
412
+ ## 更新日志
413
+
414
+ 英文版见 [doc/CHANGELOG.md](doc/CHANGELOG.md)。
415
+ 中文版见 [doc/CHANGELOG.zh-CN.md](doc/CHANGELOG.zh-CN.md)。
416
+
377
417
  ---
378
418
 
379
419
  Made with [ymkiux](https://github.com/ymkiux)