codexmate 0.0.24 → 0.0.26

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 (136) hide show
  1. package/README.md +416 -391
  2. package/README.zh.md +349 -324
  3. package/cli/agents-files.js +224 -224
  4. package/cli/archive-helpers.js +446 -446
  5. package/cli/auth-profiles.js +375 -375
  6. package/cli/builtin-proxy.js +1079 -1044
  7. package/cli/claude-proxy.js +1022 -998
  8. package/cli/config-bootstrap.js +384 -384
  9. package/cli/config-health.js +338 -338
  10. package/cli/doctor-core.js +903 -903
  11. package/cli/import-skills-url.js +356 -334
  12. package/cli/openai-bridge.js +997 -950
  13. package/cli/openclaw-config.js +629 -629
  14. package/cli/session-convert-args.js +65 -0
  15. package/cli/session-convert-io.js +82 -0
  16. package/cli/session-convert.js +43 -0
  17. package/cli/session-usage.concurrent.js +28 -28
  18. package/cli/session-usage.js +118 -112
  19. package/cli/session-usage.models.js +176 -176
  20. package/cli/skills.js +1141 -1141
  21. package/cli/zip-commands.js +510 -510
  22. package/cli.js +15218 -13310
  23. package/lib/automation.js +404 -0
  24. package/lib/cli-file-utils.js +151 -151
  25. package/lib/cli-models-utils.js +379 -379
  26. package/lib/cli-network-utils.js +190 -190
  27. package/lib/cli-path-utils.js +85 -69
  28. package/lib/cli-session-utils.js +121 -121
  29. package/lib/cli-sessions.js +417 -386
  30. package/lib/cli-utils.js +155 -155
  31. package/lib/download-artifacts.js +92 -77
  32. package/lib/mcp-stdio.js +453 -440
  33. package/lib/task-orchestrator.js +869 -869
  34. package/lib/text-diff.js +303 -303
  35. package/lib/workflow-engine.js +340 -340
  36. package/package.json +74 -77
  37. package/plugins/README.md +20 -20
  38. package/plugins/README.zh-CN.md +20 -20
  39. package/plugins/prompt-templates/comment-polish/index.mjs +25 -25
  40. package/plugins/prompt-templates/computed.mjs +253 -253
  41. package/plugins/prompt-templates/index.mjs +8 -8
  42. package/plugins/prompt-templates/manifest.mjs +15 -15
  43. package/plugins/prompt-templates/methods.mjs +619 -619
  44. package/plugins/prompt-templates/overview.mjs +90 -90
  45. package/plugins/prompt-templates/ownership.mjs +19 -19
  46. package/plugins/prompt-templates/rule-ack/index.mjs +21 -21
  47. package/plugins/prompt-templates/storage.mjs +64 -64
  48. package/plugins/registry.mjs +16 -16
  49. package/web-ui/app.js +625 -609
  50. package/web-ui/index.html +35 -35
  51. package/web-ui/logic.agents-diff.mjs +386 -386
  52. package/web-ui/logic.claude.mjs +168 -168
  53. package/web-ui/logic.mjs +5 -5
  54. package/web-ui/logic.runtime.mjs +128 -128
  55. package/web-ui/logic.session-convert.mjs +70 -0
  56. package/web-ui/logic.sessions.mjs +709 -614
  57. package/web-ui/modules/api.mjs +90 -90
  58. package/web-ui/modules/app.computed.dashboard.mjs +171 -126
  59. package/web-ui/modules/app.computed.index.mjs +17 -17
  60. package/web-ui/modules/app.computed.main-tabs.mjs +205 -205
  61. package/web-ui/modules/app.computed.session.mjs +946 -653
  62. package/web-ui/modules/app.constants.mjs +15 -15
  63. package/web-ui/modules/app.methods.agents.mjs +632 -632
  64. package/web-ui/modules/app.methods.claude-config.mjs +179 -174
  65. package/web-ui/modules/app.methods.codex-config.mjs +860 -784
  66. package/web-ui/modules/app.methods.index.mjs +92 -92
  67. package/web-ui/modules/app.methods.install.mjs +205 -177
  68. package/web-ui/modules/app.methods.navigation.mjs +743 -695
  69. package/web-ui/modules/app.methods.openclaw-core.mjs +814 -814
  70. package/web-ui/modules/app.methods.openclaw-editing.mjs +372 -372
  71. package/web-ui/modules/app.methods.openclaw-persist.mjs +369 -369
  72. package/web-ui/modules/app.methods.providers.mjs +404 -404
  73. package/web-ui/modules/app.methods.runtime.mjs +345 -345
  74. package/web-ui/modules/app.methods.session-actions.mjs +596 -537
  75. package/web-ui/modules/app.methods.session-browser.mjs +985 -698
  76. package/web-ui/modules/app.methods.session-timeline.mjs +479 -448
  77. package/web-ui/modules/app.methods.session-trash.mjs +424 -422
  78. package/web-ui/modules/app.methods.startup-claude.mjs +522 -417
  79. package/web-ui/modules/app.methods.task-orchestration.mjs +556 -556
  80. package/web-ui/modules/config-mode.computed.mjs +124 -124
  81. package/web-ui/modules/config-template-confirm-pref.mjs +33 -33
  82. package/web-ui/modules/i18n.dict.mjs +2113 -2039
  83. package/web-ui/modules/i18n.mjs +56 -56
  84. package/web-ui/modules/plugins.computed.mjs +3 -3
  85. package/web-ui/modules/plugins.methods.mjs +3 -3
  86. package/web-ui/modules/plugins.storage.mjs +11 -11
  87. package/web-ui/modules/sessions-filters-url.mjs +85 -85
  88. package/web-ui/modules/skills.computed.mjs +107 -107
  89. package/web-ui/modules/skills.methods.mjs +481 -481
  90. package/web-ui/partials/index/layout-footer.html +13 -13
  91. package/web-ui/partials/index/layout-header.html +475 -465
  92. package/web-ui/partials/index/modal-config-template-agents.html +174 -174
  93. package/web-ui/partials/index/modal-confirm-toast.html +32 -32
  94. package/web-ui/partials/index/modal-health-check.html +45 -45
  95. package/web-ui/partials/index/modal-openclaw-config.html +280 -280
  96. package/web-ui/partials/index/modal-skills.html +200 -200
  97. package/web-ui/partials/index/modals-basic.html +165 -165
  98. package/web-ui/partials/index/panel-config-claude.html +184 -179
  99. package/web-ui/partials/index/panel-config-codex.html +283 -283
  100. package/web-ui/partials/index/panel-config-openclaw.html +83 -83
  101. package/web-ui/partials/index/panel-dashboard.html +186 -186
  102. package/web-ui/partials/index/panel-docs.html +147 -147
  103. package/web-ui/partials/index/panel-market.html +177 -177
  104. package/web-ui/partials/index/panel-orchestration.html +391 -391
  105. package/web-ui/partials/index/panel-plugins.html +279 -279
  106. package/web-ui/partials/index/panel-sessions.html +326 -301
  107. package/web-ui/partials/index/panel-settings.html +258 -258
  108. package/web-ui/partials/index/panel-usage.html +342 -354
  109. package/{res → web-ui/res}/json5.min.js +1 -1
  110. package/{res → web-ui/res}/vue.global.prod.js +13 -13
  111. package/web-ui/session-helpers.mjs +576 -573
  112. package/web-ui/source-bundle.cjs +233 -233
  113. package/web-ui/styles/base-theme.css +268 -264
  114. package/web-ui/styles/controls-forms.css +423 -376
  115. package/web-ui/styles/dashboard.css +274 -274
  116. package/web-ui/styles/docs-panel.css +247 -247
  117. package/web-ui/styles/feedback.css +108 -108
  118. package/web-ui/styles/health-check-dialog.css +144 -144
  119. package/web-ui/styles/layout-shell.css +603 -602
  120. package/web-ui/styles/modals-core.css +464 -464
  121. package/web-ui/styles/navigation-panels.css +390 -390
  122. package/web-ui/styles/openclaw-structured.css +266 -266
  123. package/web-ui/styles/plugins-panel.css +523 -523
  124. package/web-ui/styles/responsive.css +454 -456
  125. package/web-ui/styles/sessions-list.css +415 -400
  126. package/web-ui/styles/sessions-preview.css +411 -411
  127. package/web-ui/styles/sessions-toolbar-trash.css +330 -268
  128. package/web-ui/styles/sessions-usage.css +945 -888
  129. package/web-ui/styles/settings-panel.css +166 -166
  130. package/web-ui/styles/skills-list.css +303 -303
  131. package/web-ui/styles/skills-market.css +406 -406
  132. package/web-ui/styles/task-orchestration.css +822 -822
  133. package/web-ui/styles/titles-cards.css +408 -408
  134. package/web-ui/styles.css +21 -21
  135. package/web-ui.html +17 -17
  136. /package/{res → web-ui/res}/logo-pack.webp +0 -0
package/README.md CHANGED
@@ -1,391 +1,416 @@
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
- - Fast search UX: short-lived query result caching to avoid rescanning on each keystroke
64
- - Usage subview with 7d / 30d session trends, message trends, source share, and top paths
65
- - Markdown export
66
- - Session-level and message-level delete (supports batch), with a local recycle bin for restore/purge
67
- - Large-session preview optimization (fast tail preview path)
68
-
69
- **Skills Market**
70
- - Switch the skills install target between Codex and Claude Code
71
- - Inspect local installed skills, root paths, and status
72
- - Scan importable sources from `Codex` / `Claude Code` / `Agents`
73
- - Support cross-app import, ZIP import/export, and batch delete
74
-
75
- **Plugins**
76
- - Prompt templates: save, edit, and reuse prompts with variables
77
- - Compose + copy workflow for fast prompt iteration (stored locally in browser storage)
78
-
79
- **Engineering Utilities**
80
- - MCP stdio domains (`tools`, `resources`, `prompts`)
81
- - Built-in proxy controls (`proxy`)
82
- - Auth profile management (`auth`)
83
- - Zip/unzip utilities
84
-
85
- ## Architecture
86
-
87
- ### At a glance (what it does → what you get)
88
-
89
- ```mermaid
90
- flowchart LR
91
- subgraph You["You"]
92
- CLI["CLI"]
93
- WEB["Web UI"]
94
- MCP["MCP (stdio)"]
95
- end
96
-
97
- subgraph Mate["Codex Mate (local control panel)"]
98
- API["Local HTTP API"]
99
- CFG["Config management"]
100
- SESS["Sessions & Usage"]
101
- SKL["Skills management"]
102
- PLG["Plugins: Prompt templates"]
103
- end
104
-
105
- subgraph Files["Local files only (auditable & reversible)"]
106
- CODEX["~/.codex/*"]
107
- CLAUDE["~/.claude/settings.json + CLAUDE.md"]
108
- OPENCLAW["~/.openclaw/*.json5 + ~/.openclaw/openclaw.json + workspace/AGENTS.md"]
109
- SKILLS["~/.{codex,claude,agents}/skills"]
110
- STATE["sessions / usage / trash / runs"]
111
- BROWSER["Browser storage (templates)"]
112
- end
113
-
114
- CLI --> API
115
- WEB --> API
116
- MCP --> API
117
- WEB --> PLG
118
-
119
- API --> CFG
120
- API --> SESS
121
- API --> SKL
122
- PLG --> BROWSER
123
-
124
- CFG --> CODEX
125
- CFG --> CLAUDE
126
- CFG --> OPENCLAW
127
- SKL --> SKILLS
128
- SESS --> STATE
129
- ```
130
-
131
- ### Capability → Local target → Outcome
132
-
133
- | Capability | Local target | What you get |
134
- | --- | --- | --- |
135
- | Config management (Codex / Claude / OpenClaw) | `~/.codex/*`, `~/.claude/settings.json`, `~/.claude/CLAUDE.md`, `~/.openclaw/*` | Faster provider/model switching, multi-profile management, safer writes with backups |
136
- | Sessions & Usage | sessions / usage aggregates / trash | Quickly locate sessions, filter/export, batch cleanup, and view trends |
137
- | Skills market | `~/.{codex,claude,agents}/skills` | Local install/import/export (ZIP), cross-app reuse |
138
- | Plugins (Prompt templates) | Browser storage | Reusable prompt templates with variables and one-click copy |
139
- | MCP (stdio) | local API + file operations | Integrate with external tools under controllable permissions (read-only by default) |
140
-
141
- ## Quick Start
142
-
143
- ### Install from npm
144
-
145
- ```bash
146
- npm install -g codexmate
147
- codexmate setup
148
- codexmate status
149
- codexmate run
150
- ```
151
-
152
- Default listen address is `0.0.0.0:3737` for LAN access, and browser auto-open is enabled by default.
153
-
154
- > 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`.
155
-
156
- ### Install Codex CLI / Claude Code CLI (optional)
157
-
158
- Codex Mate can pass through to the official CLIs (e.g. `codexmate codex ...`). Install them first:
159
-
160
- ```bash
161
- # Codex CLI (default)
162
- npm install -g @openai/codex
163
-
164
- # Codex CLI on Termux (Android)
165
- npm install -g @mmmbuto/codex-cli-termux@latest
166
-
167
- # Claude Code
168
- npm install -g @anthropic-ai/claude-code
169
- ```
170
-
171
- ### Run from source
172
-
173
- ```bash
174
- git clone https://github.com/SakuraByteCore/codexmate.git
175
- cd codexmate
176
- npm install
177
- npm start run
178
- ```
179
-
180
- ### Tests / CI (service only)
181
-
182
- ```bash
183
- npm start run --no-browser
184
- ```
185
-
186
- > Convention: automated tests validate service and API behavior only, without opening browser pages.
187
-
188
- ### Developer helper scripts
189
-
190
- ```bash
191
- npm run reset
192
- npm run reset 79
193
- ```
194
-
195
- - `npm run reset`: reset to default `origin/main`
196
- - `npm run reset 79`: sync directly to the latest head snapshot of PR `#79`
197
- - The script also handles local branch switching, workspace cleanup, untracked file cleanup, and final state validation
198
-
199
- ## Command Reference
200
-
201
- | Command | Description |
202
- | --- | --- |
203
- | `codexmate status` | Show current config status |
204
- | `codexmate setup` | Interactive setup |
205
- | `codexmate list` / `codexmate models` | List providers / models |
206
- | `codexmate switch <provider>` / `codexmate use <model>` | Switch provider / model |
207
- | `codexmate add <name> <URL> [API_KEY]` | Add provider |
208
- | `codexmate delete <name>` | Delete provider |
209
- | `codexmate claude <BaseURL> <API_KEY> [model]` | Write Claude Code config |
210
- | `codexmate auth <list\|import\|switch\|delete\|status>` | Auth profile management |
211
- | `codexmate workflow <list\|get\|validate\|run\|runs>` | MCP workflow management |
212
- | `codexmate codex [args...] [--follow-up <text> repeatable]` | Codex CLI passthrough entrypoint (auto-adds `--yolo`, supports queued follow-up appends) |
213
- | `codexmate qwen [args...]` | Qwen CLI passthrough entrypoint |
214
- | `codexmate run [--host <HOST>] [--no-browser]` | Start Web UI |
215
- | `codexmate mcp serve [--read-only\|--allow-write]` | Start MCP stdio server |
216
- | `codexmate export-session --source <codex\|claude> ...` | Export session to Markdown |
217
- | `codexmate zip <path> [--max:0-9]` / `codexmate unzip <zip> [out]` | Zip / unzip |
218
- | `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) |
219
-
220
- ### Codex Follow-up Append (Optional)
221
-
222
- ```bash
223
- codexmate codex --follow-up "scan repository first" --follow-up "then fix failing tests"
224
- codexmate codex --model gpt-5.3-codex --follow-up "step1" --follow-up "step2"
225
- ```
226
-
227
- > Note: both `--follow-up` and `--queued-follow-up` are accepted and repeatable.
228
-
229
- ## Web UI
230
-
231
- ### Codex Mode
232
- - Provider/model switching
233
- - Model list management
234
- - `~/.codex/AGENTS.md` editing
235
-
236
- ### Claude Code Mode
237
- - Multi-profile management
238
- - Default write to `~/.claude/settings.json`
239
- - `~/.claude/CLAUDE.md` editing
240
- - Shareable import command copy
241
-
242
- ### OpenClaw Mode
243
- - JSON5 multi-profile management
244
- - Apply to `~/.openclaw/openclaw.json`
245
- - Manage `~/.openclaw/workspace/AGENTS.md`
246
-
247
- ### Plugins Mode (Prompt Templates)
248
- - Entry: switch to **Plugins** **Prompt Templates**
249
- - Manage custom templates (JSON import/export)
250
- - Variables: in **Manage**, you can “Add variable” (inserts `{{var}}`) and fill variable values in the Variables panel
251
- - Generate & copy: after filling variables, copy the final rendered prompt from **Preview**
252
- - Built-in template: ships a single read-only template for light code-comment polishing
253
-
254
- ### Sessions Mode
255
- - Unified Codex + Claude sessions
256
- - Browser / Usage subview switching
257
- - Local pin/unpin with persistent storage and pinned-first ordering
258
- - Search, filter, export, delete, batch cleanup
259
- - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
260
-
261
- ### Skills Market Tab
262
- - Switch the skills install target between `Codex` and `Claude Code`
263
- - Show the current local skills root, installed items, and importable items
264
- - Scan importable sources under `Codex` / `Claude Code` / `Agents`
265
- - Support cross-app import, ZIP import/export, and batch delete
266
-
267
- ## MCP
268
-
269
- > Transport: `stdio`
270
-
271
- - Default: read-only tools
272
- - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
273
- - Domains: `tools`, `resources`, `prompts`
274
-
275
- Examples:
276
-
277
- ```bash
278
- codexmate mcp serve --read-only
279
- codexmate mcp serve --allow-write
280
- ```
281
-
282
- ## Config Files
283
-
284
- - `~/.codex/config.toml`
285
- - `~/.codex/auth.json`
286
- - `~/.codex/models.json`
287
- - `~/.codex/provider-current-models.json`
288
- - `~/.claude/settings.json`
289
- - `~/.claude/CLAUDE.md`
290
- - `~/.openclaw/openclaw.json`
291
- - `~/.openclaw/workspace/AGENTS.md`
292
-
293
- ## Environment Variables
294
-
295
- | Variable | Default | Description |
296
- | --- | --- | --- |
297
- | `CODEXMATE_PORT` | `3737` | Web server port |
298
- | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
299
- | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
300
- | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
301
- | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
302
-
303
- ## Tech Stack
304
-
305
- - Node.js
306
- - Vue.js 3 (Web UI)
307
- - Native HTTP server
308
- - `@iarna/toml`, `json5`
309
-
310
- ## Contributing
311
-
312
- Issues and pull requests are accepted.
313
-
314
- ## License
315
-
316
- Apache-2.0
317
-
318
- ### Claude Code Mode
319
- - Multi-profile management
320
- - Default write to `~/.claude/settings.json`
321
- - `~/.claude/CLAUDE.md` editing
322
- - Shareable import command copy
323
-
324
- ### OpenClaw Mode
325
- - JSON5 multi-profile management
326
- - Apply to `~/.openclaw/openclaw.json`
327
- - Manage `~/.openclaw/workspace/AGENTS.md`
328
-
329
- ### Sessions Mode
330
- - Unified Codex + Claude sessions
331
- - Browser / Usage subview switching
332
- - Local pin/unpin with persistent storage and pinned-first ordering
333
- - Search, filter, export, delete, batch cleanup
334
- - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
335
-
336
- ### Skills Market Tab
337
- - Switch the skills install target between `Codex` and `Claude Code`
338
- - Show the current local skills root, installed items, and importable items
339
- - Scan importable sources under `Codex` / `Claude Code` / `Agents`
340
- - Support cross-app import, ZIP import/export, and batch delete
341
-
342
- ## MCP
343
-
344
- > Transport: `stdio`
345
-
346
- - Default: read-only tools
347
- - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
348
- - Domains: `tools`, `resources`, `prompts`
349
-
350
- Examples:
351
-
352
- ```bash
353
- codexmate mcp serve --read-only
354
- codexmate mcp serve --allow-write
355
- ```
356
-
357
- ## Config Files
358
-
359
- - `~/.codex/config.toml`
360
- - `~/.codex/auth.json`
361
- - `~/.codex/models.json`
362
- - `~/.codex/provider-current-models.json`
363
- - `~/.claude/settings.json`
364
- - `~/.claude/CLAUDE.md`
365
- - `~/.openclaw/openclaw.json`
366
- - `~/.openclaw/workspace/AGENTS.md`
367
-
368
- ## Environment Variables
369
-
370
- | Variable | Default | Description |
371
- | --- | --- | --- |
372
- | `CODEXMATE_PORT` | `3737` | Web server port |
373
- | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
374
- | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
375
- | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
376
- | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
377
-
378
- ## Tech Stack
379
-
380
- - Node.js
381
- - Vue.js 3 (Web UI)
382
- - Native HTTP server
383
- - `@iarna/toml`, `json5`
384
-
385
- ## Contributing
386
-
387
- Issues and pull requests are accepted.
388
-
389
- ## License
390
-
391
- Apache-2.0
1
+ <div align="center">
2
+
3
+ <img src="site/.vitepress/public/images/logo.png" alt="Codex Mate logo" width="180" />
4
+
5
+ # Codex Mate
6
+
7
+ **Local-first CLI + Web UI that edits your AI tool configs and sessions directly on disk, with built-in usage analytics and safe rollback.**
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
+ <br />
20
+ <img src="site/.vitepress/public/images/readme-hero.png" alt="Codex Mate screenshot" width="960" />
21
+
22
+ </div>
23
+
24
+ ---
25
+
26
+ ## What Is This?
27
+
28
+ Codex Mate is a local-first CLI + Web UI for unified management of:
29
+
30
+ - Codex provider/model switching and config writes
31
+ - Claude Code profiles (writes to `~/.claude/settings.json`)
32
+ - Claude Code `CLAUDE.md` editing (writes to `~/.claude/CLAUDE.md`)
33
+ - OpenClaw JSON5 profiles and workspace `AGENTS.md`
34
+ - Local skills market for Codex / Claude Code (target switching, local skills management, cross-app import, ZIP distribution)
35
+ - Local Codex/Claude/Gemini CLI/CodeBuddy Code sessions (list/filter/export/delete) with Usage analytics overview
36
+ - Plugins (Prompt templates): reusable templates with variables and one-click copy
37
+ - Task orchestration: plan/queue/run/review local tasks
38
+
39
+ 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.
40
+
41
+ ## Comparison
42
+
43
+ | Dimension | Codex Mate | Manual File Editing |
44
+ | --- | --- | --- |
45
+ | Multi-tool management | Codex + Claude Code + OpenClaw in one entry | Different files and folders per tool |
46
+ | Operation mode | CLI + local Web UI | Manual TOML/JSON/JSON5 edits |
47
+ | Session handling | Browse/filter/Usage analytics/export/batch cleanup | Manual file location and processing |
48
+ | Skills reuse | Local skills market + cross-app import + ZIP distribution | Manual folder copy and reconciliation |
49
+ | Operational visibility | Unified view of config, sessions, and Usage summaries | Depends on manual file inspection and scattered commands |
50
+ | Rollback readiness | Backup before first takeover | Easy to overwrite by mistake |
51
+ | Automation integration | MCP stdio (read-only by default) | Requires custom scripting |
52
+
53
+ ## Core Features
54
+
55
+ **Configuration**
56
+ - Provider/model switching (`switch`, `use`)
57
+ - Codex `config.toml` template confirmation before write
58
+ - Claude Code profile management and apply
59
+ - Claude Code `CLAUDE.md` editing (writes to `~/.claude/CLAUDE.md`)
60
+ - OpenClaw JSON5 profile management
61
+
62
+ **Session Management**
63
+ - Unified Codex + Claude + Gemini CLI + CodeBuddy Code session list
64
+ - Session locations (local-first, configurable):
65
+ - Codex: `~/.codex/sessions/*.jsonl` (or `$CODEX_HOME/sessions`, `$XDG_CONFIG_HOME/codex/sessions`)
66
+ - Claude: `~/.claude/projects/**/**/*.jsonl` (or `$CLAUDE_HOME/projects`, `$XDG_CONFIG_HOME/claude/projects`)
67
+ - Gemini: `~/.gemini/tmp/*/chats/*.json` (or `$GEMINI_HOME/tmp`, `$XDG_CONFIG_HOME/gemini/tmp`)
68
+ - CodeBuddy: `~/.codebuddy/projects/**/**/*.jsonl` (or `$CODEBUDDY_CODE_HOME_DIR/projects`)
69
+ - Local session pinning with persistent pinned state and pinned-first ordering
70
+ - Keyword/source/cwd/role/time filters, plus shareable filter links
71
+ - Copy resume command (Codex/Gemini/CodeBuddy): `codex resume <sessionId>` / `gemini -r <sessionId>` / `codebuddy -r <sessionId>`
72
+ - Fast search UX: short-lived query result caching to avoid rescanning on each keystroke
73
+ - Usage subview with 7d / 30d session trends, message trends, source share, and top paths
74
+ - Markdown export (Web UI + `codexmate export-session`, supports `--session-id` or `--file`)
75
+ - Session-level and message-level delete (supports batch), with a local recycle bin for restore/purge
76
+ - Large-session preview optimization (fast tail preview path)
77
+
78
+ **Skills Market**
79
+ - Switch the skills install target between Codex and Claude Code
80
+ - Inspect local installed skills, root paths, and status
81
+ - Scan importable sources from `Codex` / `Claude Code` / `Agents`
82
+ - Support cross-app import, ZIP import/export, and batch delete
83
+
84
+ **Plugins**
85
+ - Prompt templates: save, edit, and reuse prompts with variables
86
+ - Compose + copy workflow for fast prompt iteration (stored locally in browser storage)
87
+
88
+ **Engineering Utilities**
89
+ - MCP stdio domains (`tools`, `resources`, `prompts`)
90
+ - Automation hooks (`/hooks/*`) + outbound webhook notifiers
91
+ - Built-in proxy controls (`proxy`)
92
+ - Auth profile management (`auth`)
93
+ - Zip/unzip utilities
94
+
95
+ ## Automation (signal → action)
96
+
97
+ When running `codexmate run`, you can accept external webhooks and convert them into queued tasks:
98
+
99
+ - Webhook entry: `POST /hooks/<source>` (currently `github`, `gitlab`)
100
+ - Rule config: `~/.codex/codexmate-automation.json`
101
+ - Supported action: `task.queue.add` (optionally `startQueue: true`)
102
+ - Notifications: `notifiers[]` supports `type: "webhook"` for Slack/Feishu-style incoming webhooks
103
+
104
+ ## Architecture
105
+
106
+ ### At a glance (what it does → what you get)
107
+
108
+ ```mermaid
109
+ flowchart LR
110
+ subgraph You["You"]
111
+ CLI["CLI"]
112
+ WEB["Web UI"]
113
+ MCP["MCP (stdio)"]
114
+ end
115
+
116
+ subgraph Mate["Codex Mate (local control panel)"]
117
+ API["Local HTTP API"]
118
+ CFG["Config management"]
119
+ SESS["Sessions & Usage"]
120
+ SKL["Skills management"]
121
+ PLG["Plugins: Prompt templates"]
122
+ end
123
+
124
+ subgraph Files["Local files only (auditable & reversible)"]
125
+ CODEX["~/.codex/*"]
126
+ CLAUDE["~/.claude/settings.json + CLAUDE.md"]
127
+ OPENCLAW["~/.openclaw/*.json5 + ~/.openclaw/openclaw.json + workspace/AGENTS.md"]
128
+ SKILLS["~/.{codex,claude,agents}/skills"]
129
+ STATE["sessions / usage / trash / runs"]
130
+ BROWSER["Browser storage (templates)"]
131
+ end
132
+
133
+ CLI --> API
134
+ WEB --> API
135
+ MCP --> API
136
+ WEB --> PLG
137
+
138
+ API --> CFG
139
+ API --> SESS
140
+ API --> SKL
141
+ PLG --> BROWSER
142
+
143
+ CFG --> CODEX
144
+ CFG --> CLAUDE
145
+ CFG --> OPENCLAW
146
+ SKL --> SKILLS
147
+ SESS --> STATE
148
+ ```
149
+
150
+ ### Capability → Local target → Outcome
151
+
152
+ | Capability | Local target | What you get |
153
+ | --- | --- | --- |
154
+ | Config management (Codex / Claude / OpenClaw) | `~/.codex/*`, `~/.claude/settings.json`, `~/.claude/CLAUDE.md`, `~/.openclaw/*` | Faster provider/model switching, multi-profile management, safer writes with backups |
155
+ | Sessions & Usage | sessions / usage aggregates / trash | Quickly locate sessions, filter/export, batch cleanup, and view trends |
156
+ | Skills market | `~/.{codex,claude,agents}/skills` | Local install/import/export (ZIP), cross-app reuse |
157
+ | Plugins (Prompt templates) | Browser storage | Reusable prompt templates with variables and one-click copy |
158
+ | MCP (stdio) | local API + file operations | Integrate with external tools under controllable permissions (read-only by default) |
159
+
160
+ ## Quick Start
161
+
162
+ ### Install from npm
163
+
164
+ ```bash
165
+ npm install -g codexmate
166
+ codexmate setup
167
+ codexmate status
168
+ codexmate run
169
+ ```
170
+
171
+ Default listen address is `0.0.0.0:3737` for LAN access, and browser auto-open is enabled by default.
172
+
173
+ > 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`.
174
+
175
+ ### Install Codex CLI / Claude Code CLI (optional)
176
+
177
+ Codex Mate can pass through to the official CLIs (e.g. `codexmate codex ...`). Install them first:
178
+
179
+ ```bash
180
+ # Codex CLI (default)
181
+ npm install -g @openai/codex
182
+
183
+ # Codex CLI on Termux (Android)
184
+ npm install -g @mmmbuto/codex-cli-termux@latest
185
+
186
+ # Claude Code
187
+ npm install -g @anthropic-ai/claude-code
188
+
189
+ # Gemini CLI
190
+ npm install -g @google/gemini-cli
191
+
192
+ # CodeBuddy Code
193
+ npm install -g @tencent-ai/codebuddy-code
194
+ ```
195
+
196
+ ### Run from source
197
+
198
+ ```bash
199
+ git clone https://github.com/SakuraByteCore/codexmate.git
200
+ cd codexmate
201
+ npm install
202
+ npm start run
203
+ ```
204
+
205
+ ### Tests / CI (service only)
206
+
207
+ ```bash
208
+ npm start run --no-browser
209
+ ```
210
+
211
+ > Convention: automated tests validate service and API behavior only, without opening browser pages.
212
+
213
+ ### Developer helper scripts
214
+
215
+ ```bash
216
+ npm run reset
217
+ npm run reset 79
218
+ ```
219
+
220
+ - `npm run reset`: reset to default `origin/main`
221
+ - `npm run reset 79`: sync directly to the latest head snapshot of PR `#79`
222
+ - The script also handles local branch switching, workspace cleanup, untracked file cleanup, and final state validation
223
+
224
+ ## Command Reference
225
+
226
+ | Command | Description |
227
+ | --- | --- |
228
+ | `codexmate status` | Show current config status |
229
+ | `codexmate setup` | Interactive setup |
230
+ | `codexmate list` / `codexmate models` | List providers / models |
231
+ | `codexmate switch <provider>` / `codexmate use <model>` | Switch provider / model |
232
+ | `codexmate add <name> <URL> [API_KEY]` | Add provider |
233
+ | `codexmate delete <name>` | Delete provider |
234
+ | `codexmate claude <BaseURL> <API_KEY> [model]` | Write Claude Code config |
235
+ | `codexmate auth <list\|import\|switch\|delete\|status>` | Auth profile management |
236
+ | `codexmate workflow <list\|get\|validate\|run\|runs>` | MCP workflow management |
237
+ | `codexmate codex [args...] [--follow-up <text> repeatable]` | Codex CLI passthrough entrypoint (auto-adds `--yolo`, supports queued follow-up appends) |
238
+ | `codexmate qwen [args...]` | Qwen CLI passthrough entrypoint |
239
+ | `codexmate run [--host <HOST>] [--no-browser]` | Start Web UI |
240
+ | `codexmate mcp serve [--read-only\|--allow-write]` | Start MCP stdio server |
241
+ | `codexmate export-session --source <codex\|claude\|gemini\|codebuddy> ...` | Export session to Markdown |
242
+ | `codexmate zip <path> [--max:0-9]` / `codexmate unzip <zip> [out]` | Zip / unzip |
243
+ | `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) |
244
+
245
+ ### Codex Follow-up Append (Optional)
246
+
247
+ ```bash
248
+ codexmate codex --follow-up "scan repository first" --follow-up "then fix failing tests"
249
+ codexmate codex --model gpt-5.3-codex --follow-up "step1" --follow-up "step2"
250
+ ```
251
+
252
+ > Note: both `--follow-up` and `--queued-follow-up` are accepted and repeatable.
253
+
254
+ ## Web UI
255
+
256
+ ### Codex Mode
257
+ - Provider/model switching
258
+ - Model list management
259
+ - `~/.codex/AGENTS.md` editing
260
+
261
+ ### Claude Code Mode
262
+ - Multi-profile management
263
+ - Default write to `~/.claude/settings.json`
264
+ - `~/.claude/CLAUDE.md` editing
265
+ - Shareable import command copy
266
+
267
+ ### OpenClaw Mode
268
+ - JSON5 multi-profile management
269
+ - Apply to `~/.openclaw/openclaw.json`
270
+ - Manage `~/.openclaw/workspace/AGENTS.md`
271
+
272
+ ### Plugins Mode (Prompt Templates)
273
+ - Entry: switch to **Plugins** → **Prompt Templates**
274
+ - Manage custom templates (JSON import/export)
275
+ - Variables: in **Manage**, you can “Add variable” (inserts `{{var}}`) and fill variable values in the Variables panel
276
+ - Generate & copy: after filling variables, copy the final rendered prompt from **Preview**
277
+ - Built-in template: ships a single read-only template for light code-comment polishing
278
+
279
+ ### Sessions Mode
280
+ - Unified Codex + Claude sessions
281
+ - Browser / Usage subview switching
282
+ - Local pin/unpin with persistent storage and pinned-first ordering
283
+ - Search, filter, export, delete, batch cleanup
284
+ - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
285
+
286
+ ### Skills Market Tab
287
+ - Switch the skills install target between `Codex` and `Claude Code`
288
+ - Show the current local skills root, installed items, and importable items
289
+ - Scan importable sources under `Codex` / `Claude Code` / `Agents`
290
+ - Support cross-app import, ZIP import/export, and batch delete
291
+
292
+ ## MCP
293
+
294
+ > Transport: `stdio`
295
+
296
+ - Default: read-only tools
297
+ - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
298
+ - Domains: `tools`, `resources`, `prompts`
299
+
300
+ Examples:
301
+
302
+ ```bash
303
+ codexmate mcp serve --read-only
304
+ codexmate mcp serve --allow-write
305
+ ```
306
+
307
+ ## Config Files
308
+
309
+ - `~/.codex/config.toml`
310
+ - `~/.codex/auth.json`
311
+ - `~/.codex/models.json`
312
+ - `~/.codex/provider-current-models.json`
313
+ - `~/.claude/settings.json`
314
+ - `~/.claude/CLAUDE.md`
315
+ - `~/.openclaw/openclaw.json`
316
+ - `~/.openclaw/workspace/AGENTS.md`
317
+
318
+ ## Environment Variables
319
+
320
+ | Variable | Default | Description |
321
+ | --- | --- | --- |
322
+ | `CODEXMATE_PORT` | `3737` | Web server port |
323
+ | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
324
+ | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
325
+ | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
326
+ | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
327
+
328
+ ## Tech Stack
329
+
330
+ - Node.js
331
+ - Vue.js 3 (Web UI)
332
+ - Native HTTP server
333
+ - `@iarna/toml`, `json5`
334
+
335
+ ## Contributing
336
+
337
+ Issues and pull requests are accepted.
338
+
339
+ ## License
340
+
341
+ Apache-2.0
342
+
343
+ ### Claude Code Mode
344
+ - Multi-profile management
345
+ - Default write to `~/.claude/settings.json`
346
+ - `~/.claude/CLAUDE.md` editing
347
+ - Shareable import command copy
348
+
349
+ ### OpenClaw Mode
350
+ - JSON5 multi-profile management
351
+ - Apply to `~/.openclaw/openclaw.json`
352
+ - Manage `~/.openclaw/workspace/AGENTS.md`
353
+
354
+ ### Sessions Mode
355
+ - Unified Codex + Claude sessions
356
+ - Browser / Usage subview switching
357
+ - Local pin/unpin with persistent storage and pinned-first ordering
358
+ - Search, filter, export, delete, batch cleanup
359
+ - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
360
+
361
+ ### Skills Market Tab
362
+ - Switch the skills install target between `Codex` and `Claude Code`
363
+ - Show the current local skills root, installed items, and importable items
364
+ - Scan importable sources under `Codex` / `Claude Code` / `Agents`
365
+ - Support cross-app import, ZIP import/export, and batch delete
366
+
367
+ ## MCP
368
+
369
+ > Transport: `stdio`
370
+
371
+ - Default: read-only tools
372
+ - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
373
+ - Domains: `tools`, `resources`, `prompts`
374
+
375
+ Examples:
376
+
377
+ ```bash
378
+ codexmate mcp serve --read-only
379
+ codexmate mcp serve --allow-write
380
+ ```
381
+
382
+ ## Config Files
383
+
384
+ - `~/.codex/config.toml`
385
+ - `~/.codex/auth.json`
386
+ - `~/.codex/models.json`
387
+ - `~/.codex/provider-current-models.json`
388
+ - `~/.claude/settings.json`
389
+ - `~/.claude/CLAUDE.md`
390
+ - `~/.openclaw/openclaw.json`
391
+ - `~/.openclaw/workspace/AGENTS.md`
392
+
393
+ ## Environment Variables
394
+
395
+ | Variable | Default | Description |
396
+ | --- | --- | --- |
397
+ | `CODEXMATE_PORT` | `3737` | Web server port |
398
+ | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
399
+ | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
400
+ | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
401
+ | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
402
+
403
+ ## Tech Stack
404
+
405
+ - Node.js
406
+ - Vue.js 3 (Web UI)
407
+ - Native HTTP server
408
+ - `@iarna/toml`, `json5`
409
+
410
+ ## Contributing
411
+
412
+ Issues and pull requests are accepted.
413
+
414
+ ## License
415
+
416
+ Apache-2.0