codexmate 0.1.30 → 0.1.32
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.
- package/README.md +98 -7
- package/README.vi.md +98 -7
- package/README.zh.md +99 -7
- package/cli/agents-files.js +18 -4
- package/cli/config-bootstrap.js +25 -11
- package/cli/plugin-config.js +64 -0
- package/cli/prompt-history.js +17 -4
- package/cli/system-prompt-files.js +7 -2
- package/cli.js +396 -46
- package/lib/cli-config-engine.js +266 -0
- package/lib/cli-utils.js +2 -1
- package/lib/cli-webhook.js +1 -1
- package/lib/handoff-mcp.js +282 -0
- package/lib/http-access-control.js +335 -0
- package/lib/session-context-health.js +82 -0
- package/lib/session-context-records.js +153 -0
- package/lib/thread-handoff.js +130 -0
- package/lib/web-startup-auth.js +53 -0
- package/lib/workflow-engine.js +92 -21
- package/lib/workflow-runner.js +261 -0
- package/package.json +1 -1
- package/plugins/prompt-templates/computed.mjs +3 -3
- package/plugins/prompt-templates/invocation.mjs +73 -0
- package/plugins/prompt-templates/methods.mjs +48 -3
- package/plugins/prompt-templates/overview.mjs +2 -0
- package/web-ui/app.js +48 -2
- package/web-ui/index.html +1 -0
- package/web-ui/logic.context-health.mjs +144 -0
- package/web-ui/modules/access-token.mjs +33 -0
- package/web-ui/modules/api.mjs +2 -1
- package/web-ui/modules/app.computed.prompts.mjs +11 -0
- package/web-ui/modules/app.methods.agents.mjs +20 -3
- package/web-ui/modules/app.methods.index.mjs +6 -0
- package/web-ui/modules/app.methods.navigation.mjs +17 -3
- package/web-ui/modules/app.methods.prompts-editor.mjs +7 -0
- package/web-ui/modules/app.methods.providers.mjs +2 -2
- package/web-ui/modules/app.methods.runtime.mjs +3 -2
- package/web-ui/modules/app.methods.session-actions.mjs +3 -0
- package/web-ui/modules/app.methods.session-browser.mjs +6 -2
- package/web-ui/modules/app.methods.system-prompt.mjs +17 -2
- package/web-ui/modules/app.methods.workflows.mjs +41 -0
- package/web-ui/modules/context-health.methods.mjs +70 -0
- package/web-ui/modules/i18n/locales/en.mjs +70 -2
- package/web-ui/modules/i18n/locales/ja.mjs +70 -2
- package/web-ui/modules/i18n/locales/vi.mjs +70 -2
- package/web-ui/modules/i18n/locales/zh-tw.mjs +70 -2
- package/web-ui/modules/i18n/locales/zh.mjs +70 -2
- package/web-ui/modules/plugins.methods.mjs +2 -0
- package/web-ui/modules/prompt-ecosystem.methods.mjs +136 -0
- package/web-ui/modules/sessions-filters-url.mjs +3 -0
- package/web-ui/modules/skills.methods.mjs +6 -5
- package/web-ui/modules/thread-handoff.mjs +142 -0
- package/web-ui/partials/index/context-health.html +45 -0
- package/web-ui/partials/index/modal-prompt-invocation.html +17 -0
- package/web-ui/partials/index/panel-config-claude.html +2 -0
- package/web-ui/partials/index/panel-config-codex.html +2 -0
- package/web-ui/partials/index/panel-config-kilocode.html +3 -1
- package/web-ui/partials/index/panel-config-openclaw.html +2 -0
- package/web-ui/partials/index/panel-config-opencode.html +3 -1
- package/web-ui/partials/index/panel-config-pi.html +2 -0
- package/web-ui/partials/index/panel-dashboard.html +59 -0
- package/web-ui/partials/index/panel-plugins.html +37 -9
- package/web-ui/partials/index/panel-prompts.html +46 -18
- package/web-ui/partials/index/panel-sessions.html +35 -44
- package/web-ui/partials/index/thread-handoff.html +59 -0
- package/web-ui/res/web-ui-render.precompiled.js +1289 -177
- package/web-ui/styles/context-health.css +107 -0
- package/web-ui/styles/controls-forms.css +9 -0
- package/web-ui/styles/dashboard.css +51 -0
- package/web-ui/styles/modals-core.css +87 -0
- package/web-ui/styles/navigation-panels.css +1 -1
- package/web-ui/styles/plugins-panel.css +62 -0
- package/web-ui/styles/prompts-editor.css +34 -4
- package/web-ui/styles/responsive.css +19 -10
- package/web-ui/styles/sessions-preview.css +206 -111
- package/web-ui/styles/sub-tabs.css +181 -0
- package/web-ui/styles.css +2 -0
package/README.md
CHANGED
|
@@ -41,14 +41,33 @@ Was last week's solution discussed in Codex or Claude Code? Narrow down your loc
|
|
|
41
41
|
|
|
42
42
|
Codex Mate manages existing tools and local records. It is not a new AI model or a replacement for your coding assistant. Start by finding one useful conversation, without configuring every tool first.
|
|
43
43
|
|
|
44
|
-
[Get started](#quick-start) · [Session guide (Chinese)](https://sakurabytecore.github.io/codexmate/guide/sessions)
|
|
44
|
+
[Get started](#quick-start) · [Session guide (Chinese)](https://sakurabytecore.github.io/codexmate/guide/sessions) · [Thread handoff](#thread-handoff)
|
|
45
|
+
|
|
46
|
+
## Comparison with Related Tools
|
|
47
|
+
|
|
48
|
+
Choose by primary use case rather than treating this as an exclusive feature checklist. These projects overlap and can be used together.
|
|
49
|
+
|
|
50
|
+
| Tool | Primary focus | Best fit |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| **Codex Mate** | Local-first, cross-tool session and configuration management through CLI + Web and desktop entry points | Find, filter, and export conversations from different tools in one place, alongside Provider, Skills, and task workflow management |
|
|
53
|
+
| [CC Switch](https://github.com/farion1231/cc-switch) | Desktop configuration manager for multiple AI coding tools, covering providers, MCP, Skills, and prompts | Switching API providers and reducing manual edits to each tool's configuration files |
|
|
54
|
+
| [CloudCLI (Claude Code UI)](https://github.com/siteboon/claudecodeui) | Desktop and mobile Web UI for Claude Code, Cursor CLI, and Codex | Using coding assistants from a browser or phone and accessing local or remote projects and sessions |
|
|
55
|
+
| [ccusage](https://github.com/ryoppippi/ccusage) | CLI for analyzing token usage and costs from local coding-agent records | Daily, weekly, monthly, or per-session usage and cost reports |
|
|
56
|
+
|
|
57
|
+
**Why choose Codex Mate?** Bring cross-tool conversation lookup, Markdown archiving, and everyday configuration, Skills, and task management into one entry point without replacing your coding assistant.
|
|
58
|
+
|
|
59
|
+
This comparison follows the official project descriptions linked above; it does not imply that other tools lack unlisted features and is not a performance or pricing ranking. Codex Mate's session operations vary by source; see the [session guide (Chinese)](https://sakurabytecore.github.io/codexmate/guide/sessions). Export and handoff do not provide lossless migration of complete session state, and running locally does not mean models run offline.
|
|
45
60
|
|
|
46
61
|
## Quick Start
|
|
47
62
|
|
|
48
|
-
|
|
63
|
+
For CLI + Web, install via Homebrew, npm, or curl below, then run `codexmate run`. Open the address printed in your terminal, select a source with existing records in the session browser, open a conversation, and use its export action. If there are no local records, create a conversation in the original tool first.
|
|
49
64
|
|
|
50
65
|
Exports are for reading and archiving, not restoring complete agent state in another tool. Use `codexmate setup` when you need to configure a provider. See the [quick-start guide (Chinese)](https://sakurabytecore.github.io/codexmate/guide/quick-start) for details.
|
|
51
66
|
|
|
67
|
+
### Install the Desktop App
|
|
68
|
+
|
|
69
|
+
Open the [latest release](https://github.com/SakuraByteCore/codexmate/releases/latest). Windows `.exe`, macOS `.dmg`, and Linux `.AppImage` packages appear in **Assets** only after the desktop builds complete. Download the package for your platform, install it, and launch the desktop app directly; `codexmate run` is not required.
|
|
70
|
+
|
|
52
71
|
### Install via Homebrew (macOS / Linux)
|
|
53
72
|
|
|
54
73
|
```bash
|
|
@@ -97,10 +116,42 @@ curl -fsSL https://raw.githubusercontent.com/SakuraByteCore/codexmate/main/scrip
|
|
|
97
116
|
|
|
98
117
|
---
|
|
99
118
|
|
|
119
|
+
## Thread handoff
|
|
120
|
+
|
|
121
|
+
Share a structured handoff card with a target agent through a shared-memory MCP. This does not restore complete session state. Save a `card.json` containing a `goal` string and string arrays for `completed`, `blockers`, `nextSteps`, and `files`:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"goal": "Finish the documentation update",
|
|
126
|
+
"completed": ["Reviewed the session guide"],
|
|
127
|
+
"blockers": [],
|
|
128
|
+
"nextSteps": ["Check the translated examples"],
|
|
129
|
+
"files": ["README.md"]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Run from the source checkout; after installation, replace `node cli.js` with `codexmate`:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
node cli.js thread handoff <thread-id> --card <json-file> --target <agent>
|
|
137
|
+
node cli.js thread list <thread-id>
|
|
138
|
+
node cli.js thread fallback <thread-id> --handoff <id>
|
|
139
|
+
node cli.js thread ack <thread-id> --handoff <id> --agent <target> --evidence <session-or-retrieval-id>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use the handoff's returned ID for `<id>`, the same target agent for `<target>`, and an actual session or retrieval ID for the evidence. Run `ack` only after the target reports reading the card.
|
|
143
|
+
|
|
144
|
+
- **File first, bounded MCP routing**: Save handoff files under `~/.codexmate/threads/<hash>/` first. Discover shared-memory MCPs by reading the project's `.mcp.json`, Claude user configuration, and Codex `config.toml` without modifying them. Select one MCP with a compatible native write tool and use a short-lived connection, not a daemon. Compatibility with arbitrary MCP versions is not guaranteed. No new dependencies or forced prompt insertion are added.
|
|
145
|
+
- **Explicit file fallback**: A failed MCP write does not retry automatically; the result reports the file path. `thread fallback` returns the file text. The session handoff area's copy-card button in the UI is also an explicit file fallback: paste the copied card into the target yourself; copying does not send it automatically.
|
|
146
|
+
- **Write success is not a read receipt**: A successful MCP write only sets `awaiting_read`, not proof that the target read the card. `thread ack` records the target's self-reported read with evidence, not an independently verified receipt.
|
|
147
|
+
- **Audit**: `thread list <thread-id>` returns the audit, including the selected MCP/tool, elapsed time, write result, fallback, and read status.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
100
151
|
## What's So Special?
|
|
101
152
|
|
|
102
153
|
After finding your conversations, manage the configuration, skills, and tasks used in your daily work:
|
|
103
|
-
- **Unified Session Browser**: Browse local sessions from Codex, Claude Code, Gemini CLI, CodeBuddy Code, WorkBuddy, Pi, OpenCode, and Zed in one place. Search, export, and deletion availability varies by source; see the [session guide (Chinese)](https://sakurabytecore.github.io/codexmate/guide/sessions).
|
|
154
|
+
- **Unified Session Browser**: Browse local sessions from Codex, Claude Code, Gemini CLI, CodeBuddy Code, WorkBuddy, Pi, OpenCode, and Zed in one place. Search, export, and deletion availability varies by source; see the [session guide (Chinese)](https://sakurabytecore.github.io/codexmate/guide/sessions). Session details show an always-visible five-category token breakdown, a composition bar, and a health rating.
|
|
104
155
|
- **OpenAI-Compatible Bridge**: Use Codex with any OpenAI-compatible UI by normalizing the Responses API; the built-in Codex conversion also fills and normalizes Codex fingerprint headers such as `User-Agent`, `Version`, `OpenAI-Beta`, and `Originator` so upstream providers see an official Codex CLI-shaped request.
|
|
105
156
|
- **Claude Provider Bridge**: Connect Claude Code to OpenAI Chat Completions-compatible providers and Ollama through the built-in local Claude-compatible proxy.
|
|
106
157
|
- **OpenCode Provider Control**: Manage OpenCode provider/model selection with a CodexMate-owned provider store under `~/.codexmate`, projecting only the active provider into native OpenCode config to avoid polluting or deleting user-owned settings.
|
|
@@ -109,7 +160,7 @@ After finding your conversations, manage the configuration, skills, and tasks us
|
|
|
109
160
|
- **Provider Health Cleanup**: Probe local Codex and Claude provider routes, surface failed configs in one modal, and bulk-clean selected broken providers without touching healthy or protected entries.
|
|
110
161
|
- **Skills Marketplace**: A local-first market to share and import skills between different agent apps.
|
|
111
162
|
- **Prompt File Editor**: Unified editor for global and project-level `CLAUDE.md` and `AGENTS.md` (including OpenCode's `~/.config/opencode/AGENTS.md`) with auto-detection of project paths, plus a shared preset pool for reusable prompts.
|
|
112
|
-
- **Task Orchestrator**:
|
|
163
|
+
- **Task Orchestrator**: Automatically advance existing workflows, persist progress and results, and request intervention only when blocked.
|
|
113
164
|
|
|
114
165
|
---
|
|
115
166
|
|
|
@@ -122,20 +173,60 @@ After finding your conversations, manage the configuration, skills, and tasks us
|
|
|
122
173
|
| **Session Browser** | ✅ | Browse and filter local sessions; search and Markdown export depend on the source. See the session guide |
|
|
123
174
|
| **Usage Analytics** | ✅ | Visualize message trends and top projects |
|
|
124
175
|
| **Local Skills Market** | ✅ | Cross-app import/export of agent skills |
|
|
125
|
-
| **Task Queue** | ✅ |
|
|
176
|
+
| **Task Queue** | ✅ | Dependency-aware automatic workflows, persistent progress, safe recovery, and result summaries |
|
|
126
177
|
| **OpenAI Bridge** | ✅ | Convert Codex Responses API to standard OpenAI format and attach/normalize Codex fingerprints in the built-in conversion |
|
|
127
178
|
| **Claude Provider Bridge** | ✅ | Connect Claude Code to OpenAI Chat Completions-compatible providers and Ollama via the built-in Claude-compatible proxy |
|
|
128
179
|
| **OpenCode Provider Store** | ✅ | Keep multiple OpenCode providers in `~/.codexmate` while projecting only the selected provider to native OpenCode config |
|
|
129
180
|
| **KiloCode Config Bridge** | ✅ | Configure KiloCode through `codexmate kilo config` or the Web UI, writing provider URL/model/API key data to `~/.config/kilo/kilo.jsonc` |
|
|
130
181
|
| **Pi Provider Config** | ✅ | Manage Pi providers in the Web UI writing to `~/.pi/agent/models.json` (unknown fields preserved) and switch the default provider/model in `~/.pi/agent/settings.json` |
|
|
131
182
|
| **Provider Health Check** | ✅ | Probe local Codex/Claude provider routes, highlight failed configs, and bulk-remove selected broken providers safely |
|
|
132
|
-
| **Prompt Templates** | ✅ |
|
|
133
|
-
| **Prompt File Editor** | ✅ | Edit global and project-level CLAUDE.md / AGENTS.md with
|
|
183
|
+
| **Prompt Templates** | ✅ | Variable-fill dialog on invocation, one-template JSON sharing, and versioned plugin template configuration with history Diff and rollback. `git_diff` is pasted text, not an executed command. |
|
|
184
|
+
| **Prompt File Editor** | ✅ | Edit global and project-level CLAUDE.md / AGENTS.md with a shared preset pool. Presets fill variables before updating the editor; save manually to write files. History shows version Diff; confirmed rollback writes the selected version with an atomic backup and concurrent-change checks. |
|
|
134
185
|
| **MCP Integration** | ✅ | Expose local tools and resources via MCP stdio |
|
|
135
186
|
| **Auto Update** | ✅ | Quick update CLI via `codexmate update` |
|
|
136
187
|
|
|
137
188
|
---
|
|
138
189
|
|
|
190
|
+
## Unattended Workflows
|
|
191
|
+
|
|
192
|
+
Reuse existing workflow definitions and let the backend advance tasks automatically after submission. The dashboard's workflow panel supports submission, result lookup, resuming with additional input, and cancellation of subsequent steps. Closing the page does not interrupt execution; tasks do not execute while the service is stopped.
|
|
193
|
+
|
|
194
|
+
### Start and Use
|
|
195
|
+
|
|
196
|
+
Start the local service in one terminal and keep it running:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
codexmate run --no-browser
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Submit tasks from another terminal. Use the returned record's `id` as `<runId>` in subsequent commands:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
codexmate workflow list --json
|
|
206
|
+
codexmate workflow submit diagnose-config --json
|
|
207
|
+
codexmate workflow active-runs --json
|
|
208
|
+
codexmate workflow detail <runId> --json
|
|
209
|
+
codexmate workflow resume <runId> --input @input.json --json
|
|
210
|
+
codexmate workflow cancel <runId> --json
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
- `resume` only resumes tasks waiting for intervention. Provide the complete updated input in `input.json`; omit `--input` to retain the original input.
|
|
214
|
+
- Write steps require explicit `--allow-write` permission and the corresponding tool configuration's write permission. Check actual side effects before resuming a write step with an uncertain outcome.
|
|
215
|
+
- The CLI connects to `127.0.0.1:3737` by default. For a custom port, set the same `CODEXMATE_PORT` in both terminals. When using an access token, use the same `CODEXMATE_HTTP_TOKEN` for the service and caller.
|
|
216
|
+
- The existing synchronous `codexmate workflow run` remains compatible. `workflow runs` reads its execution history; `workflow active-runs` reads persistent run records.
|
|
217
|
+
|
|
218
|
+
### Automatic Handling and Safety Boundaries
|
|
219
|
+
|
|
220
|
+
- Persist definition snapshots, input, node states, full output, and attempt counts. Result summaries include completed items, the final result, and reasons for unfinished work.
|
|
221
|
+
- After a service restart, resume confirmed-safe read-only nodes without repeating successful nodes. Write or unclassified nodes with uncertain outcomes wait for intervention instead of replaying automatically.
|
|
222
|
+
- Validate explicit dependencies and preserve sequential execution for existing definitions. Natural-language task decomposition is not included.
|
|
223
|
+
- Retry only read-only failures explicitly marked as retryable, within a finite budget. `retry` accepts `0–5` and defaults to no retries. Write operations never retry automatically.
|
|
224
|
+
- Missing required input or write permission pauses execution for intervention. Cancellation stops subsequent advancement; an active tool must finish before cancellation completes.
|
|
225
|
+
- When `timeoutMs` expires, send an abort signal but still wait for the tool to settle. Tools that do not support the signal cannot guarantee a hard timeout; the system does not falsely report termination.
|
|
226
|
+
- Enable `workflow-completed`, `workflow-failed`, and `workflow-waiting` in Webhook settings for completion, failure, or intervention alerts. Notification failures are recorded separately and do not change execution outcomes. Results remain queryable without notifications.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
139
230
|
## Architecture
|
|
140
231
|
|
|
141
232
|
```mermaid
|
package/README.vi.md
CHANGED
|
@@ -41,14 +41,33 @@ Giải pháp tuần trước được thảo luận trong Codex hay Claude Code?
|
|
|
41
41
|
|
|
42
42
|
Codex Mate quản lý công cụ và dữ liệu cục bộ đã có. Đây không phải mô hình AI mới và không thay thế trợ lý lập trình của bạn. Hãy bắt đầu bằng việc tìm lại một cuộc trò chuyện hữu ích, không cần cấu hình mọi công cụ trước.
|
|
43
43
|
|
|
44
|
-
[Bắt đầu sử dụng](#bắt-đầu-nhanh) · [Hướng dẫn phiên (tiếng Trung)](https://sakurabytecore.github.io/codexmate/guide/sessions)
|
|
44
|
+
[Bắt đầu sử dụng](#bắt-đầu-nhanh) · [Hướng dẫn phiên (tiếng Trung)](https://sakurabytecore.github.io/codexmate/guide/sessions) · [Bàn giao luồng](#bàn-giao-luồng)
|
|
45
|
+
|
|
46
|
+
## So sánh với các công cụ cùng nhóm
|
|
47
|
+
|
|
48
|
+
Chọn theo nhu cầu chính, không xem bảng này là danh sách tính năng loại trừ lẫn nhau. Các dự án có tính năng giao nhau và có thể dùng kết hợp.
|
|
49
|
+
|
|
50
|
+
| Công cụ | Trọng tâm chính | Nhu cầu phù hợp |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| **Codex Mate** | Quản lý phiên và cấu hình xuyên công cụ, ưu tiên cục bộ, qua CLI + Web và ứng dụng máy tính | Tìm, lọc và xuất hội thoại từ nhiều công cụ tại một nơi, cùng quản lý Provider, Skills và quy trình tác vụ |
|
|
53
|
+
| [CC Switch](https://github.com/farion1231/cc-switch) | Trình quản lý cấu hình trên máy tính cho nhiều công cụ lập trình AI, gồm provider, MCP, Skills và lời nhắc | Chuyển đổi API provider và giảm việc sửa thủ công tệp cấu hình của từng công cụ |
|
|
54
|
+
| [CloudCLI (Claude Code UI)](https://github.com/siteboon/claudecodeui) | Giao diện Web trên máy tính và thiết bị di động cho Claude Code, Cursor CLI và Codex | Dùng trợ lý lập trình từ trình duyệt hoặc điện thoại, truy cập dự án và phiên cục bộ hoặc từ xa |
|
|
55
|
+
| [ccusage](https://github.com/ryoppippi/ccusage) | CLI phân tích lượng token sử dụng và chi phí từ dữ liệu cục bộ của tác nhân lập trình | Xem báo cáo lượng sử dụng và chi phí theo ngày, tuần, tháng hoặc phiên |
|
|
56
|
+
|
|
57
|
+
**Vì sao chọn Codex Mate?** Tập hợp tra cứu hội thoại xuyên công cụ, lưu trữ Markdown, quản lý cấu hình, Skills và tác vụ hằng ngày tại một nơi mà không thay thế trợ lý lập trình đang dùng.
|
|
58
|
+
|
|
59
|
+
So sánh dựa trên mô tả chính thức tại các liên kết trên; không hàm ý công cụ khác thiếu tính năng chưa liệt kê và không phải bảng xếp hạng hiệu năng hay giá. Thao tác phiên của Codex Mate tùy thuộc nguồn; xem [hướng dẫn phiên (tiếng Trung)](https://sakurabytecore.github.io/codexmate/guide/sessions). Xuất và bàn giao không di chuyển nguyên vẹn toàn bộ trạng thái phiên; chạy cục bộ cũng không có nghĩa là mô hình chạy ngoại tuyến.
|
|
45
60
|
|
|
46
61
|
## Bắt đầu nhanh
|
|
47
62
|
|
|
48
|
-
|
|
63
|
+
Để dùng CLI + Web, cài đặt qua Homebrew, npm hoặc curl bên dưới, rồi chạy `codexmate run`. Mở địa chỉ được in trong terminal, chọn nguồn có dữ liệu trong trình duyệt phiên, mở cuộc trò chuyện và dùng chức năng xuất. Nếu chưa có dữ liệu cục bộ, hãy tạo cuộc trò chuyện trong công cụ gốc trước.
|
|
49
64
|
|
|
50
65
|
Bản xuất dùng để đọc và lưu trữ, không phải khôi phục toàn bộ trạng thái agent trong công cụ khác. Dùng `codexmate setup` khi cần cấu hình provider. Xem [hướng dẫn bắt đầu nhanh (tiếng Trung)](https://sakurabytecore.github.io/codexmate/guide/quick-start) để biết chi tiết.
|
|
51
66
|
|
|
67
|
+
### Cài đặt ứng dụng máy tính
|
|
68
|
+
|
|
69
|
+
Mở [bản phát hành mới nhất](https://github.com/SakuraByteCore/codexmate/releases/latest). Các gói Windows `.exe`, macOS `.dmg` và Linux `.AppImage` chỉ xuất hiện trong mục **Assets** sau khi quá trình dựng ứng dụng máy tính hoàn tất. Tải gói dành cho nền tảng của bạn, cài đặt rồi mở trực tiếp ứng dụng máy tính; không cần chạy `codexmate run`.
|
|
70
|
+
|
|
52
71
|
### Cài đặt qua Homebrew (macOS / Linux)
|
|
53
72
|
|
|
54
73
|
```bash
|
|
@@ -97,14 +116,46 @@ curl -fsSL https://raw.githubusercontent.com/SakuraByteCore/codexmate/main/scrip
|
|
|
97
116
|
|
|
98
117
|
---
|
|
99
118
|
|
|
119
|
+
## Bàn giao luồng
|
|
120
|
+
|
|
121
|
+
Chuyển thẻ bàn giao có cấu trúc cho tác nhân đích qua MCP bộ nhớ dùng chung. Thao tác này không khôi phục toàn bộ trạng thái phiên. Lưu `card.json` với `goal` là chuỗi, còn `completed`, `blockers`, `nextSteps` và `files` là các mảng chuỗi:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"goal": "Hoàn tất cập nhật tài liệu",
|
|
126
|
+
"completed": ["Đã xem hướng dẫn phiên"],
|
|
127
|
+
"blockers": [],
|
|
128
|
+
"nextSteps": ["Kiểm tra ví dụ trong các bản dịch"],
|
|
129
|
+
"files": ["README.md"]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Chạy từ thư mục mã nguồn; sau khi cài đặt, thay `node cli.js` bằng `codexmate`:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
node cli.js thread handoff <thread-id> --card <json-file> --target <agent>
|
|
137
|
+
node cli.js thread list <thread-id>
|
|
138
|
+
node cli.js thread fallback <thread-id> --handoff <id>
|
|
139
|
+
node cli.js thread ack <thread-id> --handoff <id> --agent <target> --evidence <session-or-retrieval-id>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Dùng mã bàn giao được trả về cho `<id>`, cùng tác nhân đích cho `<target>`, và mã phiên hoặc truy xuất thực tế làm bằng chứng. Chỉ chạy `ack` sau khi tác nhân đích tự báo đã đọc thẻ.
|
|
143
|
+
|
|
144
|
+
- **Lưu tệp trước, định tuyến MCP có giới hạn**: Trước tiên lưu tệp bàn giao tại `~/.codexmate/threads/<hash>/`. Dò tìm MCP bộ nhớ dùng chung bằng cách chỉ đọc `.mcp.json` của dự án, cấu hình người dùng Claude và `config.toml` của Codex, không sửa cấu hình. Chọn một MCP có công cụ ghi gốc tương thích, dùng kết nối ngắn hạn, không chạy tiến trình nền thường trực. Không bảo đảm tương thích với mọi phiên bản MCP. Không thêm phụ thuộc hay cơ chế ép chèn lời nhắc.
|
|
145
|
+
- **Dự phòng tệp tường minh**: Khi ghi MCP thất bại, hệ thống không tự thử lại và hiển thị đường dẫn tệp. `thread fallback` trả về nội dung văn bản của tệp. Nút sao chép thẻ trong khu vực bàn giao phiên của giao diện cũng là lựa chọn dự phòng tệp tường minh: vẫn phải tự dán thẻ vào tác nhân đích; sao chép không tự gửi.
|
|
146
|
+
- **Ghi thành công không xác nhận đã đọc**: Ghi MCP thành công chỉ đặt trạng thái `awaiting_read`, không chứng minh tác nhân đích đã đọc thẻ. `thread ack` ghi nhận việc tác nhân đích tự báo đã đọc kèm bằng chứng, không phải xác minh độc lập.
|
|
147
|
+
- **Nhật ký kiểm toán**: `thread list <thread-id>` trả về nhật ký gồm MCP/công cụ đã chọn, thời gian thực hiện, kết quả ghi, dự phòng và trạng thái đọc.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
100
151
|
## Điểm nổi bật
|
|
101
152
|
|
|
102
153
|
Sau khi tìm lại cuộc trò chuyện, bạn có thể quản lý cấu hình, skill và tác vụ phục vụ công việc hằng ngày:
|
|
103
|
-
- **Trình duyệt phiên thống nhất**: Xem phiên cục bộ từ Codex, Claude Code, Gemini CLI, CodeBuddy Code, WorkBuddy, Pi, OpenCode và Zed tại một nơi. Khả năng tìm kiếm, xuất và xóa tùy thuộc nguồn; xem [hướng dẫn phiên (tiếng Trung)](https://sakurabytecore.github.io/codexmate/guide/sessions).
|
|
154
|
+
- **Trình duyệt phiên thống nhất**: Xem phiên cục bộ từ Codex, Claude Code, Gemini CLI, CodeBuddy Code, WorkBuddy, Pi, OpenCode và Zed tại một nơi. Khả năng tìm kiếm, xuất và xóa tùy thuộc nguồn; xem [hướng dẫn phiên (tiếng Trung)](https://sakurabytecore.github.io/codexmate/guide/sessions). Chi tiết phiên luôn hiển thị ước tính token theo năm nhóm, thanh tỷ lệ và mức sức khỏe ngữ cảnh.
|
|
104
155
|
- **Bridge tương thích OpenAI**: Dùng Codex với bất kỳ UI nào hỗ trợ OpenAI bằng cách chuẩn hóa Responses API.
|
|
105
156
|
- **Dọn dẹp provider lỗi**: Kiểm tra route provider cục bộ của Codex/Claude, hiển thị cấu hình lỗi trong một modal và xóa hàng loạt các provider hỏng đã chọn mà không chạm vào mục khỏe mạnh hoặc được bảo vệ.
|
|
106
157
|
- **Chợ skill cục bộ**: Chia sẻ và nhập skill giữa các app agent khác nhau.
|
|
107
|
-
- **Điều phối tác vụ**:
|
|
158
|
+
- **Điều phối tác vụ**: Tự động thực thi quy trình hiện có, lưu bền vững tiến độ và kết quả, chỉ yêu cầu can thiệp khi bị chặn.
|
|
108
159
|
|
|
109
160
|
---
|
|
110
161
|
|
|
@@ -118,16 +169,56 @@ Sau khi tìm lại cuộc trò chuyện, bạn có thể quản lý cấu hình,
|
|
|
118
169
|
| **Trình duyệt phiên** | ✅ | Xem và lọc phiên cục bộ; khả năng tìm kiếm và xuất Markdown tùy thuộc nguồn. Xem hướng dẫn phiên |
|
|
119
170
|
| **Phân tích sử dụng** | ✅ | Trực quan hóa xu hướng tin nhắn và dự án nổi bật |
|
|
120
171
|
| **Chợ skill cục bộ** | ✅ | Import/export skill giữa các app agent |
|
|
121
|
-
| **Hàng đợi tác vụ** | ✅ |
|
|
172
|
+
| **Hàng đợi tác vụ** | ✅ | Quy trình tự động có phụ thuộc, lưu tiến độ, khôi phục an toàn và tổng kết kết quả |
|
|
122
173
|
| **Bridge OpenAI** | ✅ | Chuyển đổi Codex Responses API sang định dạng OpenAI chuẩn |
|
|
123
174
|
| **Kiểm tra sức khỏe Provider** | ✅ | Kiểm tra route provider Codex/Claude, đánh dấu cấu hình lỗi và xóa hàng loạt các provider hỏng đã chọn một cách an toàn |
|
|
124
|
-
| **Mẫu Prompt** | ✅ |
|
|
125
|
-
| **Trình sửa tệp prompt** | ✅ | Chỉnh sửa CLAUDE.md / AGENTS.md
|
|
175
|
+
| **Mẫu Prompt** | ✅ | Hộp thoại điền biến khi gọi, chia sẻ một mẫu bằng JSON, lịch sử Diff và khôi phục cấu hình mẫu plugin. `git_diff` là văn bản được dán, không thực thi lệnh. |
|
|
176
|
+
| **Trình sửa tệp prompt** | ✅ | Chỉnh sửa CLAUDE.md / AGENTS.md toàn cục và theo dự án với kho preset chung. Điền biến trước khi áp dụng preset; cần lưu thủ công để ghi tệp. Lịch sử hiển thị Diff; xác nhận khôi phục sẽ ghi phiên bản đã chọn với bản sao lưu nguyên tử và kiểm tra thay đổi bên ngoài. |
|
|
126
177
|
| **Tích hợp MCP** | ✅ | Expose tool và resource cục bộ qua MCP stdio |
|
|
127
178
|
| **Tự động cập nhật** | ✅ | Cập nhật nhanh qua `codexmate update` |
|
|
128
179
|
|
|
129
180
|
---
|
|
130
181
|
|
|
182
|
+
## Quy trình tự động không cần theo dõi liên tục
|
|
183
|
+
|
|
184
|
+
Tái sử dụng định nghĩa quy trình hiện có để backend tự động thực thi các bước sau khi gửi. Bảng quy trình trên trang tổng quan hỗ trợ gửi tác vụ, xem kết quả, tiếp tục sau khi bổ sung đầu vào và hủy các bước tiếp theo. Đóng trang không làm gián đoạn tác vụ; tác vụ không chạy khi dịch vụ dừng.
|
|
185
|
+
|
|
186
|
+
### Khởi động và sử dụng
|
|
187
|
+
|
|
188
|
+
Khởi động dịch vụ cục bộ trong một terminal và giữ dịch vụ hoạt động:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
codexmate run --no-browser
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Gửi tác vụ từ terminal khác. Dùng trường `id` trong bản ghi trả về làm `<runId>` cho các lệnh tiếp theo:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
codexmate workflow list --json
|
|
198
|
+
codexmate workflow submit diagnose-config --json
|
|
199
|
+
codexmate workflow active-runs --json
|
|
200
|
+
codexmate workflow detail <runId> --json
|
|
201
|
+
codexmate workflow resume <runId> --input @input.json --json
|
|
202
|
+
codexmate workflow cancel <runId> --json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
- `resume` chỉ tiếp tục tác vụ đang chờ can thiệp. Tệp `input.json` chứa toàn bộ đầu vào đã cập nhật; bỏ `--input` để giữ đầu vào ban đầu.
|
|
206
|
+
- Bước ghi cần cấp rõ quyền `--allow-write` và bật quyền ghi cấu hình của công cụ tương ứng. Kiểm tra tác động thực tế trước khi tiếp tục bước ghi có kết quả chưa xác định.
|
|
207
|
+
- CLI mặc định kết nối đến `127.0.0.1:3737`. Khi dùng cổng tùy chỉnh, đặt cùng giá trị `CODEXMATE_PORT` trong hai terminal. Khi dùng token truy cập, dịch vụ và bên gọi cần dùng cùng `CODEXMATE_HTTP_TOKEN`.
|
|
208
|
+
- Lệnh đồng bộ `codexmate workflow run` hiện có vẫn tương thích. `workflow runs` đọc lịch sử thực thi cũ; `workflow active-runs` đọc các bản ghi thực thi được lưu bền vững.
|
|
209
|
+
|
|
210
|
+
### Xử lý tự động và giới hạn an toàn
|
|
211
|
+
|
|
212
|
+
- Lưu bền vững bản chụp định nghĩa, đầu vào, trạng thái nút, toàn bộ đầu ra và số lần thử. Bản tổng kết gồm mục đã hoàn thành, kết quả cuối cùng và lý do các mục chưa hoàn thành.
|
|
213
|
+
- Sau khi khởi động lại dịch vụ, tiếp tục các nút chỉ đọc đã xác nhận an toàn, không chạy lại nút đã thành công. Nút ghi hoặc nút chưa phân loại có kết quả chưa xác định sẽ chờ can thiệp, không tự động chạy lại.
|
|
214
|
+
- Kiểm tra phụ thuộc được khai báo rõ ràng; giữ thứ tự thực thi tuần tự cho định nghĩa cũ. Không bao gồm tự động chia tác vụ từ ngôn ngữ tự nhiên.
|
|
215
|
+
- Chỉ thử lại lỗi chỉ đọc được đánh dấu rõ là có thể thử lại, trong giới hạn hữu hạn. `retry` nhận giá trị `0–5`, mặc định không thử lại. Thao tác ghi không tự động thử lại.
|
|
216
|
+
- Thiếu đầu vào bắt buộc hoặc quyền ghi sẽ tạm dừng để chờ can thiệp. Hủy chỉ ngăn các bước tiếp theo; công cụ đang chạy phải kết thúc trước khi việc hủy hoàn tất.
|
|
217
|
+
- Khi hết `timeoutMs`, gửi tín hiệu hủy nhưng vẫn chờ công cụ kết thúc thực sự. Công cụ không hỗ trợ tín hiệu này không bảo đảm thời hạn cứng; hệ thống không báo sai rằng công cụ đã dừng.
|
|
218
|
+
- Bật `workflow-completed`, `workflow-failed` và `workflow-waiting` trong cài đặt Webhook để nhận thông báo hoàn thành, thất bại hoặc cần can thiệp. Lỗi thông báo được ghi riêng, không thay đổi kết quả thực thi. Vẫn có thể tra cứu kết quả khi chưa cấu hình thông báo.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
131
222
|
## Kiến trúc
|
|
132
223
|
|
|
133
224
|
```mermaid
|
package/README.zh.md
CHANGED
|
@@ -12,6 +12,7 @@ Codex Mate 是本地运行的 CLI + Web 管理工具,在一个界面查看、
|
|
|
12
12
|
<a href="https://sakurabytecore.github.io/codexmate/">[项目文档]</a>
|
|
13
13
|
<a href="#快速开始">[快速开始]</a>
|
|
14
14
|
<a href="README.md">[English]</a>
|
|
15
|
+
<a href="README.vi.md">[Tiếng Việt]</a>
|
|
15
16
|
</p>
|
|
16
17
|
|
|
17
18
|
[](https://www.npmjs.com/package/codexmate)
|
|
@@ -40,14 +41,33 @@ Codex Mate 是本地运行的 CLI + Web 管理工具,在一个界面查看、
|
|
|
40
41
|
|
|
41
42
|
Codex Mate 管理已有工具和本地记录,不是新的 AI 模型,也不替代原来的编程助手。第一次使用不必配置全部工具;先找回一段对话即可。
|
|
42
43
|
|
|
43
|
-
[开始使用](#快速开始) · [查看会话使用方法](https://sakurabytecore.github.io/codexmate/guide/sessions)
|
|
44
|
+
[开始使用](#快速开始) · [查看会话使用方法](https://sakurabytecore.github.io/codexmate/guide/sessions) · [线程交接](#线程交接)
|
|
45
|
+
|
|
46
|
+
## 与同类工具对比
|
|
47
|
+
|
|
48
|
+
按主要用途选择工具,而非将下表视为互斥功能清单。各项目存在功能重叠,也可以搭配使用。
|
|
49
|
+
|
|
50
|
+
| 工具 | 主要定位 | 适合的需求 |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| **Codex Mate** | 本地优先的跨工具会话与配置管理,提供 CLI + Web 和桌面入口 | 在一个界面找回、筛选和导出不同工具的历史对话,集中管理 Provider、Skills 与任务工作流 |
|
|
53
|
+
| [CC Switch](https://github.com/farion1231/cc-switch) | 多种 AI 编程工具的桌面配置管理器,集中管理 Provider、MCP、Skills 与提示词 | 主要需要切换 API Provider,减少手工编辑各工具的配置文件 |
|
|
54
|
+
| [CloudCLI(Claude Code UI)](https://github.com/siteboon/claudecodeui) | 面向 Claude Code、Cursor CLI 和 Codex 的桌面与移动端 Web 界面 | 主要需要在浏览器或手机上使用编程助手,访问本地或远程项目与会话 |
|
|
55
|
+
| [ccusage](https://github.com/ryoppippi/ccusage) | 从本地编程智能体记录分析 Token 用量与费用的 CLI | 主要需要按日、周、月或会话查看用量与费用报表 |
|
|
56
|
+
|
|
57
|
+
**选择 Codex Mate 的理由**:将跨工具历史会话查阅、Markdown 归档与日常配置、Skills、任务管理放在同一入口,不必更换原来的编程助手。
|
|
58
|
+
|
|
59
|
+
对比依据为上方链接中的官方项目说明;不代表其他工具缺少未列出的功能,也不是性能或价格排名。Codex Mate 的会话操作能力因来源而异,详见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions);导出与交接不等于无损迁移完整会话状态,本地运行也不等于模型离线运行。
|
|
44
60
|
|
|
45
61
|
## 快速开始
|
|
46
62
|
|
|
47
|
-
|
|
63
|
+
使用 CLI + Web 时,先通过下方 Homebrew、npm 或 curl 安装,再运行 `codexmate run`。按终端显示的地址打开 Web UI,在「会话来源」选已有记录的工具,打开一条会话并点击「导出记录」。没有本地记录时,先在原工具中产生一段对话。
|
|
48
64
|
|
|
49
65
|
导出用于阅读与归档,不等于在另一工具中恢复完整状态。需要配置 Provider 时再使用 `codexmate setup`;详细步骤见[快速开始](https://sakurabytecore.github.io/codexmate/guide/quick-start)。
|
|
50
66
|
|
|
67
|
+
### 桌面版安装
|
|
68
|
+
|
|
69
|
+
打开[最新发布页](https://github.com/SakuraByteCore/codexmate/releases/latest)。桌面构建完成后,**Assets**(发布附件)中才会出现 Windows `.exe`、macOS `.dmg`、Linux `.AppImage` 安装包。下载对应平台的安装包,安装后直接启动桌面应用,无需运行 `codexmate run`。
|
|
70
|
+
|
|
51
71
|
### Homebrew 安装(macOS / Linux)
|
|
52
72
|
|
|
53
73
|
```bash
|
|
@@ -96,10 +116,42 @@ curl -fsSL https://raw.githubusercontent.com/SakuraByteCore/codexmate/main/scrip
|
|
|
96
116
|
|
|
97
117
|
---
|
|
98
118
|
|
|
119
|
+
## 线程交接
|
|
120
|
+
|
|
121
|
+
通过共享记忆 MCP 向目标智能体交接结构化卡片,不等于恢复完整会话状态。先保存 `card.json`:`goal` 为字符串,`completed`、`blockers`、`nextSteps`、`files` 均为字符串数组。
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"goal": "完成文档更新",
|
|
126
|
+
"completed": ["已核查会话指南"],
|
|
127
|
+
"blockers": [],
|
|
128
|
+
"nextSteps": ["核对各语言示例"],
|
|
129
|
+
"files": ["README.md"]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
在源码目录运行下列命令;安装后将 `node cli.js` 替换为 `codexmate`:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
node cli.js thread handoff <thread-id> --card <json-file> --target <agent>
|
|
137
|
+
node cli.js thread list <thread-id>
|
|
138
|
+
node cli.js thread fallback <thread-id> --handoff <id>
|
|
139
|
+
node cli.js thread ack <thread-id> --handoff <id> --agent <target> --evidence <session-or-retrieval-id>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
将交接返回的编号填入 `<id>`,`<target>` 使用同一目标智能体,证据填写真实会话或检索编号。仅在目标自报已读取卡片后执行 `ack`。
|
|
143
|
+
|
|
144
|
+
- **文件优先,限定 MCP 路由**:先将交接文件保存到 `~/.codexmate/threads/<hash>/`。只读探测项目 `.mcp.json`、Claude 用户配置、Codex `config.toml` 中的共享记忆 MCP,不修改配置。按兼容原生写入工具选择单个 MCP,使用短连接,不启动守护进程。不承诺兼容任意 MCP 版本,不新增依赖,不添加强行插入提示词的机制。
|
|
145
|
+
- **显式文件回退**:MCP 写入失败不自动重试,结果明确提示文件路径。`thread fallback` 返回文件文本。界面会话交接区的「复制卡片」按钮同样是显式文件回退;复制后仍须手动粘贴到目标,不自动发送。
|
|
146
|
+
- **写入成功不等于读取**:MCP 写入成功仅进入 `awaiting_read`,不能证明目标已读取。`thread ack` 记录附证据的目标自报读取,不是独立验证的回执。
|
|
147
|
+
- **交接审计**:`thread list <thread-id>` 返回审计,包含所选 MCP/tool、耗时、写入结果、回退和读取状态。
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
99
151
|
## 有什么独特之处?
|
|
100
152
|
|
|
101
153
|
找回对话之后,还可以继续管理日常工作所需的配置、Skills 与任务:
|
|
102
|
-
- **统一会话浏览器**:集中浏览 Codex、Claude Code、Gemini CLI、CodeBuddy Code、WorkBuddy、Pi、OpenCode 与 Zed 的本地会话;检索、导出和删除的来源限制见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)
|
|
154
|
+
- **统一会话浏览器**:集中浏览 Codex、Claude Code、Gemini CLI、CodeBuddy Code、WorkBuddy、Pi、OpenCode 与 Zed 的本地会话;检索、导出和删除的来源限制见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)。会话详情默认显示五类预估 Token、构成条与健康评级,无需展开。
|
|
103
155
|
- **OpenAI 兼容桥接**:通过归一化 Responses API,让 Codex 能够与任何支持 OpenAI 格式的 UI 配合使用;内建 Codex 转换会补齐并规范化 `User-Agent`、`Version`、`OpenAI-Beta`、`Originator` 等 Codex 指纹,对上游伪装为官方 Codex CLI 请求。
|
|
104
156
|
- **Claude Provider 桥接**:通过内建本地 Claude 兼容代理,让 Claude Code 接入 OpenAI Chat Completions 兼容 provider 与 Ollama。
|
|
105
157
|
- **OpenCode Provider 控制**:在 `~/.codexmate` 下维护 CodexMate 自有的 OpenCode 多 provider 存储,只将当前选中的 provider 投影到 OpenCode 原生配置,避免污染或误删用户已有配置。
|
|
@@ -107,7 +159,7 @@ curl -fsSL https://raw.githubusercontent.com/SakuraByteCore/codexmate/main/scrip
|
|
|
107
159
|
- **Provider 健康清理**:探测本地 Codex 与 Claude provider 路由,在同一个弹窗里集中展示失败配置,并批量清理已选坏配置,不影响正常或受保护项。
|
|
108
160
|
- **Skills 市场**:本地优先的市场,支持在不同的智能体应用之间共享和导入 Skills。
|
|
109
161
|
- **提示词文件编辑器**:统一编辑全局和项目级 `CLAUDE.md` 与 `AGENTS.md`(含 OpenCode 的 `~/.config/opencode/AGENTS.md`),支持项目路径自动检测,并提供通用预设池复用 prompt。
|
|
110
|
-
-
|
|
162
|
+
- **任务编排器**:复用工作流定义自动推进任务,持久保存进度与结果,仅在阻塞时请求介入。
|
|
111
163
|
|
|
112
164
|
---
|
|
113
165
|
|
|
@@ -120,19 +172,59 @@ curl -fsSL https://raw.githubusercontent.com/SakuraByteCore/codexmate/main/scrip
|
|
|
120
172
|
| **会话浏览器** | ✅ | 集中浏览与筛选本地会话,按来源提供检索、Markdown 导出等操作;详见会话指南 |
|
|
121
173
|
| **Usage 统计** | ✅ | 可视化消息趋势与热门项目统计 |
|
|
122
174
|
| **本地 Skills 市场** | ✅ | 跨应用的智能体 Skills 导入与导出 |
|
|
123
|
-
| **任务队列** | ✅ |
|
|
175
|
+
| **任务队列** | ✅ | 支持依赖的自动工作流、持久进度、安全恢复与结果汇总 |
|
|
124
176
|
| **OpenAI 桥接** | ✅ | 将 Codex Responses API 转换为标准 OpenAI 格式,并在内建转换中附加/规范化 Codex 指纹 |
|
|
125
177
|
| **Claude Provider 桥接** | ✅ | 通过内建 Claude 兼容代理,让 Claude Code 接入 OpenAI Chat Completions 兼容 provider 与 Ollama |
|
|
126
178
|
| **OpenCode Provider 存储** | ✅ | 在 `~/.codexmate` 中保留多个 OpenCode provider,只将当前选中的 provider 投影到 OpenCode 原生配置 |
|
|
127
179
|
| **Pi Provider 配置** | ✅ | 在 Web UI 中管理 Pi 供应商,写入 `~/.pi/agent/models.json`(未知字段无损保留),并切换 `~/.pi/agent/settings.json` 中的默认供应商/模型 |
|
|
128
180
|
| **Provider 健康检查** | ✅ | 探测本地 Codex/Claude provider 路由,标记失败配置,并安全批量移除已选坏配置 |
|
|
129
|
-
| **提示词模板** | ✅ |
|
|
130
|
-
| **提示词文件编辑器** | ✅ |
|
|
181
|
+
| **提示词模板** | ✅ | 调用时弹窗填写变量,支持单模板 JSON 分享、插件模板配置历史 Diff 与回滚。`git_diff` 需粘贴差异文本,不执行命令。 |
|
|
182
|
+
| **提示词文件编辑器** | ✅ | 编辑全局及项目级 CLAUDE.md / AGENTS.md,支持通用预设池。应用预设先填写变量,只更新编辑器,需手动保存。历史支持版本 Diff;确认回滚后写入所选版本,保留原子备份,校验外部修改。 |
|
|
131
183
|
| **MCP 集成** | ✅ | 通过 MCP stdio 暴露本地工具与资源 |
|
|
132
184
|
| **自动更新** | ✅ | 通过 `codexmate update` 快速更新 CLI |
|
|
133
185
|
|
|
134
186
|
---
|
|
135
187
|
|
|
188
|
+
## 自动工作流:提交后无需持续看守
|
|
189
|
+
|
|
190
|
+
复用现有工作流定义,提交一次后由后端自动推进。首页“自动工作流”提供提交、结果查询、补充输入后继续、取消后续执行。关闭页面不影响任务;服务停止期间不执行任务。
|
|
191
|
+
|
|
192
|
+
### 启动与使用
|
|
193
|
+
|
|
194
|
+
先在一个终端启动本地服务,保持服务运行:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
codexmate run --no-browser
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
在另一个终端提交任务。将返回记录中的 `id` 用作后续命令的 `<runId>`:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
codexmate workflow list --json
|
|
204
|
+
codexmate workflow submit diagnose-config --json
|
|
205
|
+
codexmate workflow active-runs --json
|
|
206
|
+
codexmate workflow detail <runId> --json
|
|
207
|
+
codexmate workflow resume <runId> --input @input.json --json
|
|
208
|
+
codexmate workflow cancel <runId> --json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
- `resume` 仅继续等待介入的任务;`input.json` 提供补充后的完整输入。省略 `--input` 时保留原输入。
|
|
212
|
+
- 写入步骤需要显式传入 `--allow-write`,还须开启对应工具配置的写权限。结果不明的写步骤,须核对实际副作用后再决定是否继续。
|
|
213
|
+
- CLI 默认连接 `127.0.0.1:3737`。自定义端口时,服务与调用终端须配置相同的 `CODEXMATE_PORT`;配置访问令牌时,两端须使用相同的 `CODEXMATE_HTTP_TOKEN`。
|
|
214
|
+
- 原同步命令 `codexmate workflow run` 保持兼容;`workflow runs` 查询原执行历史,`workflow active-runs` 查询持久运行记录。
|
|
215
|
+
|
|
216
|
+
### 自动处理与安全边界
|
|
217
|
+
|
|
218
|
+
- 持久保存定义快照、输入、节点状态、完整输出和尝试次数;结果汇总包含完成项、最终结果与未完成原因。
|
|
219
|
+
- 重启服务后恢复已确认安全的只读节点,不重复执行已成功节点。写节点或未分类节点的执行结果不明时,转为等待介入,不自动重放。
|
|
220
|
+
- 支持显式依赖校验;旧定义保持顺序执行。不包含自然语言自动拆任务。
|
|
221
|
+
- 仅对明确标为可重试的只读失败执行有限重试;`retry` 范围为 `0–5`,默认不重试。写操作不自动重试。
|
|
222
|
+
- 缺少必要输入或写权限时等待介入。取消只停止后续推进;执行中工具结束前显示“正在取消”。
|
|
223
|
+
- `timeoutMs` 到期后传递中止信号,但仍等待工具实际结束。不支持该信号的工具无法保证硬超时,不会虚报已终止。
|
|
224
|
+
- 在 Webhook 设置中启用 `workflow-completed`、`workflow-failed`、`workflow-waiting`,接收完成、失败或介入提醒。通知失败单独记录,不改变任务执行结论;未配置通知时仍可查询结果。
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
136
228
|
## 架构总览
|
|
137
229
|
|
|
138
230
|
```mermaid
|
package/cli/agents-files.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const { writeTextAtomicWithBackup } = require('../lib/cli-config-engine');
|
|
2
|
+
|
|
1
3
|
function createAgentsFileController(deps = {}) {
|
|
2
4
|
const {
|
|
3
5
|
fs,
|
|
@@ -162,11 +164,17 @@ function createAgentsFileController(deps = {}) {
|
|
|
162
164
|
if (content.length > 2 * 1024 * 1024) {
|
|
163
165
|
return { error: 'content too large (max 2MB)' };
|
|
164
166
|
}
|
|
167
|
+
if (typeof params.baseContent === 'string') {
|
|
168
|
+
const current = readClaudeMdFile(params);
|
|
169
|
+
if (current.error) return current;
|
|
170
|
+
if (current.content !== params.baseContent) return { error: '文件已被修改,请重新加载后再回滚' };
|
|
171
|
+
}
|
|
165
172
|
if (typeof backupPromptBeforeWrite === 'function') {
|
|
166
173
|
var bucket = resolved.isProject
|
|
167
174
|
? 'claude-project_' + sanitizeHistoryId(resolved.projectPath)
|
|
168
175
|
: 'claude-global';
|
|
169
|
-
backupPromptBeforeWrite(bucket, filePath);
|
|
176
|
+
const backup = backupPromptBeforeWrite(bucket, filePath);
|
|
177
|
+
if (backup && backup.error) return { error: backup.error };
|
|
170
178
|
resolved.historyBucket = bucket;
|
|
171
179
|
}
|
|
172
180
|
var lineEnding = params.lineEnding === '\r\n' ? '\r\n' : '\n';
|
|
@@ -174,7 +182,7 @@ function createAgentsFileController(deps = {}) {
|
|
|
174
182
|
var finalContent = ensureUtf8Bom(normalized);
|
|
175
183
|
try {
|
|
176
184
|
ensureDir(path.dirname(filePath));
|
|
177
|
-
|
|
185
|
+
writeTextAtomicWithBackup(filePath, finalContent, { fs });
|
|
178
186
|
var result = { success: true, path: filePath };
|
|
179
187
|
if (resolved.historyBucket) result.historyBucket = resolved.historyBucket;
|
|
180
188
|
if (resolved.isProject) {
|
|
@@ -236,12 +244,18 @@ function createAgentsFileController(deps = {}) {
|
|
|
236
244
|
if (content.length > 2 * 1024 * 1024) {
|
|
237
245
|
return { error: '内容过大(最大 2MB)' };
|
|
238
246
|
}
|
|
247
|
+
if (typeof params.baseContent === 'string') {
|
|
248
|
+
const current = readAgentsFile(params);
|
|
249
|
+
if (current.error) return current;
|
|
250
|
+
if (current.content !== params.baseContent) return { error: '文件已被修改,请重新加载后再回滚' };
|
|
251
|
+
}
|
|
239
252
|
let agentsHistoryBucket = '';
|
|
240
253
|
if (typeof backupPromptBeforeWrite === 'function') {
|
|
241
254
|
const explicitBucket = typeof params.historyBucket === 'string' ? params.historyBucket.trim() : '';
|
|
242
255
|
const bucket = explicitBucket
|
|
243
256
|
|| ('codex_' + sanitizeHistoryId(String(params.baseDir || '').trim() || 'global'));
|
|
244
|
-
backupPromptBeforeWrite(bucket, filePath);
|
|
257
|
+
const backup = backupPromptBeforeWrite(bucket, filePath);
|
|
258
|
+
if (backup && backup.error) return { error: backup.error };
|
|
245
259
|
agentsHistoryBucket = bucket;
|
|
246
260
|
}
|
|
247
261
|
const lineEnding = params.lineEnding === '\r\n' ? '\r\n' : '\n';
|
|
@@ -249,7 +263,7 @@ function createAgentsFileController(deps = {}) {
|
|
|
249
263
|
const finalContent = ensureUtf8Bom(normalized);
|
|
250
264
|
|
|
251
265
|
try {
|
|
252
|
-
|
|
266
|
+
writeTextAtomicWithBackup(filePath, finalContent, { fs });
|
|
253
267
|
const agentsResult = { success: true, path: filePath };
|
|
254
268
|
if (agentsHistoryBucket) agentsResult.historyBucket = agentsHistoryBucket;
|
|
255
269
|
return agentsResult;
|
package/cli/config-bootstrap.js
CHANGED
|
@@ -175,11 +175,16 @@ stream_idle_timeout_ms = 300000
|
|
|
175
175
|
} catch (e) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
+
try {
|
|
179
|
+
toml.parse(content);
|
|
180
|
+
} catch (_) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
178
183
|
// Check if [model_providers.local] section already exists
|
|
179
184
|
if (/\[model_providers\.local\]/.test(content)) return;
|
|
180
185
|
|
|
181
186
|
const localSection = `\n[model_providers.local]\nname = "local"\nbase_url = "http://127.0.0.1:3737/bridge/local/v1"\nwire_api = "responses"\nrequires_openai_auth = true\npreferred_auth_method = "codexmate"\nexperimental_bearer_token = "codexmate"\ncodexmate_bridge = "local"\nrequest_max_retries = 4\nstream_max_retries = 10\nstream_idle_timeout_ms = 300000\n`;
|
|
182
|
-
|
|
187
|
+
writeConfig(content.trimEnd() + localSection);
|
|
183
188
|
}
|
|
184
189
|
|
|
185
190
|
function readConfigOrVirtualDefault() {
|
|
@@ -191,7 +196,8 @@ stream_idle_timeout_ms = 300000
|
|
|
191
196
|
isVirtual: false,
|
|
192
197
|
reason: '',
|
|
193
198
|
detail: '',
|
|
194
|
-
errorType: ''
|
|
199
|
+
errorType: '',
|
|
200
|
+
path: CONFIG_FILE
|
|
195
201
|
};
|
|
196
202
|
} catch (e) {
|
|
197
203
|
const errorType = typeof e.configErrorType === 'string' && e.configErrorType.trim()
|
|
@@ -210,7 +216,8 @@ stream_idle_timeout_ms = 300000
|
|
|
210
216
|
isVirtual: true,
|
|
211
217
|
reason: publicReason,
|
|
212
218
|
detail,
|
|
213
|
-
errorType
|
|
219
|
+
errorType,
|
|
220
|
+
path: CONFIG_FILE
|
|
214
221
|
};
|
|
215
222
|
}
|
|
216
223
|
}
|
|
@@ -220,20 +227,27 @@ stream_idle_timeout_ms = 300000
|
|
|
220
227
|
isVirtual: true,
|
|
221
228
|
reason: '未检测到 config.toml',
|
|
222
229
|
detail: `配置文件不存在: ${CONFIG_FILE}`,
|
|
223
|
-
errorType: 'missing'
|
|
230
|
+
errorType: 'missing',
|
|
231
|
+
path: CONFIG_FILE
|
|
224
232
|
};
|
|
225
233
|
}
|
|
226
234
|
|
|
227
235
|
function printConfigLoadErrorAndMarkExit(result) {
|
|
228
|
-
const
|
|
236
|
+
const errorType = result && result.errorType === 'read' ? 'read' : 'parse';
|
|
237
|
+
const message = errorType === 'read' ? '读取 config.toml 失败' : '配置文件解析失败';
|
|
229
238
|
const detail = result && typeof result.detail === 'string' && result.detail.trim()
|
|
230
239
|
? result.detail.trim()
|
|
231
|
-
:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
240
|
+
: message;
|
|
241
|
+
const payload = {
|
|
242
|
+
error: {
|
|
243
|
+
code: errorType === 'parse' ? 'CONFIG_TOML_PARSE_ERROR' : 'CONFIG_TOML_READ_ERROR',
|
|
244
|
+
type: errorType,
|
|
245
|
+
path: CONFIG_FILE,
|
|
246
|
+
message,
|
|
247
|
+
detail
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
console.error(JSON.stringify(payload));
|
|
237
251
|
process.exitCode = 1;
|
|
238
252
|
}
|
|
239
253
|
|