codexmate 0.0.4 → 0.0.6
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/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- package/.github/workflows/ci.yml +26 -0
- package/CHANGELOG.md +14 -0
- package/CHANGELOG.zh-CN.md +14 -0
- package/README.md +117 -74
- package/README.zh-CN.md +124 -77
- package/cli.js +2697 -675
- package/package.json +12 -5
- package/tests/e2e/recent-health.e2e.js +136 -0
- package/tests/e2e/run.js +357 -0
- package/web-ui.html +3036 -656
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a problem with Codex Mate
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Summary**
|
|
8
|
+
A clear and concise description of the bug.
|
|
9
|
+
|
|
10
|
+
**Steps to reproduce**
|
|
11
|
+
1.
|
|
12
|
+
2.
|
|
13
|
+
3.
|
|
14
|
+
|
|
15
|
+
**Expected behavior**
|
|
16
|
+
What you expected to happen.
|
|
17
|
+
|
|
18
|
+
**Actual behavior**
|
|
19
|
+
What actually happened.
|
|
20
|
+
|
|
21
|
+
**Environment**
|
|
22
|
+
- OS:
|
|
23
|
+
- Node.js version:
|
|
24
|
+
- Codex Mate version:
|
|
25
|
+
|
|
26
|
+
**Logs or screenshots**
|
|
27
|
+
Paste relevant logs or screenshots.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest a new idea for Codex Mate
|
|
4
|
+
labels: enhancement
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Problem**
|
|
8
|
+
What problem are you trying to solve?
|
|
9
|
+
|
|
10
|
+
**Proposed solution**
|
|
11
|
+
Describe the solution you want.
|
|
12
|
+
|
|
13
|
+
**Alternatives**
|
|
14
|
+
Any alternative solutions or features you considered.
|
|
15
|
+
|
|
16
|
+
**Additional context**
|
|
17
|
+
Add any other context or screenshots.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
jobs:
|
|
8
|
+
ci:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
node: [18, 20, 22]
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
- name: Setup Node
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: ${{ matrix.node }}
|
|
20
|
+
cache: npm
|
|
21
|
+
- name: Install
|
|
22
|
+
run: npm ci
|
|
23
|
+
- name: Lint
|
|
24
|
+
run: npm run lint --if-present
|
|
25
|
+
- name: Test
|
|
26
|
+
run: npm run test --if-present
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.0.5
|
|
4
|
+
|
|
5
|
+
- Sessions: enable keyword search for Codex-only view
|
|
6
|
+
- Sessions: increase keyword scan limit to reduce misses
|
|
7
|
+
- Utilities: add JS fallback for zip/unzip when 7-Zip is missing
|
|
8
|
+
- UI: shorten base_url/key/model check hint
|
|
9
|
+
|
|
10
|
+
## 0.0.4
|
|
11
|
+
|
|
12
|
+
- Added OpenClaw config mode with JSON5 profiles and one-click apply
|
|
13
|
+
- Added OpenClaw workspace AGENTS.md management
|
|
14
|
+
- Added JSON5 parsing dependency
|
package/README.md
CHANGED
|
@@ -1,60 +1,68 @@
|
|
|
1
1
|
# Codex Mate
|
|
2
2
|
|
|
3
|
-
> A lightweight AI configuration assistant:
|
|
3
|
+
> A lightweight AI configuration assistant: quickly switch Codex providers/models and Claude Code configs, with a unified session browser
|
|
4
4
|
|
|
5
5
|
[](https://github.com/ymkiux/codexmate/actions/workflows/release.yml) [](https://www.npmjs.com/package/codexmate) [](https://github.com/ymkiux/codexmate)
|
|
6
6
|
[](https://github.com/ymkiux/codexmate/commits) [](LICENSE) [](https://nodejs.org)
|
|
7
7
|
|
|
8
8
|
English | [Chinese](README.zh-CN.md)
|
|
9
9
|
|
|
10
|
-
## Overview
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
- Added OpenClaw config mode with JSON5 profiles and one-click apply
|
|
17
|
-
- Added OpenClaw workspace AGENTS.md management
|
|
18
|
-
- Added JSON5 parsing dependency
|
|
19
|
-
|
|
20
|
-
## What You Get
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Codex Mate makes frequent provider/model switching for Codex and Claude Code a single command or click, and gives you a unified session browser to view/export local sessions from both.
|
|
13
|
+
|
|
14
|
+
## What You Get
|
|
21
15
|
|
|
22
16
|
- Faster provider/model switching
|
|
23
17
|
- More controllable local configuration management
|
|
24
18
|
- A visual Web UI to reduce CLI burden
|
|
25
19
|
- Change tracking with backups
|
|
20
|
+
- A unified session browser for Codex + Claude Code (view/export/copy resume command when available)
|
|
26
21
|
|
|
27
22
|
## Feature Overview
|
|
28
23
|
|
|
29
|
-
| Module | Problem | Key Capabilities |
|
|
30
|
-
| --- | --- | --- |
|
|
31
|
-
| Codex Config | Switching providers/models is painful | Provider/model switching, model management, CLI + Web entry points, template-confirmed writes |
|
|
32
|
-
| Claude Code Config | Multiple profiles and inconsistent write paths | Profile management, default write to `~/.claude/settings.json
|
|
33
|
-
| OpenClaw Config | OpenClaw configs are scattered | JSON5 profiles, apply to `~/.openclaw/openclaw.json`, AGENTS workspace management |
|
|
34
|
-
| Session Browser | Local sessions are hard to track | List/filter sessions, export to Markdown, delete and batch cleanup |
|
|
35
|
-
| Utilities | Compression/extraction requires extra tools |
|
|
24
|
+
| Module | Problem | Key Capabilities |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| Codex Config | Switching providers/models is painful | Provider/model switching, model management, CLI + Web entry points, template-confirmed writes |
|
|
27
|
+
| Claude Code Config | Multiple profiles and inconsistent write paths | Profile management, default write to `~/.claude/settings.json` |
|
|
28
|
+
| OpenClaw Config | OpenClaw configs are scattered | JSON5 profiles, apply to `~/.openclaw/openclaw.json`, AGENTS workspace management |
|
|
29
|
+
| Session Browser | Local sessions are hard to track | List/filter sessions, export to Markdown, copy resume command (when available), delete and batch cleanup |
|
|
30
|
+
| Utilities | Compression/extraction requires extra tools | 7-Zip preferred, JS fallback |
|
|
36
31
|
|
|
37
32
|
## Why Codex Mate
|
|
38
33
|
|
|
39
|
-
- Focused on three jobs: Codex provider/model switching + Claude Code config apply + OpenClaw config apply
|
|
34
|
+
- Focused on three jobs: Codex provider/model switching + Claude Code config apply + OpenClaw config apply
|
|
40
35
|
- Local-first: configs and API keys are written to local files, not the cloud
|
|
41
36
|
- Lightweight: CLI + Web, no desktop app required
|
|
42
37
|
- Reversible: auto-backup before first takeover
|
|
43
38
|
|
|
44
39
|
## Use Cases
|
|
45
40
|
|
|
46
|
-
- Frequent provider/model switching, want a one-command flow
|
|
47
|
-
- Use both Codex and Claude Code, want a single entry point
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
41
|
+
- Frequent provider/model switching, want a one-command flow
|
|
42
|
+
- Use both Codex and Claude Code, want a single entry point
|
|
43
|
+
- Need to browse/export local Codex + Claude Code sessions and copy resume commands when available
|
|
44
|
+
- Use OpenClaw with multiple profiles, want quick switching
|
|
45
|
+
- Multi-project or multi-environment setups that need quick config changes
|
|
46
|
+
- Want a visual UI without a heavy client
|
|
51
47
|
|
|
52
48
|
## Scope and Boundaries
|
|
53
49
|
|
|
54
|
-
- Only configuration management for Codex, Claude Code, and OpenClaw, not a full all-in-one tool suite
|
|
50
|
+
- Only configuration management for Codex, Claude Code, and OpenClaw, not a full all-in-one tool suite
|
|
55
51
|
- No built-in proxy/relay/billing dashboard/cloud sync (kept lightweight)
|
|
56
52
|
- Web UI runs only when you start it (`codexmate start`)
|
|
57
53
|
|
|
54
|
+
## 30-Second Start (No Install)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx codexmate@latest status
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx codexmate@latest start
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then open `http://localhost:3737` in your browser.
|
|
65
|
+
|
|
58
66
|
## Quick Start
|
|
59
67
|
|
|
60
68
|
1. Install (global):
|
|
@@ -67,18 +75,27 @@ Or run once without install:
|
|
|
67
75
|
npx codexmate@latest status
|
|
68
76
|
```
|
|
69
77
|
|
|
70
|
-
2.
|
|
78
|
+
2. Run the interactive setup:
|
|
79
|
+
```bash
|
|
80
|
+
codexmate setup
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. Check status:
|
|
71
84
|
```bash
|
|
72
85
|
codexmate status
|
|
73
86
|
```
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
4. Start the Web UI:
|
|
76
89
|
```bash
|
|
77
90
|
codexmate start
|
|
78
91
|
```
|
|
79
92
|
|
|
80
93
|
Then open `http://localhost:3737` in your browser.
|
|
81
94
|
|
|
95
|
+
## Alternatives
|
|
96
|
+
|
|
97
|
+
- cc-switch: https://github.com/farion1231/cc-switch
|
|
98
|
+
|
|
82
99
|
## UI Preview
|
|
83
100
|
|
|
84
101
|

|
|
@@ -93,10 +110,19 @@ npm install -g codexmate
|
|
|
93
110
|
|
|
94
111
|
Package name on npm: `codexmate`.
|
|
95
112
|
|
|
113
|
+
Want to update to the latest effects features each time? Install from GitHub (re-run to update):
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install -g ymkiux/codexmate
|
|
117
|
+
```
|
|
118
|
+
|
|
96
119
|
### Run with npx (No Install)
|
|
97
120
|
|
|
98
121
|
```bash
|
|
99
122
|
npx codexmate@latest status
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```bash
|
|
100
126
|
npx codexmate@latest start
|
|
101
127
|
```
|
|
102
128
|
|
|
@@ -119,6 +145,7 @@ npm link
|
|
|
119
145
|
| Command | Description |
|
|
120
146
|
| --- | --- |
|
|
121
147
|
| `codexmate` | Show help and available commands |
|
|
148
|
+
| `codexmate setup` | Interactive configuration wizard |
|
|
122
149
|
| `codexmate status` | Show current status |
|
|
123
150
|
| `codexmate list` | List all providers |
|
|
124
151
|
| `codexmate switch <provider>` | Switch provider |
|
|
@@ -126,9 +153,10 @@ npm link
|
|
|
126
153
|
| `codexmate add <name> <URL> [API key]` | Add a provider |
|
|
127
154
|
| `codexmate delete <provider>` | Delete a provider |
|
|
128
155
|
| `codexmate models` | List all models |
|
|
129
|
-
| `codexmate add-model <model>` | Add a model |
|
|
130
|
-
| `codexmate delete-model <model>` | Delete a model |
|
|
131
|
-
| `codexmate start` | Start the Web UI |
|
|
156
|
+
| `codexmate add-model <model>` | Add a model |
|
|
157
|
+
| `codexmate delete-model <model>` | Delete a model |
|
|
158
|
+
| `codexmate start` | Start the Web UI |
|
|
159
|
+
| `codexmate export-session --source <codex|claude> (--session-id <ID>|--file <PATH>) [--output <PATH>] [--max-messages <N|all|Infinity>]` | Export a session to Markdown |
|
|
132
160
|
|
|
133
161
|
## Web UI
|
|
134
162
|
|
|
@@ -147,25 +175,25 @@ codexmate start
|
|
|
147
175
|
- Add/delete custom providers
|
|
148
176
|
- Supports Codex config management on Linux/Windows
|
|
149
177
|
|
|
150
|
-
### Claude Code Config Mode (Windows / macOS / Linux)
|
|
151
|
-
|
|
152
|
-
- Manage multiple Claude Code profiles
|
|
153
|
-
- Configure API key, Base URL, and model
|
|
154
|
-
- Default write to `env` in `~/.claude/settings.json`: `env.ANTHROPIC_API_KEY` / `env.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
### Session Browser
|
|
178
|
+
### Claude Code Config Mode (Windows / macOS / Linux)
|
|
179
|
+
|
|
180
|
+
- Manage multiple Claude Code profiles
|
|
181
|
+
- Configure API key, Base URL, and model
|
|
182
|
+
- Default write to `env` in `~/.claude/settings.json`: `env.ANTHROPIC_API_KEY` / `env.ANTHROPIC_BASE_URL` / `env.ANTHROPIC_MODEL`
|
|
183
|
+
|
|
184
|
+
### OpenClaw Config Mode
|
|
185
|
+
|
|
186
|
+
- Manage multiple OpenClaw JSON5 profiles
|
|
187
|
+
- Apply to `~/.openclaw/openclaw.json`
|
|
188
|
+
- Manage `AGENTS.md` under the OpenClaw Workspace (default: `~/.openclaw/workspace/AGENTS.md`)
|
|
189
|
+
|
|
190
|
+
### Session Browser
|
|
164
191
|
|
|
165
192
|
- View local Codex and Claude Code sessions in one page
|
|
166
193
|
- Filter by source (Codex / Claude / All)
|
|
167
194
|
- Filter by session path (cwd), auto refresh on selection
|
|
168
195
|
- Export selected sessions to Markdown
|
|
196
|
+
- Copy resume command when available
|
|
169
197
|
- Delete single sessions (local jsonl records)
|
|
170
198
|
- Batch delete multiple sessions with partial failure summary
|
|
171
199
|
- Delete individual records or multi-select within session details (writes back to original jsonl)
|
|
@@ -187,15 +215,15 @@ Config directory: `~/.codex/`
|
|
|
187
215
|
- `codexmate-init.json` - First-run marker
|
|
188
216
|
- `config.toml.codexmate-backup-*.bak` - Backup created on first takeover
|
|
189
217
|
|
|
190
|
-
Claude Code config files:
|
|
191
|
-
|
|
192
|
-
- `~/.claude/settings.json` - Runtime config (default write target)
|
|
193
|
-
- `~/.claude/settings.json.codexmate-backup-*.bak` - Backup before first overwrite
|
|
194
|
-
|
|
195
|
-
OpenClaw config files:
|
|
196
|
-
|
|
197
|
-
- `~/.openclaw/openclaw.json` - OpenClaw config (JSON5)
|
|
198
|
-
- `~/.openclaw/workspace/AGENTS.md` - OpenClaw workspace instructions
|
|
218
|
+
Claude Code config files:
|
|
219
|
+
|
|
220
|
+
- `~/.claude/settings.json` - Runtime config (default write target)
|
|
221
|
+
- `~/.claude/settings.json.codexmate-backup-*.bak` - Backup before first overwrite
|
|
222
|
+
|
|
223
|
+
OpenClaw config files:
|
|
224
|
+
|
|
225
|
+
- `~/.openclaw/openclaw.json` - OpenClaw config (JSON5)
|
|
226
|
+
- `~/.openclaw/workspace/AGENTS.md` - OpenClaw workspace instructions
|
|
199
227
|
|
|
200
228
|
## First Run Initialization
|
|
201
229
|
|
|
@@ -215,34 +243,49 @@ codexmate add myapi https://api.example.com/v1 sk-your-api-key
|
|
|
215
243
|
codexmate switch myapi
|
|
216
244
|
```
|
|
217
245
|
|
|
218
|
-
### Switch to a Different Model
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
codexmate use gpt-4-turbo
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
###
|
|
246
|
+
### Switch to a Different Model
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
codexmate use gpt-4-turbo
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Export a Session (CLI)
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
codexmate export-session --source codex --session-id 123456
|
|
256
|
+
codexmate export-session --source claude --file "~/.claude/projects/demo/session.jsonl" --max-messages=all
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
By default, exports are capped at 1000 messages. Use `--max-messages=all` (or `Infinity`) to export everything.
|
|
260
|
+
|
|
261
|
+
### Configure Claude Code (Cross-Platform)
|
|
225
262
|
|
|
226
263
|
1. Start the Web UI: `codexmate start`
|
|
227
264
|
2. Switch to "Claude Code Config" mode in the browser
|
|
228
265
|
3. Add a profile (example Zhipu GLM): Name=ZhipuGLM, API Key=your API key, Base URL=`https://open.bigmodel.cn/api/anthropic`, Model=`glm-4.7`
|
|
229
266
|
4. Click the card to apply, or use "Save & Apply to Claude Config" in the editor
|
|
230
|
-
5. Default write to `~/.claude/settings.json
|
|
267
|
+
5. Default write to `~/.claude/settings.json`
|
|
231
268
|
6. Restart Claude Code to apply
|
|
232
269
|
|
|
233
|
-
### Start the Web UI
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
codexmate start
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
|
|
270
|
+
### Start the Web UI
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
codexmate start
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
By default it binds to `127.0.0.1`. To expose on LAN, use `--host` or `CODEXMATE_HOST`:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
codexmate start --host 0.0.0.0
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Then open `http://localhost:3737` (or your chosen host). Note: binding to `0.0.0.0` is unsafe on untrusted networks.
|
|
240
283
|
|
|
241
284
|
## FAQ
|
|
242
285
|
|
|
243
286
|
### Q: Which operating systems are supported?
|
|
244
287
|
|
|
245
|
-
A: Codex features support Windows and Linux (CLI and Web). Claude Code config applies to Windows / macOS / Linux (writes to `~/.claude/settings.json`).
|
|
288
|
+
A: Codex features support Windows and Linux (CLI and Web). Claude Code config applies to Windows / macOS / Linux (writes to `~/.claude/settings.json`).
|
|
246
289
|
|
|
247
290
|
### Q: Where are API keys stored?
|
|
248
291
|
|
|
@@ -254,15 +297,15 @@ A: The Web UI runs locally; all operations happen on your machine. API keys are
|
|
|
254
297
|
|
|
255
298
|
### Q: How do Claude Code configs take effect?
|
|
256
299
|
|
|
257
|
-
A: After clicking "Apply to Claude Config", it writes to `~/.claude/settings.json`. Restart Claude Code to apply.
|
|
300
|
+
A: After clicking "Apply to Claude Config", it writes to `~/.claude/settings.json`. Restart Claude Code to apply.
|
|
258
301
|
|
|
259
302
|
### Q: How to uninstall?
|
|
260
303
|
|
|
261
304
|
A: Run `npm uninstall -g codexmate`.
|
|
262
305
|
|
|
263
|
-
## Extras:
|
|
306
|
+
## Extras: Compression/Extraction
|
|
264
307
|
|
|
265
|
-
|
|
308
|
+
Prefer 7-Zip for multithreaded zip/unzip. Fallback to the built-in JS library when unavailable.
|
|
266
309
|
|
|
267
310
|
```bash
|
|
268
311
|
# Compress file or folder (default compression level 5)
|
|
@@ -297,7 +340,7 @@ codexmate unzip ./my-project.zip
|
|
|
297
340
|
codexmate unzip ./backup.zip D:/restored
|
|
298
341
|
```
|
|
299
342
|
|
|
300
|
-
Note:
|
|
343
|
+
Note: 7-Zip is optional. If missing, the built-in JS library is used. `--max` only applies to 7-Zip.
|
|
301
344
|
|
|
302
345
|
## Tech Stack
|
|
303
346
|
|