@minniexcode/codex-switch 0.1.4 → 0.2.0
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.AI.md +5 -4
- package/README.CN.md +9 -8
- package/README.md +9 -8
- package/dist/app/add-provider.js +10 -16
- package/dist/app/bridge.js +8 -13
- package/dist/app/get-status.js +15 -12
- package/dist/app/run-doctor.js +17 -18
- package/dist/app/switch-provider.js +6 -11
- package/dist/commands/handlers.js +32 -69
- package/dist/domain/providers.js +9 -9
- package/dist/runtime/copilot-adapter.js +126 -1
- package/dist/runtime/copilot-bridge-worker.js +3 -0
- package/dist/runtime/copilot-bridge.js +198 -56
- package/dist/runtime/copilot-http-bridge-worker.js +228 -0
- package/dist/runtime/copilot-token.js +294 -0
- package/docs/Design/codex-switch-v0.1.5-design.md +17 -0
- package/docs/Design/codex-switch-v0.2.0-design.md +56 -0
- package/docs/PRD/codex-switch-prd-v0.1.5.md +42 -0
- package/docs/Tests/testing.md +2 -2
- package/docs/cli-usage.md +11 -7
- package/docs/codex-switch-product-overview.md +24 -23
- package/docs/codex-switch-technical-architecture.md +2 -2
- package/package.json +2 -2
package/docs/cli-usage.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# codex-switch CLI Usage
|
|
2
2
|
|
|
3
|
-
This document describes the current `0.1.
|
|
3
|
+
This document describes the current `0.1.5` repository development-line CLI contract for `@minniexcode/codex-switch`, including the Copilot Bridge process-visibility boundary.
|
|
4
4
|
|
|
5
5
|
Executable command name:
|
|
6
6
|
|
|
@@ -10,9 +10,9 @@ codexs
|
|
|
10
10
|
|
|
11
11
|
## 1. Version Context
|
|
12
12
|
|
|
13
|
-
The current package version in this repository is `0.1.
|
|
13
|
+
The current package version in this repository is `0.1.5`.
|
|
14
14
|
|
|
15
|
-
This release line targets Codex `0.134.0+`. The public contract assumes runtime routing is selected by top-level `model` plus `model_provider`, while legacy `profile` and `[profiles.*]` remain inspect-and-adopt inputs instead of the recommended runtime path. The current `0.1.
|
|
15
|
+
This release line targets Codex `0.134.0+`. The public contract assumes runtime routing is selected by top-level `model` plus `model_provider`, while legacy `profile` and `[profiles.*]` remain inspect-and-adopt inputs instead of the recommended runtime path. The current `0.1.5` development line adds Copilot Bridge process visibility, defensive SDK-event normalization, and unknown-event redaction hardening without expanding the provider command surface.
|
|
16
16
|
|
|
17
17
|
## 2. Primary Workflows
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ This release line targets Codex `0.134.0+`. The public contract assumes runtime
|
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
codexs init
|
|
23
|
-
codexs add <provider> --model <model> --api-key <key> [--base-url <url>]
|
|
23
|
+
codexs add <provider> --profile <model-provider-id> --model <model> --api-key <key> [--base-url <url>]
|
|
24
24
|
codexs switch <provider>
|
|
25
25
|
codexs status
|
|
26
26
|
codexs doctor
|
|
@@ -30,6 +30,7 @@ Intent:
|
|
|
30
30
|
|
|
31
31
|
- `init` prepares the `codex-switch` tool home.
|
|
32
32
|
- `add` creates a managed provider record with a target model and provider route identity.
|
|
33
|
+
- Non-interactive runs should pass `--profile` explicitly; TTY mode can prompt for missing required fields.
|
|
33
34
|
- `switch` projects the selected provider into the target Codex runtime.
|
|
34
35
|
- `status` summarizes tool-home, runtime, provider, and health state.
|
|
35
36
|
- `doctor` gives deeper repair-oriented diagnostics.
|
|
@@ -39,7 +40,7 @@ Intent:
|
|
|
39
40
|
```bash
|
|
40
41
|
codexs init
|
|
41
42
|
codexs login copilot
|
|
42
|
-
codexs add <provider> --copilot --model <model>
|
|
43
|
+
codexs add <provider> --copilot --profile <model-provider-id> --model <model>
|
|
43
44
|
codexs switch <provider>
|
|
44
45
|
codexs status
|
|
45
46
|
codexs doctor
|
|
@@ -51,6 +52,7 @@ Important notes:
|
|
|
51
52
|
- The current implementation prefers the bundled Copilot CLI from the managed runtime and falls back to `PATH` when needed.
|
|
52
53
|
- `login copilot` succeeds only after auth readiness is rechecked.
|
|
53
54
|
- `add --copilot` does not install or log in to Copilot for you.
|
|
55
|
+
- Non-interactive Copilot adds should also pass `--profile` explicitly; TTY mode can still collect missing required fields.
|
|
54
56
|
- Copilot runtime paths require Node.js `>=20`; direct providers remain supported on Node.js `>=18`.
|
|
55
57
|
- The Copilot bridge is experimental and targets simple text-oriented turns through the local OpenAI-compatible bridge.
|
|
56
58
|
|
|
@@ -82,6 +84,7 @@ Copilot bridge projection also writes:
|
|
|
82
84
|
Compatibility notes:
|
|
83
85
|
|
|
84
86
|
- `--profile` is accepted as an alias for the managed `model_provider` id.
|
|
87
|
+
- automation should still pass `--profile` explicitly instead of relying on prompts
|
|
85
88
|
- legacy top-level `profile` and `[profiles.*]` may still appear in existing runtime state
|
|
86
89
|
- `migrate`, `config show`, `config list-profiles`, and `doctor` can still inspect those legacy structures
|
|
87
90
|
- new managed runtime projection should be described as route-first, not profile-first
|
|
@@ -262,6 +265,7 @@ codexs rollback [backup-id]
|
|
|
262
265
|
|
|
263
266
|
- Create or update managed provider records rather than editing runtime files directly.
|
|
264
267
|
- Treat `--profile` only as an alias for the managed `model_provider` id.
|
|
268
|
+
- Require explicit `--profile` in non-interactive usage; allow TTY prompts to fill it when omitted.
|
|
265
269
|
- Clean old `env_key` and `env_key_instructions` fields from managed projection during subsequent switching.
|
|
266
270
|
|
|
267
271
|
### `migrate`
|
|
@@ -288,7 +292,7 @@ codexs rollback [backup-id]
|
|
|
288
292
|
- [PRD 0.1.1](./PRD/codex-switch-prd-v0.1.1.md)
|
|
289
293
|
- [PRD 0.1.2](./PRD/codex-switch-prd-v0.1.2.md)
|
|
290
294
|
- [PRD 0.1.3](./PRD/codex-switch-prd-v0.1.3.md)
|
|
291
|
-
- [PRD 0.1.
|
|
295
|
+
- [PRD 0.1.5](./PRD/codex-switch-prd-v0.1.5.md)
|
|
292
296
|
- [Design 0.1.2](./Design/codex-switch-v0.1.2-design.md)
|
|
293
297
|
- [Design 0.1.3](./Design/codex-switch-v0.1.3-design.md)
|
|
294
|
-
- [Design 0.1.
|
|
298
|
+
- [Design 0.1.5](./Design/codex-switch-v0.1.5-design.md)
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
这份文档介绍当前活跃产品事实源下的 `codex-switch` 产品定位。
|
|
6
6
|
|
|
7
|
-
当前仓库开发线 fact source 以这些文档为准:
|
|
8
|
-
|
|
9
|
-
- [`cli-usage.md`](./cli-usage.md)
|
|
10
|
-
- [`PRD/codex-switch-prd-v0.1.0.md`](./PRD/codex-switch-prd-v0.1.0.md)
|
|
11
|
-
- [`PRD/codex-switch-prd-v0.1.1.md`](./PRD/codex-switch-prd-v0.1.1.md)
|
|
12
|
-
- [`PRD/codex-switch-prd-v0.1.2.md`](./PRD/codex-switch-prd-v0.1.2.md)
|
|
13
|
-
- [`PRD/codex-switch-prd-v0.1.3.md`](./PRD/codex-switch-prd-v0.1.3.md)
|
|
14
|
-
- [`PRD/codex-switch-prd-v0.1.
|
|
15
|
-
- [`Design/codex-switch-v0.1.2-design.md`](./Design/codex-switch-v0.1.2-design.md)
|
|
16
|
-
- [`Design/codex-switch-v0.1.3-design.md`](./Design/codex-switch-v0.1.3-design.md)
|
|
17
|
-
- [`Design/codex-switch-v0.1.
|
|
7
|
+
当前仓库开发线 fact source 以这些文档为准:
|
|
8
|
+
|
|
9
|
+
- [`cli-usage.md`](./cli-usage.md)
|
|
10
|
+
- [`PRD/codex-switch-prd-v0.1.0.md`](./PRD/codex-switch-prd-v0.1.0.md)
|
|
11
|
+
- [`PRD/codex-switch-prd-v0.1.1.md`](./PRD/codex-switch-prd-v0.1.1.md)
|
|
12
|
+
- [`PRD/codex-switch-prd-v0.1.2.md`](./PRD/codex-switch-prd-v0.1.2.md)
|
|
13
|
+
- [`PRD/codex-switch-prd-v0.1.3.md`](./PRD/codex-switch-prd-v0.1.3.md)
|
|
14
|
+
- [`PRD/codex-switch-prd-v0.1.5.md`](./PRD/codex-switch-prd-v0.1.5.md)
|
|
15
|
+
- [`Design/codex-switch-v0.1.2-design.md`](./Design/codex-switch-v0.1.2-design.md)
|
|
16
|
+
- [`Design/codex-switch-v0.1.3-design.md`](./Design/codex-switch-v0.1.3-design.md)
|
|
17
|
+
- [`Design/codex-switch-v0.1.5-design.md`](./Design/codex-switch-v0.1.5-design.md)
|
|
18
18
|
|
|
19
19
|
## 产品概述
|
|
20
20
|
|
|
21
|
-
`codex-switch` 是一个本地 provider 管理 CLI,用于管理和切换目标 Codex runtime 的 provider/model-provider 路由配置,同时把工具自己的管理态保存在独立 tool home 下。
|
|
21
|
+
`codex-switch` 是一个本地 provider 管理 CLI,用于管理和切换目标 Codex runtime 的 provider/model-provider 路由配置,同时把工具自己的管理态保存在独立 tool home 下。
|
|
22
22
|
|
|
23
23
|
它不是旧 `setup` 小工具,也不是围绕单目录 `~/.codex` 组织全部状态的脚本集合。
|
|
24
24
|
|
|
@@ -54,11 +54,11 @@ target Codex runtime:
|
|
|
54
54
|
|
|
55
55
|
## 核心使用流程
|
|
56
56
|
|
|
57
|
-
Direct 主路径:
|
|
57
|
+
Direct 主路径:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
codexs init
|
|
61
|
-
codexs add <provider> --model <model> --api-key <key> [--base-url <url>]
|
|
61
|
+
codexs add <provider> --profile <model-provider-id> --model <model> --api-key <key> [--base-url <url>]
|
|
62
62
|
codexs switch <provider>
|
|
63
63
|
codexs status
|
|
64
64
|
codexs doctor
|
|
@@ -69,7 +69,7 @@ Copilot 主路径:
|
|
|
69
69
|
```bash
|
|
70
70
|
codexs init
|
|
71
71
|
codexs login copilot
|
|
72
|
-
codexs add <provider> --copilot --model <model>
|
|
72
|
+
codexs add <provider> --copilot --profile <model-provider-id> --model <model>
|
|
73
73
|
codexs switch <provider>
|
|
74
74
|
codexs status
|
|
75
75
|
codexs doctor
|
|
@@ -84,12 +84,13 @@ codexs migrate
|
|
|
84
84
|
|
|
85
85
|
## 当前产品判断
|
|
86
86
|
|
|
87
|
-
`0.1.1` 的重点不是再加新命令,而是让用户在 README、help 和输出第一屏就能理解:
|
|
87
|
+
`0.1.1` 的重点不是再加新命令,而是让用户在 README、help 和输出第一屏就能理解:
|
|
88
88
|
|
|
89
|
-
- fresh install 应先走什么
|
|
90
|
-
- Copilot 路径和 direct 路径有什么区别
|
|
91
|
-
-
|
|
92
|
-
- `
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
- fresh install 应先走什么
|
|
90
|
+
- Copilot 路径和 direct 路径有什么区别
|
|
91
|
+
- 非交互命令为什么应显式传 `--profile`,以及 TTY 模式下哪些缺失项可以补问
|
|
92
|
+
- `migrate` 何时才该使用
|
|
93
|
+
- `status` / `doctor` 如何帮助定位下一步
|
|
94
|
+
- 当前运行态是用顶层 `model` 与 `model_provider` 选择活动路由
|
|
95
|
+
|
|
96
|
+
`0.1.5` 是当前仓库开发线,重点不是扩展 provider 面,而是让已有 Copilot bridge 实验路径具备过程可见性:SDK 事件被归一化为稳定运行态事件,Responses 流可以显示 commentary/reasoning 信号,未知事件摘要会被脱敏和截断。当前实现边界仍然是:Copilot 路径要求 Node.js `>=20`,受管安装默认固定到 `@github/copilot-sdk@1.0.2`,本地 bridge 仍然只是面向 simple text-oriented turns 的 experimental bridge;Direct provider 路径继续支持 Node.js `>=18`。
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
- [`PRD/codex-switch-prd-v0.1.1.md`](./PRD/codex-switch-prd-v0.1.1.md)
|
|
8
8
|
- [`PRD/codex-switch-prd-v0.1.2.md`](./PRD/codex-switch-prd-v0.1.2.md)
|
|
9
9
|
- [`PRD/codex-switch-prd-v0.1.3.md`](./PRD/codex-switch-prd-v0.1.3.md)
|
|
10
|
-
- [`PRD/codex-switch-prd-v0.1.
|
|
10
|
+
- [`PRD/codex-switch-prd-v0.1.5.md`](./PRD/codex-switch-prd-v0.1.5.md)
|
|
11
11
|
- [`Design/codex-switch-v0.1.0-design.md`](./Design/codex-switch-v0.1.0-design.md)
|
|
12
12
|
- [`Design/codex-switch-v0.1.1-design.md`](./Design/codex-switch-v0.1.1-design.md)
|
|
13
13
|
- [`Design/codex-switch-v0.1.2-design.md`](./Design/codex-switch-v0.1.2-design.md)
|
|
14
14
|
- [`Design/codex-switch-v0.1.3-design.md`](./Design/codex-switch-v0.1.3-design.md)
|
|
15
|
-
- [`Design/codex-switch-v0.1.
|
|
15
|
+
- [`Design/codex-switch-v0.1.5-design.md`](./Design/codex-switch-v0.1.5-design.md)
|
|
16
16
|
|
|
17
17
|
## Layers
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minniexcode/codex-switch",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Local-first CLI for managing and switching Codex provider/model-provider routing.",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Local-first CLI for managing and switching Codex provider/model-provider routing.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"bin": {
|