@minniexcode/codex-switch 0.0.11 → 0.1.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/docs/cli-usage.md CHANGED
@@ -1,524 +1,223 @@
1
- # codex-switch CLI Usage
2
-
3
- 本文档详细介绍 `codex-switch` `0.0.11` 版本中的命令、参数、交互规则和典型使用方式。
4
-
5
- 可执行命令名:
6
-
7
- ```bash
8
- codexs
9
- ```
10
-
11
- ## 1. 概览
12
-
13
- `0.0.11` 开始,`codex-switch` 使用双路径模型:
14
-
15
- - tool home:保存 `codex-switch` 自己的管理态
16
- - target Codex runtime:保存目标 Codex 的 `config.toml` 和 `auth.json`
17
-
18
- 核心设计:
19
-
20
- 1. 本地优先,不依赖远端服务保存管理态
21
- 2. 写入前先备份,异常时支持回滚
22
- 3. 同时兼容人类终端使用和脚本/Agent 自动化调用
23
- 4. GitHub Copilot 这类交互式上游登录提供独立命令入口
24
-
25
- tool home 默认路径:
26
-
27
- ```text
28
- ~/.config/codex-switch/
29
- codex-switch.json
30
- providers.json
31
- backups/
32
- runtime/
33
- runtimes/
34
- ```
35
-
36
- target Codex runtime 默认路径:
37
-
38
- ```text
39
- ~/.codex/
40
- config.toml
41
- auth.json
42
- ```
43
-
44
- ## 2. 安装与入口
45
-
46
- 全局安装:
47
-
48
- ```bash
49
- npm install -g @minniexcode/codex-switch
50
- ```
51
-
52
- 临时执行:
53
-
54
- ```bash
55
- npx @minniexcode/codex-switch --help
56
- ```
57
-
58
- 查看总帮助:
59
-
60
- ```bash
61
- codexs --help
62
- ```
63
-
64
- 查看版本:
65
-
66
- ```bash
67
- codexs --version
68
- ```
69
-
70
- ## 3. 全局规则
71
-
72
- ### 3.1 全局参数
73
-
74
- 所有命令都支持以下全局参数:
75
-
76
- ```bash
77
- --json
78
- --codex-dir <path>
79
- --help
80
- --version
81
- ```
82
-
83
- 说明:
84
-
85
- - `--json`:输出标准 JSON 结果,并禁用所有交互 prompt
86
- - `--codex-dir <path>`:指定目标 Codex runtime 目录
87
- - `--help`:查看命令帮助
88
- - `--version`:输出当前 CLI 版本
89
-
90
- ### 3.2 环境变量
91
-
92
- ```bash
93
- CODEXS_HOME
94
- CODEXS_CODEX_DIR
95
- ```
96
-
97
- 说明:
98
-
99
- - `CODEXS_HOME`:覆盖默认 tool home 目录
100
- - `CODEXS_CODEX_DIR`:在未传 `--codex-dir` 时提供默认 Codex runtime 目录
101
-
102
- ### 3.3 交互规则
103
-
104
- CLI 的交互行为遵循以下规则:
105
-
106
- - 只有在真实 TTY 终端下才会出现 prompt
107
- - 只要传入 `--json`,就绝不会出现 prompt
108
- - 面向脚本或 CI 的调用应显式传参,并优先使用 `--json`
109
- - 某些危险操作在交互模式下会确认,在非交互模式下则要求显式参数
110
- - `login copilot` 必须在真实 TTY 中运行
111
- - `migrate` 当前仍保留交互式 adopt 契约
112
-
113
- ### 3.4 备份与回滚
114
-
115
- 所有受管理的写操作都会先备份相关文件,再执行写入。
116
-
117
- 典型受影响命令包括:
118
-
119
- - `migrate`
120
- - `add`
121
- - `edit`
122
- - `switch`
123
- - `bridge start`
124
- - `remove`
125
- - `import`
126
-
127
- 如果操作失败,命令内部会尽量自动回滚。你也可以稍后手动执行:
128
-
129
- ```bash
130
- codexs rollback
131
- codexs rollback <backup-id>
132
- ```
133
-
134
- ## 4. 读取类命令
135
-
136
- ### 4.1 `list`
137
-
138
- 列出 `providers.json` 中的全部 provider
139
-
140
- ```bash
141
- codexs list [--json] [--codex-dir <path>]
142
- ```
143
-
144
- ### 4.2 `show`
145
-
146
- 查看单个 provider 的完整记录。
147
-
148
- ```bash
149
- codexs show <provider> [--json] [--codex-dir <path>]
150
- ```
151
-
152
- 说明:
153
-
154
- - 普通文本输出默认隐藏 `apiKey`
155
- - `--json` 模式会返回完整 provider 数据
156
-
157
- ### 4.3 `current`
158
-
159
- 查看 `config.toml` 当前激活的顶层 profile。
160
-
161
- ```bash
162
- codexs current [--json] [--codex-dir <path>]
163
- ```
164
-
165
- ### 4.4 `status`
166
-
167
- 输出目标 Codex runtime 的快速状态摘要。
168
-
169
- ```bash
170
- codexs status [--json] [--codex-dir <path>]
171
- ```
172
-
173
- 通常会覆盖这些信息:
174
-
175
- - 关键文件是否存在
176
- - 当前激活 profile 是什么
177
- - 当前运行态是否能在受管理 provider 映射中找到
178
- - Copilot SDK 是否已安装
179
- - Copilot bridge runtime state 是否健康
180
-
181
- ### 4.5 `config show`
182
-
183
- 查看结构化 config profile 视图。
184
-
185
- ```bash
186
- codexs config show [profile] [--json] [--codex-dir <path>]
187
- ```
188
-
189
- 说明:
190
-
191
- - 不传 `[profile]` 时返回全部可识别 profile
192
- - 可同时看到 managed、unmanaged orphaned 引用
193
-
194
- ### 4.6 `config list-profiles`
195
-
196
- 列出可识别的 config profile 名称及其受管态提示。
197
-
198
- ```bash
199
- codexs config list-profiles [--json] [--codex-dir <path>]
200
- ```
201
-
202
- ### 4.7 `bridge status`
203
-
204
- 查看当前受管 Copilot bridge 的运行状态。
205
-
206
- ```bash
207
- codexs bridge status [provider] [--json] [--codex-dir <path>]
208
- ```
209
-
210
- ### 4.8 `backups list`
211
-
212
- 查看历史备份清单。
213
-
214
- ```bash
215
- codexs backups list [--json] [--codex-dir <path>]
216
- ```
217
-
218
- 说明:
219
-
220
- - 返回结果按 `createdAt` 倒序排列
221
- - 损坏的备份 manifest 会被跳过,并给出 warning,不会导致整个命令失败
222
-
223
- ## 5. 变更类命令
224
-
225
- ### 5.1 `init`
226
-
227
- 初始化 codex-switch tool home 和 registry 文件。
228
-
229
- ```bash
230
- codexs init [--json] [--codex-dir <path>]
231
- ```
232
-
233
- 行为说明:
234
-
235
- - 不依赖 `codex` 可执行文件
236
- - 不要求目标 `config.toml` 或 `auth.json` 已存在
237
- - `codex-switch.json` 不存在时创建
238
- - `providers.json` 不存在时创建空 registry:`{ "providers": {} }`
239
- - 若显式传入 `--codex-dir` 且 `codex-switch.json` 尚不存在,`init` 会把它持久化为 `defaultCodexDir`
240
- - 成功结果围绕 tool home 返回,不再承诺旧的 `createdCodexDir`、`configExists`、`authExists` 等字段
241
-
242
- ### 5.2 `login copilot`
243
-
244
- 完成 GitHub Copilot 上游安装与登录就绪检查。
245
-
246
- ```bash
247
- codexs login copilot
248
- codexs login github-copilot
249
- ```
250
-
251
- 行为说明:
252
-
253
- - 当前支持 `copilot` 与 `github-copilot` 两种拼写
254
- - 若本地 Copilot SDK runtime 未安装,会先确认是否安装
255
- - 若登录尚未就绪,会调用官方 `copilot login`,完成后做一次 recheck
256
- - 该命令要求真实 TTY,不支持 `--json`
257
- - 登录状态是共享的;切换 GitHub 账号会影响所有 Copilot provider
258
-
259
- ### 5.3 `migrate`
260
-
261
- 从现有 `config.toml` adopt unmanaged profiles,并写入受管理的 `providers.json`。
262
-
263
- ```bash
264
- codexs migrate [--json] [--codex-dir <path>] [--merge|--overwrite]
265
- ```
266
-
267
- 行为说明:
268
-
269
- - 读取 `config.toml` 中已有 profile
270
- - 仅 adopt 已具备 `model`、`model_provider` 且能解析到匹配 `base_url` 的 unmanaged profile
271
- - 收集每个 profile 对应的 provider 记录
272
- - 保持受管备份、锁和 post-run `doctor` 流程
273
- - 非交互模式下,profile 选择和 provider 细节收集仍不会自动化展开
274
-
275
- ### 5.4 `setup`
276
-
277
- `setup` 已弃用,不再执行实际初始化或迁移工作。
278
-
279
- ```bash
280
- codexs setup
281
- ```
282
-
283
- ### 5.5 `add`
284
-
285
- 新增一个 provider。`add` 同时支持 direct provider 和 Copilot bridge provider。
286
-
287
- ```bash
288
- codexs add <provider> --profile <name> --api-key <key> [--base-url <url>] [--note <text>] [--tag <tag> ...]
289
- codexs add <provider> --copilot --profile <name> [--bridge-host <host>] [--bridge-port <port>] [--bridge-api-key <secret>]
290
- codexs add <provider> --profile <name> --api-key <key> --create-profile --model <name> --base-url <url>
291
- codexs add
292
- ```
293
-
294
- 说明:
295
-
296
- - direct provider 必须提供 `provider`、`profile`、`apiKey`
297
- - `--create-profile` 可在 profile 缺失时一并创建目标 profile
298
- - direct provider 创建新 profile 时需要同时给出 `--model` 与 `--base-url`
299
- - Copilot provider 创建新 profile 时需要 `--create-profile` 与 `--model`
300
- - `--copilot` 下禁止 `--api-key`,应使用 `--bridge-api-key`
301
- - `add --copilot` 不再负责安装 SDK 或触发登录,应先执行 `codexs login copilot`
302
- - `--install-copilot-sdk` 现在只保留为 rejected compatibility flag
303
-
304
- 交互模式:
305
-
306
- - direct provider 缺少必填项时会在 TTY 中补问
307
- - Copilot provider 的交互流不会要求 direct API key
308
- - tags 交互使用 preset multi-select
309
-
310
- ### 5.6 `edit`
311
-
312
- 编辑单个 provider 的字段。
313
-
314
- ```bash
315
- codexs edit <provider> [--profile <name>] [--api-key <key>] [--base-url <url>] [--note <text>] [--tag <tag> ...] [--json] [--codex-dir <path>]
316
- codexs edit <provider> --profile <name> --create-profile --model <name> --base-url <url>
317
- ```
318
-
319
- 说明:
320
-
321
- - 只更新显式传入的字段
322
- - `--tag` 会替换整组标签,而不是追加单个 tag
323
- - 当目标 profile 不存在时,可配合 `--create-profile`、`--model`、`--base-url` 完成重绑定
324
-
325
- ### 5.7 `switch`
326
-
327
- 切换当前使用的 provider/profile。
328
-
329
- ```bash
330
- codexs switch <provider> [--json] [--codex-dir <path>]
331
- ```
332
-
333
- 行为说明:
334
-
335
- - 根据 `providers.json` 找到目标 provider
336
- - direct provider 会切换 active profile,并将 `auth.json` 重写为 `auth_mode=apikey` 与 `OPENAI_API_KEY=<provider.apiKey>`
337
- - Copilot bridge provider 会维护本地 bridge 路由,并将认证投影写到本地 bridge secret
338
- - Copilot bridge provider 会在切换前检查 SDK 和上游登录状态
339
- - 切换前会备份 `config.toml` 与 `auth.json`
340
-
341
- ### 5.8 `bridge start`
342
-
343
- 启动或复用受管 Copilot bridge。
344
-
345
- ```bash
346
- codexs bridge start [provider] [--json] [--codex-dir <path>]
347
- ```
348
-
349
- 说明:
350
-
351
- - 可通过显式 provider、当前 active provider、唯一 provider 或 TTY 选择来解析目标
352
- - 如果预期端口被占用,会自动寻找新的 5 位端口并持久化
353
-
354
- ### 5.9 `bridge stop`
355
-
356
- 停止受管 Copilot bridge。
357
-
358
- ```bash
359
- codexs bridge stop [provider] [--json] [--codex-dir <path>]
360
- ```
361
-
362
- 说明:
363
-
364
- - 不修改 `providers.json`
365
- - 在没有运行中的受管 bridge 时保持幂等
366
-
367
- ### 5.10 `remove`
368
-
369
- 删除一个 provider 记录。
370
-
371
- ```bash
372
- codexs remove <provider> [--force] [--switch-to <profile>] [--json] [--codex-dir <path>]
373
- ```
374
-
375
- 说明:
376
-
377
- - 删除的是 `providers.json` 中的记录
378
- - 如果删除的 provider 是当前 active profile 的最后一个绑定项,可先传 `--switch-to`
379
- - 非交互模式下必须同时传入 `<provider>` 和 `--force`
380
-
381
- ### 5.11 `import`
382
-
383
- 从外部 JSON 文件导入 provider 配置。
384
-
385
- ```bash
386
- codexs import <file> [--merge] [--json] [--codex-dir <path>]
387
- ```
388
-
389
- ### 5.12 `export`
390
-
391
- 导出当前 `providers.json` 到指定文件。
392
-
393
- ```bash
394
- codexs export <file> [--force] [--json] [--codex-dir <path>]
395
- ```
396
-
397
- 说明:
398
-
399
- - 目标文件已存在时,非交互模式下必须显式传 `--force`
400
-
401
- ## 6. 诊断与恢复
402
-
403
- ### 6.1 `doctor`
404
-
405
- 运行本地配置与环境诊断。
406
-
407
- ```bash
408
- codexs doctor [--json] [--codex-dir <path>]
409
- ```
410
-
411
- 通常会检查:
412
-
413
- - 必要文件是否存在
414
- - provider/profile 映射是否一致
415
- - 当前运行态是否有漂移
416
- - Codex CLI 是否可用
417
- - Copilot SDK、登录状态和 bridge runtime 是否健康
418
-
419
- ### 6.2 `rollback`
420
-
421
- 回滚到最近一次备份,或者指定备份 ID。
422
-
423
- ```bash
424
- codexs rollback [<backup-id>] [--json] [--codex-dir <path>]
425
- ```
426
-
427
- ## 7. JSON 输出与自动化建议
428
-
429
- 如果你是在脚本、CI 或 Agent 环境中调用,建议遵循以下约束:
430
-
431
- ```bash
432
- codexs <command> --json
433
- ```
434
-
435
- 推荐实践:
436
-
437
- - 始终显式传入必需参数,不依赖交互输入
438
- - 使用 `--json` 获取稳定输出
439
- - 对危险命令显式传入控制参数,例如 `--force`、`--merge`、`--overwrite`
440
- - 对多环境调试使用 `--codex-dir <path>` 和 `CODEXS_HOME`
441
- - 不要在自动化环境中调用 `login copilot`
442
-
443
- ## 8. 典型使用流程
444
-
445
- ### 8.1 第一次接管现有 Codex 配置
446
-
447
- ```bash
448
- codexs init
449
- codexs migrate
450
- codexs list
451
- codexs doctor
452
- ```
453
-
454
- ### 8.2 新增并切换到一个 direct provider
455
-
456
- ```bash
457
- codexs add my-provider --profile my-provider --api-key sk-xxx
458
- codexs switch my-provider
459
- codexs current
460
- ```
461
-
462
- ### 8.3 接入 GitHub Copilot provider
463
-
464
- ```bash
465
- codexs login copilot
466
- codexs add copilot-main --copilot --profile copilot-main
467
- codexs switch copilot-main
468
- codexs bridge status copilot-main
469
- ```
470
-
471
- ### 8.4 检查 config profile 与受管态映射
472
-
473
- ```bash
474
- codexs config list-profiles
475
- codexs config show
476
- ```
477
-
478
- ### 8.5 出现错误后恢复
479
-
480
- ```bash
481
- codexs backups list
482
- codexs rollback
483
- ```
484
-
485
- ## 9. 危险命令说明
486
-
487
- 以下命令会修改本地配置或覆盖文件,使用前应明确预期:
488
-
489
- - `init`
490
- - `migrate`
491
- - `add`
492
- - `edit`
493
- - `switch`
494
- - `bridge start`
495
- - `remove`
496
- - `import`
497
- - `export`(目标文件已存在时)
498
- - `rollback`
499
-
500
- 建议:
501
-
502
- - 人工操作先执行 `backups list`
503
- - 自动化操作统一加 `--json`
504
- - 在测试目录中先用 `--codex-dir <path>` 与 `CODEXS_HOME` 验证流程
505
-
506
- ## 10. 查看命令帮助
507
-
508
- 可以查看总帮助:
509
-
510
- ```bash
511
- codexs --help
512
- ```
513
-
514
- 也可以查看单个命令帮助:
515
-
516
- ```bash
517
- codexs help init
518
- codexs help login
519
- codexs help bridge
520
- codexs help config
521
- codexs help add
522
- codexs help switch
523
- codexs help rollback
524
- ```
1
+ # codex-switch CLI Usage
2
+
3
+ This document describes the current CLI contract for `@minniexcode/codex-switch` at version `0.1.0`.
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.0`.
14
+
15
+ This is the first stable release line. The command surface already exists, and this version focuses on keeping workflow guidance, help text, and implementation behavior aligned.
16
+
17
+ ## 2. Primary Workflows
18
+
19
+ ### 2.1 Direct Providers
20
+
21
+ ```bash
22
+ codexs init
23
+ codexs add <provider> --profile <name> --api-key <key>
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 --profile <name>
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. Advanced Adopt Workflow
56
+
57
+ Use `migrate` only when you already have Codex runtime state that should be adopted into managed `providers.json` state.
58
+
59
+ ```bash
60
+ codexs init
61
+ codexs migrate
62
+ ```
63
+
64
+ `migrate` is an advanced adopt helper. It is not the default first step for fresh installs.
65
+
66
+ Current behavior:
67
+
68
+ - It reads `config.toml` profiles from the target Codex runtime.
69
+ - It can collect missing provider details in TTY mode.
70
+ - It can merge into or overwrite existing managed provider state.
71
+ - It still fails fast in non-TTY and `--json` runs when interactive input would be required.
72
+
73
+ ## 4. Deprecated Entry
74
+
75
+ ```bash
76
+ codexs setup
77
+ ```
78
+
79
+ `setup` is deprecated. It is kept only to direct callers toward `init` or `migrate`, and it no longer performs initialization or migration work.
80
+
81
+ ## 5. Global Contract
82
+
83
+ ### 5.1 Global Flags
84
+
85
+ ```bash
86
+ --json
87
+ --codex-dir <path>
88
+ --help
89
+ --version
90
+ ```
91
+
92
+ ### 5.2 Environment Variables
93
+
94
+ ```bash
95
+ CODEXS_HOME
96
+ CODEXS_CODEX_DIR
97
+ ```
98
+
99
+ ### 5.3 Runtime Model
100
+
101
+ Tool home:
102
+
103
+ ```text
104
+ ~/.config/codex-switch/
105
+ codex-switch.json
106
+ providers.json
107
+ backups/
108
+ runtime/
109
+ runtimes/
110
+ ```
111
+
112
+ Target Codex runtime:
113
+
114
+ ```text
115
+ ~/.codex/
116
+ config.toml
117
+ auth.json
118
+ ```
119
+
120
+ Meaning:
121
+
122
+ - `providers.json` is the managed provider registry.
123
+ - `codex-switch.json` stores tool-level metadata such as `defaultCodexDir`.
124
+ - `config.toml` remains the active runtime routing file.
125
+ - `auth.json` remains the active auth projection file.
126
+
127
+ ## 6. Command Categories
128
+
129
+ Read commands:
130
+
131
+ ```bash
132
+ codexs list
133
+ codexs show <provider>
134
+ codexs current
135
+ codexs status
136
+ codexs config show [profile]
137
+ codexs config list-profiles
138
+ codexs bridge status [provider]
139
+ codexs backups list
140
+ codexs doctor
141
+ ```
142
+
143
+ Change commands:
144
+
145
+ ```bash
146
+ codexs init
147
+ codexs login copilot
148
+ codexs migrate
149
+ codexs add <provider>
150
+ codexs edit <provider>
151
+ codexs switch <provider>
152
+ codexs remove <provider>
153
+ codexs import <file>
154
+ codexs export <file>
155
+ codexs bridge start [provider]
156
+ codexs bridge stop [provider]
157
+ codexs rollback [backup-id]
158
+ ```
159
+
160
+ ## 7. Selected Command Semantics
161
+
162
+ ### `init`
163
+
164
+ - Creates `codex-switch.json` and `providers.json` under the tool home when they do not exist yet.
165
+ - Does not create or validate `config.toml`, `auth.json`, or the target Codex directory.
166
+ - When `--codex-dir` is passed explicitly during first-time initialization, it can persist `defaultCodexDir`.
167
+
168
+ ### `login copilot`
169
+
170
+ - Supports `copilot` and `github-copilot` as the current upstream name.
171
+ - Installs the local Copilot SDK under the tool home when needed.
172
+ - Invokes the official Copilot CLI for login when readiness is not already present.
173
+ - Requires a real TTY and does not support `--json`.
174
+
175
+ ### `status`
176
+
177
+ - Reports the target Codex runtime and the tool-home root.
178
+ - Reports the current profile and whether it maps to a managed provider.
179
+ - Adds bridge, Copilot SDK, and upstream auth signals when the active provider uses a local runtime bridge.
180
+ - Does not mutate any files.
181
+
182
+ ### `list`
183
+
184
+ - Lists managed providers together with their linked profile.
185
+ - Distinguishes provider type using the public values `direct` and `copilot`.
186
+ - Marks the current provider only when the active runtime can be mapped back to one unique managed provider.
187
+ - When the active profile is shared by multiple providers, it does not invent a single current provider and should instead surface the ambiguity.
188
+ - TTY provider pickers used by commands such as `switch` and `show` follow the same visibility rules for profile, provider type, and current-state hints.
189
+
190
+ ### `doctor`
191
+
192
+ - Checks expected config files, provider/profile consistency, and Codex CLI availability.
193
+ - Adds bridge and Copilot dependency diagnostics for Copilot-backed providers.
194
+ - Returns repair-oriented issues intended for both human users and AI agents.
195
+
196
+ ### `switch`
197
+
198
+ - Direct providers rewrite `auth.json` as an API-key projection and update the active runtime profile.
199
+ - Copilot bridge providers also project the local bridge secret into the runtime while managing bridge routing.
200
+ - Managed writes are backed up and rolled back on failure.
201
+ - When `<provider>` is omitted in a TTY, the interactive provider selector should show profile, provider type, and current-state hints using the same rules as `list`.
202
+
203
+ ### `migrate`
204
+
205
+ - Adopts unmanaged runtime profiles into managed `providers.json` state.
206
+ - Still relies on interactive profile selection and provider-detail collection in this release.
207
+ - Should be treated as an advanced adopt tool, not as the normal onboarding path.
208
+
209
+ ## 8. Automation Boundaries
210
+
211
+ - Progressive prompts run only in a real TTY and never under `--json`.
212
+ - Human write commands may prompt for missing inputs or dangerous-action confirmation.
213
+ - Automation should pass explicit arguments and prefer `--json`.
214
+ - `login copilot` is TTY-only.
215
+ - `migrate` is not yet a complete non-interactive workflow.
216
+
217
+ ## 9. Related Docs
218
+
219
+ - [README](../README.md)
220
+ - [Chinese README](../README.CN.md)
221
+ - [AI README](../README.AI.md)
222
+ - [Product Overview](./codex-switch-product-overview.md)
223
+ - [Release PRD 0.1.0](./PRD/codex-switch-prd-v0.1.0.md)