codexmate 0.0.25 → 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 (135) hide show
  1. package/README.md +416 -413
  2. package/README.zh.md +349 -346
  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 -1079
  7. package/cli/claude-proxy.js +1022 -1022
  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 -356
  12. package/cli/openai-bridge.js +997 -997
  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 -118
  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 -14736
  23. package/lib/automation.js +404 -404
  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 -85
  28. package/lib/cli-session-utils.js +121 -121
  29. package/lib/cli-sessions.js +417 -417
  30. package/lib/cli-utils.js +155 -155
  31. package/lib/download-artifacts.js +92 -92
  32. package/lib/mcp-stdio.js +453 -453
  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 -74
  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 -612
  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 -128
  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 -670
  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 -205
  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 -544
  75. package/web-ui/modules/app.methods.session-browser.mjs +985 -722
  76. package/web-ui/modules/app.methods.session-timeline.mjs +479 -448
  77. package/web-ui/modules/app.methods.session-trash.mjs +424 -424
  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 -2055
  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 -475
  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 -303
  107. package/web-ui/partials/index/panel-settings.html +258 -258
  108. package/web-ui/partials/index/panel-usage.html +342 -361
  109. package/web-ui/res/json5.min.js +1 -1
  110. package/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 -423
  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 -603
  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 -454
  125. package/web-ui/styles/sessions-list.css +415 -398
  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 -912
  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
package/README.md CHANGED
@@ -1,413 +1,416 @@
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 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/Gemini CLI/CodeBuddy Code 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 + Gemini CLI + CodeBuddy Code session list
61
- - Session locations (local-first, configurable):
62
- - Codex: `~/.codex/sessions/*.jsonl` (or `$CODEX_HOME/sessions`, `$XDG_CONFIG_HOME/codex/sessions`)
63
- - Claude: `~/.claude/projects/**/**/*.jsonl` (or `$CLAUDE_HOME/projects`, `$XDG_CONFIG_HOME/claude/projects`)
64
- - Gemini: `~/.gemini/tmp/*/chats/*.json` (or `$GEMINI_HOME/tmp`, `$XDG_CONFIG_HOME/gemini/tmp`)
65
- - CodeBuddy: `~/.codebuddy/projects/**/**/*.jsonl` (or `$CODEBUDDY_CODE_HOME_DIR/projects`)
66
- - Local session pinning with persistent pinned state and pinned-first ordering
67
- - Keyword/source/cwd/role/time filters, plus shareable filter links
68
- - Copy resume command (Codex/Gemini/CodeBuddy): `codex resume <sessionId>` / `gemini -r <sessionId>` / `codebuddy -r <sessionId>`
69
- - Fast search UX: short-lived query result caching to avoid rescanning on each keystroke
70
- - Usage subview with 7d / 30d session trends, message trends, source share, and top paths
71
- - Markdown export (Web UI + `codexmate export-session`, supports `--session-id` or `--file`)
72
- - Session-level and message-level delete (supports batch), with a local recycle bin for restore/purge
73
- - Large-session preview optimization (fast tail preview path)
74
-
75
- **Skills Market**
76
- - Switch the skills install target between Codex and Claude Code
77
- - Inspect local installed skills, root paths, and status
78
- - Scan importable sources from `Codex` / `Claude Code` / `Agents`
79
- - Support cross-app import, ZIP import/export, and batch delete
80
-
81
- **Plugins**
82
- - Prompt templates: save, edit, and reuse prompts with variables
83
- - Compose + copy workflow for fast prompt iteration (stored locally in browser storage)
84
-
85
- **Engineering Utilities**
86
- - MCP stdio domains (`tools`, `resources`, `prompts`)
87
- - Automation hooks (`/hooks/*`) + outbound webhook notifiers
88
- - Built-in proxy controls (`proxy`)
89
- - Auth profile management (`auth`)
90
- - Zip/unzip utilities
91
-
92
- ## Automation (signal action)
93
-
94
- When running `codexmate run`, you can accept external webhooks and convert them into queued tasks:
95
-
96
- - Webhook entry: `POST /hooks/<source>` (currently `github`, `gitlab`)
97
- - Rule config: `~/.codex/codexmate-automation.json`
98
- - Supported action: `task.queue.add` (optionally `startQueue: true`)
99
- - Notifications: `notifiers[]` supports `type: "webhook"` for Slack/Feishu-style incoming webhooks
100
-
101
- ## Architecture
102
-
103
- ### At a glance (what it does → what you get)
104
-
105
- ```mermaid
106
- flowchart LR
107
- subgraph You["You"]
108
- CLI["CLI"]
109
- WEB["Web UI"]
110
- MCP["MCP (stdio)"]
111
- end
112
-
113
- subgraph Mate["Codex Mate (local control panel)"]
114
- API["Local HTTP API"]
115
- CFG["Config management"]
116
- SESS["Sessions & Usage"]
117
- SKL["Skills management"]
118
- PLG["Plugins: Prompt templates"]
119
- end
120
-
121
- subgraph Files["Local files only (auditable & reversible)"]
122
- CODEX["~/.codex/*"]
123
- CLAUDE["~/.claude/settings.json + CLAUDE.md"]
124
- OPENCLAW["~/.openclaw/*.json5 + ~/.openclaw/openclaw.json + workspace/AGENTS.md"]
125
- SKILLS["~/.{codex,claude,agents}/skills"]
126
- STATE["sessions / usage / trash / runs"]
127
- BROWSER["Browser storage (templates)"]
128
- end
129
-
130
- CLI --> API
131
- WEB --> API
132
- MCP --> API
133
- WEB --> PLG
134
-
135
- API --> CFG
136
- API --> SESS
137
- API --> SKL
138
- PLG --> BROWSER
139
-
140
- CFG --> CODEX
141
- CFG --> CLAUDE
142
- CFG --> OPENCLAW
143
- SKL --> SKILLS
144
- SESS --> STATE
145
- ```
146
-
147
- ### Capability → Local target → Outcome
148
-
149
- | Capability | Local target | What you get |
150
- | --- | --- | --- |
151
- | Config management (Codex / Claude / OpenClaw) | `~/.codex/*`, `~/.claude/settings.json`, `~/.claude/CLAUDE.md`, `~/.openclaw/*` | Faster provider/model switching, multi-profile management, safer writes with backups |
152
- | Sessions & Usage | sessions / usage aggregates / trash | Quickly locate sessions, filter/export, batch cleanup, and view trends |
153
- | Skills market | `~/.{codex,claude,agents}/skills` | Local install/import/export (ZIP), cross-app reuse |
154
- | Plugins (Prompt templates) | Browser storage | Reusable prompt templates with variables and one-click copy |
155
- | MCP (stdio) | local API + file operations | Integrate with external tools under controllable permissions (read-only by default) |
156
-
157
- ## Quick Start
158
-
159
- ### Install from npm
160
-
161
- ```bash
162
- npm install -g codexmate
163
- codexmate setup
164
- codexmate status
165
- codexmate run
166
- ```
167
-
168
- Default listen address is `0.0.0.0:3737` for LAN access, and browser auto-open is enabled by default.
169
-
170
- > 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`.
171
-
172
- ### Install Codex CLI / Claude Code CLI (optional)
173
-
174
- Codex Mate can pass through to the official CLIs (e.g. `codexmate codex ...`). Install them first:
175
-
176
- ```bash
177
- # Codex CLI (default)
178
- npm install -g @openai/codex
179
-
180
- # Codex CLI on Termux (Android)
181
- npm install -g @mmmbuto/codex-cli-termux@latest
182
-
183
- # Claude Code
184
- npm install -g @anthropic-ai/claude-code
185
-
186
- # Gemini CLI
187
- npm install -g @google/gemini-cli
188
-
189
- # CodeBuddy Code
190
- npm install -g @tencent-ai/codebuddy-code
191
- ```
192
-
193
- ### Run from source
194
-
195
- ```bash
196
- git clone https://github.com/SakuraByteCore/codexmate.git
197
- cd codexmate
198
- npm install
199
- npm start run
200
- ```
201
-
202
- ### Tests / CI (service only)
203
-
204
- ```bash
205
- npm start run --no-browser
206
- ```
207
-
208
- > Convention: automated tests validate service and API behavior only, without opening browser pages.
209
-
210
- ### Developer helper scripts
211
-
212
- ```bash
213
- npm run reset
214
- npm run reset 79
215
- ```
216
-
217
- - `npm run reset`: reset to default `origin/main`
218
- - `npm run reset 79`: sync directly to the latest head snapshot of PR `#79`
219
- - The script also handles local branch switching, workspace cleanup, untracked file cleanup, and final state validation
220
-
221
- ## Command Reference
222
-
223
- | Command | Description |
224
- | --- | --- |
225
- | `codexmate status` | Show current config status |
226
- | `codexmate setup` | Interactive setup |
227
- | `codexmate list` / `codexmate models` | List providers / models |
228
- | `codexmate switch <provider>` / `codexmate use <model>` | Switch provider / model |
229
- | `codexmate add <name> <URL> [API_KEY]` | Add provider |
230
- | `codexmate delete <name>` | Delete provider |
231
- | `codexmate claude <BaseURL> <API_KEY> [model]` | Write Claude Code config |
232
- | `codexmate auth <list\|import\|switch\|delete\|status>` | Auth profile management |
233
- | `codexmate workflow <list\|get\|validate\|run\|runs>` | MCP workflow management |
234
- | `codexmate codex [args...] [--follow-up <text> repeatable]` | Codex CLI passthrough entrypoint (auto-adds `--yolo`, supports queued follow-up appends) |
235
- | `codexmate qwen [args...]` | Qwen CLI passthrough entrypoint |
236
- | `codexmate run [--host <HOST>] [--no-browser]` | Start Web UI |
237
- | `codexmate mcp serve [--read-only\|--allow-write]` | Start MCP stdio server |
238
- | `codexmate export-session --source <codex\|claude\|gemini\|codebuddy> ...` | Export session to Markdown |
239
- | `codexmate zip <path> [--max:0-9]` / `codexmate unzip <zip> [out]` | Zip / unzip |
240
- | `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) |
241
-
242
- ### Codex Follow-up Append (Optional)
243
-
244
- ```bash
245
- codexmate codex --follow-up "scan repository first" --follow-up "then fix failing tests"
246
- codexmate codex --model gpt-5.3-codex --follow-up "step1" --follow-up "step2"
247
- ```
248
-
249
- > Note: both `--follow-up` and `--queued-follow-up` are accepted and repeatable.
250
-
251
- ## Web UI
252
-
253
- ### Codex Mode
254
- - Provider/model switching
255
- - Model list management
256
- - `~/.codex/AGENTS.md` editing
257
-
258
- ### Claude Code Mode
259
- - Multi-profile management
260
- - Default write to `~/.claude/settings.json`
261
- - `~/.claude/CLAUDE.md` editing
262
- - Shareable import command copy
263
-
264
- ### OpenClaw Mode
265
- - JSON5 multi-profile management
266
- - Apply to `~/.openclaw/openclaw.json`
267
- - Manage `~/.openclaw/workspace/AGENTS.md`
268
-
269
- ### Plugins Mode (Prompt Templates)
270
- - Entry: switch to **Plugins** → **Prompt Templates**
271
- - Manage custom templates (JSON import/export)
272
- - Variables: in **Manage**, you can “Add variable” (inserts `{{var}}`) and fill variable values in the Variables panel
273
- - Generate & copy: after filling variables, copy the final rendered prompt from **Preview**
274
- - Built-in template: ships a single read-only template for light code-comment polishing
275
-
276
- ### Sessions Mode
277
- - Unified Codex + Claude sessions
278
- - Browser / Usage subview switching
279
- - Local pin/unpin with persistent storage and pinned-first ordering
280
- - Search, filter, export, delete, batch cleanup
281
- - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
282
-
283
- ### Skills Market Tab
284
- - Switch the skills install target between `Codex` and `Claude Code`
285
- - Show the current local skills root, installed items, and importable items
286
- - Scan importable sources under `Codex` / `Claude Code` / `Agents`
287
- - Support cross-app import, ZIP import/export, and batch delete
288
-
289
- ## MCP
290
-
291
- > Transport: `stdio`
292
-
293
- - Default: read-only tools
294
- - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
295
- - Domains: `tools`, `resources`, `prompts`
296
-
297
- Examples:
298
-
299
- ```bash
300
- codexmate mcp serve --read-only
301
- codexmate mcp serve --allow-write
302
- ```
303
-
304
- ## Config Files
305
-
306
- - `~/.codex/config.toml`
307
- - `~/.codex/auth.json`
308
- - `~/.codex/models.json`
309
- - `~/.codex/provider-current-models.json`
310
- - `~/.claude/settings.json`
311
- - `~/.claude/CLAUDE.md`
312
- - `~/.openclaw/openclaw.json`
313
- - `~/.openclaw/workspace/AGENTS.md`
314
-
315
- ## Environment Variables
316
-
317
- | Variable | Default | Description |
318
- | --- | --- | --- |
319
- | `CODEXMATE_PORT` | `3737` | Web server port |
320
- | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
321
- | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
322
- | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
323
- | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
324
-
325
- ## Tech Stack
326
-
327
- - Node.js
328
- - Vue.js 3 (Web UI)
329
- - Native HTTP server
330
- - `@iarna/toml`, `json5`
331
-
332
- ## Contributing
333
-
334
- Issues and pull requests are accepted.
335
-
336
- ## License
337
-
338
- Apache-2.0
339
-
340
- ### Claude Code Mode
341
- - Multi-profile management
342
- - Default write to `~/.claude/settings.json`
343
- - `~/.claude/CLAUDE.md` editing
344
- - Shareable import command copy
345
-
346
- ### OpenClaw Mode
347
- - JSON5 multi-profile management
348
- - Apply to `~/.openclaw/openclaw.json`
349
- - Manage `~/.openclaw/workspace/AGENTS.md`
350
-
351
- ### Sessions Mode
352
- - Unified Codex + Claude sessions
353
- - Browser / Usage subview switching
354
- - Local pin/unpin with persistent storage and pinned-first ordering
355
- - Search, filter, export, delete, batch cleanup
356
- - Usage view includes 7d / 30d session trends, message trends, source share, and top paths
357
-
358
- ### Skills Market Tab
359
- - Switch the skills install target between `Codex` and `Claude Code`
360
- - Show the current local skills root, installed items, and importable items
361
- - Scan importable sources under `Codex` / `Claude Code` / `Agents`
362
- - Support cross-app import, ZIP import/export, and batch delete
363
-
364
- ## MCP
365
-
366
- > Transport: `stdio`
367
-
368
- - Default: read-only tools
369
- - Enable writes: `--allow-write` or `CODEXMATE_MCP_ALLOW_WRITE=1`
370
- - Domains: `tools`, `resources`, `prompts`
371
-
372
- Examples:
373
-
374
- ```bash
375
- codexmate mcp serve --read-only
376
- codexmate mcp serve --allow-write
377
- ```
378
-
379
- ## Config Files
380
-
381
- - `~/.codex/config.toml`
382
- - `~/.codex/auth.json`
383
- - `~/.codex/models.json`
384
- - `~/.codex/provider-current-models.json`
385
- - `~/.claude/settings.json`
386
- - `~/.claude/CLAUDE.md`
387
- - `~/.openclaw/openclaw.json`
388
- - `~/.openclaw/workspace/AGENTS.md`
389
-
390
- ## Environment Variables
391
-
392
- | Variable | Default | Description |
393
- | --- | --- | --- |
394
- | `CODEXMATE_PORT` | `3737` | Web server port |
395
- | `CODEXMATE_HOST` | `0.0.0.0` | Web listen host (set `127.0.0.1` for local-only access) |
396
- | `CODEXMATE_NO_BROWSER` | unset | Set `1` to disable browser auto-open |
397
- | `CODEXMATE_MCP_ALLOW_WRITE` | unset | Set `1` to allow MCP write tools by default |
398
- | `CODEXMATE_FORCE_RESET_EXISTING_CONFIG` | `0` | Set `1` to force bootstrap reset of existing config |
399
-
400
- ## Tech Stack
401
-
402
- - Node.js
403
- - Vue.js 3 (Web UI)
404
- - Native HTTP server
405
- - `@iarna/toml`, `json5`
406
-
407
- ## Contributing
408
-
409
- Issues and pull requests are accepted.
410
-
411
- ## License
412
-
413
- 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