@minniexcode/codex-switch 0.1.0 → 0.1.1
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 +141 -110
- package/README.CN.md +213 -179
- package/README.md +215 -183
- package/dist/app/add-provider.js +15 -23
- package/dist/app/edit-provider.js +30 -65
- package/dist/app/get-current-profile.js +15 -3
- package/dist/app/get-status.js +11 -8
- package/dist/app/list-config-profiles.js +3 -1
- package/dist/app/list-providers.js +10 -4
- package/dist/app/remove-provider.js +52 -19
- package/dist/app/run-doctor.js +26 -29
- package/dist/app/setup-codex.js +3 -3
- package/dist/app/show-config.js +3 -1
- package/dist/app/switch-provider.js +36 -5
- package/dist/cli/output.js +29 -19
- package/dist/commands/handlers.js +2 -2
- package/dist/commands/help.js +3 -3
- package/dist/commands/registry.js +29 -29
- package/dist/domain/config.js +249 -209
- package/dist/domain/providers.js +7 -0
- package/dist/domain/runtime-state.js +15 -15
- package/dist/domain/setup.js +3 -1
- package/dist/interaction/interactive.js +2 -2
- package/dist/runtime/codex-version.js +7 -0
- package/dist/storage/config-repo.js +6 -14
- package/docs/Design/codex-switch-v0.1.1-design.md +33 -0
- package/docs/Reference/codex-config-reference.md +41 -0
- package/docs/Reference/codex-config-reference.zh-CN.md +41 -0
- package/docs/cli-usage.md +282 -223
- package/docs/codex-switch-command-design.md +1 -1
- package/docs/codex-switch-product-overview.md +13 -12
- package/docs/codex-switch-technical-architecture.md +1 -1
- package/package.json +2 -2
package/docs/cli-usage.md
CHANGED
|
@@ -1,223 +1,282 @@
|
|
|
1
|
-
# codex-switch CLI Usage
|
|
2
|
-
|
|
3
|
-
This document describes the current CLI contract for `@minniexcode/codex-switch` at version `0.1.
|
|
4
|
-
|
|
5
|
-
Executable command name:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
codexs
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 1. Version Context
|
|
12
|
-
|
|
13
|
-
The current package version in this repository is `0.1.
|
|
14
|
-
|
|
15
|
-
This
|
|
16
|
-
|
|
17
|
-
## 2. Primary Workflows
|
|
18
|
-
|
|
19
|
-
### 2.1 Direct Providers
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
codexs init
|
|
23
|
-
codexs add <provider> --
|
|
24
|
-
codexs switch <provider>
|
|
25
|
-
codexs status
|
|
26
|
-
codexs doctor
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Intent:
|
|
30
|
-
|
|
31
|
-
- `init` prepares the `codex-switch` tool home.
|
|
32
|
-
- `add` creates a managed provider record.
|
|
33
|
-
- `switch` projects the selected provider into the target Codex runtime.
|
|
34
|
-
- `status` summarizes tool-home, runtime, provider, and health state.
|
|
35
|
-
- `doctor` gives deeper repair-oriented diagnostics.
|
|
36
|
-
|
|
37
|
-
### 2.2 GitHub Copilot
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
codexs init
|
|
41
|
-
codexs login copilot
|
|
42
|
-
codexs add <provider> --copilot --
|
|
43
|
-
codexs switch <provider>
|
|
44
|
-
codexs status
|
|
45
|
-
codexs doctor
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Important notes:
|
|
49
|
-
|
|
50
|
-
- `login copilot` is the upstream onboarding command.
|
|
51
|
-
- The current implementation prefers the bundled Copilot CLI from the managed runtime and falls back to `PATH` when needed.
|
|
52
|
-
- `login copilot` succeeds only after auth readiness is rechecked.
|
|
53
|
-
- `add --copilot` does not install or log in to Copilot for you.
|
|
54
|
-
|
|
55
|
-
## 3.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
## 8.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
-
|
|
214
|
-
- `
|
|
215
|
-
- `
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
|
|
1
|
+
# codex-switch CLI Usage
|
|
2
|
+
|
|
3
|
+
This document describes the current CLI contract for `@minniexcode/codex-switch` at version `0.1.1`.
|
|
4
|
+
|
|
5
|
+
Executable command name:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
codexs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 1. Version Context
|
|
12
|
+
|
|
13
|
+
The current package version in this repository is `0.1.1`.
|
|
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.
|
|
16
|
+
|
|
17
|
+
## 2. Primary Workflows
|
|
18
|
+
|
|
19
|
+
### 2.1 Direct Providers
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
codexs init
|
|
23
|
+
codexs add <provider> --model <model> --api-key <key> [--base-url <url>]
|
|
24
|
+
codexs switch <provider>
|
|
25
|
+
codexs status
|
|
26
|
+
codexs doctor
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Intent:
|
|
30
|
+
|
|
31
|
+
- `init` prepares the `codex-switch` tool home.
|
|
32
|
+
- `add` creates a managed provider record with a target model and provider route identity.
|
|
33
|
+
- `switch` projects the selected provider into the target Codex runtime.
|
|
34
|
+
- `status` summarizes tool-home, runtime, provider, and health state.
|
|
35
|
+
- `doctor` gives deeper repair-oriented diagnostics.
|
|
36
|
+
|
|
37
|
+
### 2.2 GitHub Copilot
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
codexs init
|
|
41
|
+
codexs login copilot
|
|
42
|
+
codexs add <provider> --copilot --model <model>
|
|
43
|
+
codexs switch <provider>
|
|
44
|
+
codexs status
|
|
45
|
+
codexs doctor
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Important notes:
|
|
49
|
+
|
|
50
|
+
- `login copilot` is the upstream onboarding command.
|
|
51
|
+
- The current implementation prefers the bundled Copilot CLI from the managed runtime and falls back to `PATH` when needed.
|
|
52
|
+
- `login copilot` succeeds only after auth readiness is rechecked.
|
|
53
|
+
- `add --copilot` does not install or log in to Copilot for you.
|
|
54
|
+
|
|
55
|
+
## 3. Runtime Route Contract
|
|
56
|
+
|
|
57
|
+
For Codex `0.134.0+`, the active runtime route is selected through top-level `model` and `model_provider` in `config.toml`.
|
|
58
|
+
|
|
59
|
+
`codex-switch` writes that route as its primary runtime projection:
|
|
60
|
+
|
|
61
|
+
- top-level `model`
|
|
62
|
+
- top-level `model_provider`
|
|
63
|
+
- `[model_providers.<id>]`
|
|
64
|
+
- `auth.json` when direct auth projection is required
|
|
65
|
+
|
|
66
|
+
Managed provider projection intentionally avoids these legacy fields:
|
|
67
|
+
|
|
68
|
+
- `model_providers.<id>.env_key`
|
|
69
|
+
- `model_providers.<id>.env_key_instructions`
|
|
70
|
+
|
|
71
|
+
Managed provider projection fixes these fields for OpenAI-compatible direct routes:
|
|
72
|
+
|
|
73
|
+
- `wire_api = "responses"`
|
|
74
|
+
- `requires_openai_auth = true`
|
|
75
|
+
|
|
76
|
+
Compatibility notes:
|
|
77
|
+
|
|
78
|
+
- `--profile` is accepted as an alias for the managed `model_provider` id.
|
|
79
|
+
- legacy top-level `profile` and `[profiles.*]` may still appear in existing runtime state
|
|
80
|
+
- `migrate`, `config show`, `config list-profiles`, and `doctor` can still inspect those legacy structures
|
|
81
|
+
- new managed runtime projection should be described as route-first, not profile-first
|
|
82
|
+
|
|
83
|
+
Example managed direct-provider projection:
|
|
84
|
+
|
|
85
|
+
```toml
|
|
86
|
+
model = "gpt-5.5"
|
|
87
|
+
model_provider = "proxy"
|
|
88
|
+
|
|
89
|
+
[model_providers.proxy]
|
|
90
|
+
name = "proxy"
|
|
91
|
+
base_url = "https://proxy.example.com/v1"
|
|
92
|
+
wire_api = "responses"
|
|
93
|
+
requires_openai_auth = true
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Authentication projection for the direct path remains:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"OPENAI_API_KEY": "sk-xxx"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 4. Advanced Adopt Workflow
|
|
105
|
+
|
|
106
|
+
Use `migrate` only when you already have Codex runtime state that should be adopted into managed `providers.json` state.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
codexs init
|
|
110
|
+
codexs migrate
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`migrate` is an advanced adopt helper. It is not the default first step for fresh installs.
|
|
114
|
+
|
|
115
|
+
Current behavior:
|
|
116
|
+
|
|
117
|
+
- It can inspect legacy runtime `profile` and `[profiles.*]` state from the target Codex runtime.
|
|
118
|
+
- It can collect missing provider details in TTY mode.
|
|
119
|
+
- It can merge into or overwrite existing managed provider state.
|
|
120
|
+
- It still fails fast in non-TTY and `--json` runs when interactive input would be required.
|
|
121
|
+
|
|
122
|
+
## 5. Deprecated Entry
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
codexs setup
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`setup` is deprecated. It is kept only to direct callers toward `init` or `migrate`, and it no longer performs initialization or migration work.
|
|
129
|
+
|
|
130
|
+
## 6. Global Contract
|
|
131
|
+
|
|
132
|
+
### 6.1 Global Flags
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
--json
|
|
136
|
+
--codex-dir <path>
|
|
137
|
+
--help
|
|
138
|
+
--version
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 6.2 Environment Variables
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
CODEXS_HOME
|
|
145
|
+
CODEXS_CODEX_DIR
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 6.3 Runtime Model
|
|
149
|
+
|
|
150
|
+
Tool home:
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
~/.config/codex-switch/
|
|
154
|
+
codex-switch.json
|
|
155
|
+
providers.json
|
|
156
|
+
backups/
|
|
157
|
+
runtime/
|
|
158
|
+
runtimes/
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Target Codex runtime:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
~/.codex/
|
|
165
|
+
config.toml
|
|
166
|
+
auth.json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Meaning:
|
|
170
|
+
|
|
171
|
+
- `providers.json` is the managed provider registry.
|
|
172
|
+
- `codex-switch.json` stores tool-level metadata such as `defaultCodexDir`.
|
|
173
|
+
- `config.toml` remains the active runtime routing file.
|
|
174
|
+
- `auth.json` remains the active auth projection file.
|
|
175
|
+
|
|
176
|
+
## 7. Command Categories
|
|
177
|
+
|
|
178
|
+
Read commands:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
codexs list
|
|
182
|
+
codexs show <provider>
|
|
183
|
+
codexs current
|
|
184
|
+
codexs status
|
|
185
|
+
codexs config show [profile]
|
|
186
|
+
codexs config list-profiles
|
|
187
|
+
codexs bridge status [provider]
|
|
188
|
+
codexs backups list
|
|
189
|
+
codexs doctor
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Change commands:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
codexs init
|
|
196
|
+
codexs login copilot
|
|
197
|
+
codexs migrate
|
|
198
|
+
codexs add <provider>
|
|
199
|
+
codexs edit <provider>
|
|
200
|
+
codexs switch <provider>
|
|
201
|
+
codexs remove <provider>
|
|
202
|
+
codexs import <file>
|
|
203
|
+
codexs export <file>
|
|
204
|
+
codexs bridge start [provider]
|
|
205
|
+
codexs bridge stop [provider]
|
|
206
|
+
codexs rollback [backup-id]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## 8. Selected Command Semantics
|
|
210
|
+
|
|
211
|
+
### `init`
|
|
212
|
+
|
|
213
|
+
- Creates `codex-switch.json` and `providers.json` under the tool home when they do not exist yet.
|
|
214
|
+
- Does not create or validate `config.toml`, `auth.json`, or the target Codex directory.
|
|
215
|
+
- When `--codex-dir` is passed explicitly during first-time initialization, it can persist `defaultCodexDir`.
|
|
216
|
+
|
|
217
|
+
### `login copilot`
|
|
218
|
+
|
|
219
|
+
- Supports `copilot` and `github-copilot` as the current upstream name.
|
|
220
|
+
- Installs the local Copilot SDK under the tool home when needed.
|
|
221
|
+
- Invokes the official Copilot CLI for login when readiness is not already present.
|
|
222
|
+
- Requires a real TTY and does not support `--json`.
|
|
223
|
+
|
|
224
|
+
### `status`
|
|
225
|
+
|
|
226
|
+
- Reports the target Codex runtime and the tool-home root.
|
|
227
|
+
- Reports the active model and active `model_provider` route.
|
|
228
|
+
- Can still surface legacy profile-derived observations when inspecting older runtime state.
|
|
229
|
+
- Adds bridge, Copilot SDK, and upstream auth signals when the active provider uses a local runtime bridge.
|
|
230
|
+
- Does not mutate any files.
|
|
231
|
+
|
|
232
|
+
### `list`
|
|
233
|
+
|
|
234
|
+
- Lists managed providers together with their linked route identity.
|
|
235
|
+
- Distinguishes provider type using the public values `direct` and `copilot`.
|
|
236
|
+
- Marks the current provider only when the active runtime can be mapped back to one unique managed provider.
|
|
237
|
+
- When the active route is shared by multiple providers, it does not invent a single current provider and should instead surface the ambiguity.
|
|
238
|
+
- TTY provider pickers used by commands such as `switch` and `show` follow the same visibility rules for route, provider type, and current-state hints.
|
|
239
|
+
|
|
240
|
+
### `doctor`
|
|
241
|
+
|
|
242
|
+
- Checks expected config files, managed-provider consistency, and Codex CLI availability.
|
|
243
|
+
- Inspects both route-first runtime state and legacy profile state when needed.
|
|
244
|
+
- Adds bridge and Copilot dependency diagnostics for Copilot-backed providers.
|
|
245
|
+
- Returns repair-oriented issues intended for both human users and AI agents.
|
|
246
|
+
|
|
247
|
+
### `switch`
|
|
248
|
+
|
|
249
|
+
- Projects direct providers by rewriting top-level `model`, top-level `model_provider`, the managed `[model_providers.<id>]` block, and `auth.json`.
|
|
250
|
+
- Cleans legacy projected `env_key` and `env_key_instructions` fields before writing the managed provider route.
|
|
251
|
+
- Copilot bridge providers also project the local bridge secret into the runtime while managing bridge routing.
|
|
252
|
+
- Managed writes are backed up and rolled back on failure.
|
|
253
|
+
- When `<provider>` is omitted in a TTY, the interactive provider selector should show route, provider type, and current-state hints using the same rules as `list`.
|
|
254
|
+
|
|
255
|
+
### `add` and `edit`
|
|
256
|
+
|
|
257
|
+
- Create or update managed provider records rather than editing runtime files directly.
|
|
258
|
+
- Treat `--profile` only as an alias for the managed `model_provider` id.
|
|
259
|
+
- Clean old `env_key` and `env_key_instructions` fields from managed projection during subsequent switching.
|
|
260
|
+
|
|
261
|
+
### `migrate`
|
|
262
|
+
|
|
263
|
+
- Adopts unmanaged runtime route or legacy profile state into managed `providers.json` state.
|
|
264
|
+
- Still relies on interactive route/profile selection and provider-detail collection in this release.
|
|
265
|
+
- Should be treated as an advanced adopt tool, not as the normal onboarding path.
|
|
266
|
+
|
|
267
|
+
## 9. Automation Boundaries
|
|
268
|
+
|
|
269
|
+
- Progressive prompts run only in a real TTY and never under `--json`.
|
|
270
|
+
- Human write commands may prompt for missing inputs or dangerous-action confirmation.
|
|
271
|
+
- Automation should pass explicit arguments and prefer `--json`.
|
|
272
|
+
- `login copilot` is TTY-only.
|
|
273
|
+
- `migrate` is not yet a complete non-interactive workflow.
|
|
274
|
+
|
|
275
|
+
## 10. Related Docs
|
|
276
|
+
|
|
277
|
+
- [README](../README.md)
|
|
278
|
+
- [Chinese README](../README.CN.md)
|
|
279
|
+
- [AI README](../README.AI.md)
|
|
280
|
+
- [Product Overview](./codex-switch-product-overview.md)
|
|
281
|
+
- [Release PRD 0.1.1](./PRD/codex-switch-prd-v0.1.1.md)
|
|
282
|
+
- [Release Design 0.1.1](./Design/codex-switch-v0.1.1-design.md)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# codex-switch 命令设计说明
|
|
2
2
|
|
|
3
3
|
> 状态说明:这份文档是历史跨版本参考,不是当前 release contract。
|
|
4
|
-
> 当前事实源请改看 [`docs/cli-usage.md`](./cli-usage.md)、[`docs/PRD/codex-switch-prd-v0.1.
|
|
4
|
+
> 当前事实源请改看 [`docs/cli-usage.md`](./cli-usage.md)、[`docs/PRD/codex-switch-prd-v0.1.1.md`](./PRD/codex-switch-prd-v0.1.1.md)、[`docs/Design/codex-switch-v0.1.1-design.md`](./Design/codex-switch-v0.1.1-design.md)。
|
|
5
5
|
|
|
6
6
|
## 文档信息
|
|
7
7
|
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
这份文档介绍当前活跃产品事实源下的 `codex-switch` 产品定位。
|
|
6
6
|
|
|
7
|
-
当前 release contract 以这些文档为准:
|
|
7
|
+
当前 release contract 以这些文档为准:
|
|
8
8
|
|
|
9
9
|
- [`cli-usage.md`](./cli-usage.md)
|
|
10
|
-
- [`PRD/codex-switch-prd-v0.1.
|
|
11
|
-
- [`Design/codex-switch-v0.1.
|
|
10
|
+
- [`PRD/codex-switch-prd-v0.1.1.md`](./PRD/codex-switch-prd-v0.1.1.md)
|
|
11
|
+
- [`Design/codex-switch-v0.1.1-design.md`](./Design/codex-switch-v0.1.1-design.md)
|
|
12
12
|
|
|
13
13
|
## 产品概述
|
|
14
14
|
|
|
15
|
-
`codex-switch` 是一个本地 provider 管理 CLI,用于管理和切换目标 Codex runtime 的 provider/
|
|
15
|
+
`codex-switch` 是一个本地 provider 管理 CLI,用于管理和切换目标 Codex runtime 的 provider/model-provider 路由配置,同时把工具自己的管理态保存在独立 tool home 下。
|
|
16
16
|
|
|
17
17
|
它不是旧 `setup` 小工具,也不是围绕单目录 `~/.codex` 组织全部状态的脚本集合。
|
|
18
18
|
|
|
@@ -48,11 +48,11 @@ target Codex runtime:
|
|
|
48
48
|
|
|
49
49
|
## 核心使用流程
|
|
50
50
|
|
|
51
|
-
Direct 主路径:
|
|
51
|
+
Direct 主路径:
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
codexs init
|
|
55
|
-
codexs add <provider> --
|
|
55
|
+
codexs add <provider> --model <model> --api-key <key> [--base-url <url>]
|
|
56
56
|
codexs switch <provider>
|
|
57
57
|
codexs status
|
|
58
58
|
codexs doctor
|
|
@@ -63,7 +63,7 @@ Copilot 主路径:
|
|
|
63
63
|
```bash
|
|
64
64
|
codexs init
|
|
65
65
|
codexs login copilot
|
|
66
|
-
codexs add <provider> --copilot --
|
|
66
|
+
codexs add <provider> --copilot --model <model>
|
|
67
67
|
codexs switch <provider>
|
|
68
68
|
codexs status
|
|
69
69
|
codexs doctor
|
|
@@ -78,9 +78,10 @@ codexs migrate
|
|
|
78
78
|
|
|
79
79
|
## 当前产品判断
|
|
80
80
|
|
|
81
|
-
`0.1.
|
|
81
|
+
`0.1.1` 的重点不是再加新命令,而是让用户在 README、help 和输出第一屏就能理解:
|
|
82
82
|
|
|
83
|
-
- fresh install 应先走什么
|
|
84
|
-
- Copilot 路径和 direct 路径有什么区别
|
|
85
|
-
- `migrate` 何时才该使用
|
|
86
|
-
- `status` / `doctor` 如何帮助定位下一步
|
|
83
|
+
- fresh install 应先走什么
|
|
84
|
+
- Copilot 路径和 direct 路径有什么区别
|
|
85
|
+
- `migrate` 何时才该使用
|
|
86
|
+
- `status` / `doctor` 如何帮助定位下一步
|
|
87
|
+
- 当前运行态是用顶层 `model` 与 `model_provider` 选择活动路由
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# codex-switch 技术架构设计
|
|
2
2
|
|
|
3
3
|
> 状态说明:这份文档是历史跨版本参考,不是当前 release contract。
|
|
4
|
-
> 当前事实源请改看 [`docs/cli-usage.md`](./cli-usage.md)、[`docs/PRD/codex-switch-prd-v0.1.
|
|
4
|
+
> 当前事实源请改看 [`docs/cli-usage.md`](./cli-usage.md)、[`docs/PRD/codex-switch-prd-v0.1.1.md`](./PRD/codex-switch-prd-v0.1.1.md)、[`docs/Design/codex-switch-v0.1.1-design.md`](./Design/codex-switch-v0.1.1-design.md)。
|
|
5
5
|
|
|
6
6
|
## 文档信息
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minniexcode/codex-switch",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Local-first CLI for managing and switching Codex provider/
|
|
3
|
+
"version": "0.1.1",
|
|
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": {
|