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.
@@ -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
@@ -0,0 +1,14 @@
1
+ # 更新日志
2
+
3
+ ## 0.0.5
4
+
5
+ - 会话浏览:仅 Codex 支持关键词检索
6
+ - 会话浏览:关键词扫描上限提升,降低漏检
7
+ - 附属功能:7-Zip 缺失时回退内置 JS 压缩/解压
8
+ - 文案:精简检测提示
9
+
10
+ ## 0.0.4
11
+
12
+ - 新增 OpenClaw 配置模式(JSON5 多配置管理 + 一键应用)
13
+ - 新增 OpenClaw Workspace 的 AGENTS.md 管理
14
+ - 增加 JSON5 解析依赖
package/README.md CHANGED
@@ -1,60 +1,68 @@
1
1
  # Codex Mate
2
2
 
3
- > A lightweight AI configuration assistant: CLI + Web to manage Codex providers/models and Claude Code configs
3
+ > A lightweight AI configuration assistant: quickly switch Codex providers/models and Claude Code configs, with a unified session browser
4
4
 
5
5
  [![Build](https://img.shields.io/github/actions/workflow/status/ymkiux/codexmate/release.yml?label=build)](https://github.com/ymkiux/codexmate/actions/workflows/release.yml) [![Version](https://img.shields.io/npm/v/codexmate?label=version&registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/codexmate) [![Status](https://img.shields.io/badge/status-alpha-orange)](https://github.com/ymkiux/codexmate)
6
6
  [![Maintain](https://img.shields.io/github/commit-activity/m/ymkiux/codexmate?label=maintain%2Fmonth)](https://github.com/ymkiux/codexmate/commits) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) [![Node](https://img.shields.io/badge/node-%3E%3D14.0.0-green.svg)](https://nodejs.org)
7
7
 
8
8
  English | [Chinese](README.zh-CN.md)
9
9
 
10
- ## Overview
11
-
12
- If you frequently switch between models, providers, or configuration profiles, Codex Mate turns that into a single command or a single click.
13
-
14
- ## Release Notes (0.0.4)
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`, compatibility mode env vars |
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 | Multithreaded compress/unzip via 7-Zip |
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
- - Use OpenClaw with multiple profiles, want quick switching
49
- - Multi-project or multi-environment setups that need quick config changes
50
- - Want a visual UI without a heavy client
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. Check status:
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
- 3. Start the Web UI:
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
  ![Codex Mate Web UI](res/screenshot.png)
@@ -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.ANTHROPIC_AUTH_TOKEN` / `env.ANTHROPIC_BASE_URL` / `env.ANTHROPIC_MODEL` / `env.CLAUDE_CODE_USE_KEY`
155
- - Compatibility mode: write to system environment variables (useful for legacy workflows or specific Windows cases)
156
-
157
- ### OpenClaw Config Mode
158
-
159
- - Manage multiple OpenClaw JSON5 profiles
160
- - Apply to `~/.openclaw/openclaw.json`
161
- - Manage `AGENTS.md` under the OpenClaw Workspace (default: `~/.openclaw/workspace/AGENTS.md`)
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
- ### Configure Claude Code (Cross-Platform)
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`; compatibility mode writes system env vars
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
- Then open `http://localhost:3737`.
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`). Compatibility mode env vars are Windows-only.
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. If using compatibility mode env vars, a restart is also recommended.
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: Multithreaded Compression/Extraction
306
+ ## Extras: Compression/Extraction
264
307
 
265
- Based on 7-Zip for multithreaded zip/unzip.
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: Requires [7-Zip](https://www.7-zip.org/) installed.
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