cc-switch-tui 0.2.1

All-in-One Assistant for Claude Code, Codex, Gemini, OpenCode, OpenClaw & Hermes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
use super::is_chinese;
pub fn tui_label_skills() -> &'static str {
    if is_chinese() {
        "技能:"
    } else {
        "Skills:"
    }
}

pub fn prompts_label() -> &'static str {
    if is_chinese() {
        "提示词:"
    } else {
        "Prompts:"
    }
}

pub fn total() -> &'static str {
    if is_chinese() {
        "总计"
    } else {
        "Total"
    }
}

pub fn enabled() -> &'static str {
    if is_chinese() {
        "启用"
    } else {
        "Enabled"
    }
}

pub fn disabled() -> &'static str {
    if is_chinese() {
        "禁用"
    } else {
        "Disabled"
    }
}

pub fn active() -> &'static str {
    if is_chinese() {
        "活动"
    } else {
        "Active"
    }
}

pub fn none() -> &'static str {
    if is_chinese() {
        ""
    } else {
        "None"
    }
}

// Settings
pub fn settings_title() -> &'static str {
    if is_chinese() {
        "⚙️  设置"
    } else {
        "⚙️  Settings"
    }
}

pub fn change_language() -> &'static str {
    if is_chinese() {
        "🌐 切换语言"
    } else {
        "🌐 Change Language"
    }
}

pub fn current_language_label() -> &'static str {
    if is_chinese() {
        "当前语言"
    } else {
        "Current Language"
    }
}

pub fn select_language() -> &'static str {
    if is_chinese() {
        "选择语言:"
    } else {
        "Select language:"
    }
}

pub fn language_changed() -> &'static str {
    if is_chinese() {
        "✓ 语言已更改"
    } else {
        "✓ Language changed"
    }
}

pub fn skip_claude_onboarding() -> &'static str {
    if is_chinese() {
        "🚫 跳过 Claude Code 初次安装确认"
    } else {
        "🚫 Skip Claude Code onboarding confirmation"
    }
}

pub fn skip_claude_onboarding_label() -> &'static str {
    if is_chinese() {
        "跳过 Claude Code 初次安装确认"
    } else {
        "Skip Claude Code onboarding confirmation"
    }
}

pub fn skip_claude_onboarding_confirm(enable: bool, path: &str) -> String {
    if is_chinese() {
        if enable {
            format!(
                "确认启用跳过 Claude Code 初次安装确认?\n将写入 {path}: hasCompletedOnboarding=true"
            )
        } else {
            format!("确认恢复 Claude Code 初次安装确认?\n将从 {path} 删除 hasCompletedOnboarding")
        }
    } else {
        if enable {
            format!(
                "Enable skipping Claude Code onboarding confirmation?\nWrites hasCompletedOnboarding=true to {path}"
            )
        } else {
            format!(
                "Disable skipping Claude Code onboarding confirmation?\nRemoves hasCompletedOnboarding from {path}"
            )
        }
    }
}

pub fn skip_claude_onboarding_changed(enable: bool) -> String {
    if is_chinese() {
        if enable {
            "✓ 已启用:跳过 Claude Code 初次安装确认".to_string()
        } else {
            "✓ 已恢复 Claude Code 初次安装确认".to_string()
        }
    } else {
        if enable {
            "✓ Skip Claude Code onboarding confirmation enabled".to_string()
        } else {
            "✓ Claude Code onboarding confirmation restored".to_string()
        }
    }
}

pub fn enable_claude_plugin_integration() -> &'static str {
    if is_chinese() {
        "🔌 接管 Claude Code for VSCode 插件"
    } else {
        "🔌 Apply to Claude Code for VSCode"
    }
}

pub fn enable_claude_plugin_integration_label() -> &'static str {
    if is_chinese() {
        "接管 Claude Code for VSCode 插件"
    } else {
        "Apply to Claude Code for VSCode"
    }
}

pub fn enable_claude_plugin_integration_confirm(enable: bool, path: &str) -> String {
    if is_chinese() {
        if enable {
            format!(
                "确认启用 Claude Code for VSCode 插件联动?\n将写入 {path}: primaryApiKey=\"any\""
            )
        } else {
            "确认关闭 Claude Code for VSCode 插件联动?".to_string()
        }
    } else {
        if enable {
            format!(
                "Enable Claude Code for VSCode integration?\nWrites primaryApiKey=\"any\" to {path}"
            )
        } else {
            format!(
                "Disable Claude Code for VSCode integration?\nRemoves primaryApiKey from {path}"
            )
        }
    }
}

pub fn enable_claude_plugin_integration_changed(enable: bool) -> String {
    if is_chinese() {
        if enable {
            "✓ 已启用 Claude Code for VSCode 插件联动".to_string()
        } else {
            "✓ 已关闭 Claude Code for VSCode 插件联动".to_string()
        }
    } else {
        if enable {
            "✓ Claude Code for VSCode integration enabled".to_string()
        } else {
            "✓ Claude Code for VSCode integration disabled".to_string()
        }
    }
}

pub fn claude_plugin_sync_failed_warning(err: &str) -> String {
    if is_chinese() {
        format!("⚠ Claude Code for VSCode 插件联动失败: {err}")
    } else {
        format!("⚠ Claude Code for VSCode integration failed: {err}")
    }
}

// App Selection
pub fn select_application() -> &'static str {
    if is_chinese() {
        "选择应用程序:"
    } else {
        "Select application:"
    }
}

pub fn switched_to_app(app: &str) -> String {
    if is_chinese() {
        format!("✓ 已切换到 {}", app)
    } else {
        format!("✓ Switched to {}", app)
    }
}

// Common
pub fn press_enter() -> &'static str {
    if is_chinese() {
        "按 Enter 继续..."
    } else {
        "Press Enter to continue..."
    }
}

pub fn error_prefix() -> &'static str {
    if is_chinese() {
        "错误"
    } else {
        "Error"
    }
}

// Table Headers
pub fn header_name() -> &'static str {
    if is_chinese() {
        "名称"
    } else {
        "Name"
    }
}

pub fn header_category() -> &'static str {
    if is_chinese() {
        "类别"
    } else {
        "Category"
    }
}

pub fn header_description() -> &'static str {
    if is_chinese() {
        "描述"
    } else {
        "Description"
    }
}

// Config Management
pub fn config_management() -> &'static str {
    if is_chinese() {
        "⚙️  配置文件管理"
    } else {
        "⚙️  Configuration Management"
    }
}

pub fn config_export() -> &'static str {
    if is_chinese() {
        "📤 导出配置"
    } else {
        "📤 Export Config"
    }
}

pub fn config_import() -> &'static str {
    if is_chinese() {
        "📥 导入配置"
    } else {
        "📥 Import Config"
    }
}

pub fn config_backup() -> &'static str {
    if is_chinese() {
        "💾 备份配置"
    } else {
        "💾 Backup Config"
    }
}

pub fn config_restore() -> &'static str {
    if is_chinese() {
        "♻️  恢复配置"
    } else {
        "♻️  Restore Config"
    }
}

pub fn config_validate() -> &'static str {
    if is_chinese() {
        "✓ 验证配置"
    } else {
        "✓ Validate Config"
    }
}

pub fn config_common_snippet() -> &'static str {
    if is_chinese() {
        "🧩 通用配置片段"
    } else {
        "🧩 Common Config Snippet"
    }
}

pub fn config_common_snippet_title() -> &'static str {
    if is_chinese() {
        "通用配置片段"
    } else {
        "Common Config Snippet"
    }
}

pub fn config_common_snippet_none_set() -> &'static str {
    if is_chinese() {
        "未设置通用配置片段。"
    } else {
        "No common config snippet is set."
    }
}

pub fn config_common_snippet_set_for_app(app: &str) -> String {
    if is_chinese() {
        format!("✓ 已为应用 '{}' 设置通用配置片段", app)
    } else {
        format!("✓ Common config snippet set for app '{}'", app)
    }
}

pub fn config_common_snippet_require_json_or_file() -> &'static str {
    if is_chinese() {
        "请提供 --snippet(或兼容别名 --json)或 --file"
    } else {
        "Please provide --snippet (or the compatibility alias --json) or --file"
    }
}

pub fn config_reset() -> &'static str {
    if is_chinese() {
        "🔄 重置配置"
    } else {
        "🔄 Reset Config"
    }
}

pub fn config_show_full() -> &'static str {
    if is_chinese() {
        "👁️  查看完整配置"
    } else {
        "👁️  Show Full Config"
    }
}

pub fn config_show_path() -> &'static str {
    if is_chinese() {
        "📍 显示配置路径"
    } else {
        "📍 Show Config Path"
    }
}

pub fn enter_export_path() -> &'static str {
    if is_chinese() {
        "输入导出文件路径:"
    } else {
        "Enter export file path:"
    }
}

pub fn enter_import_path() -> &'static str {
    if is_chinese() {
        "输入导入文件路径:"
    } else {
        "Enter import file path:"
    }
}

pub fn enter_restore_path() -> &'static str {
    if is_chinese() {
        "输入备份文件路径:"
    } else {
        "Enter backup file path:"
    }
}

pub fn confirm_import() -> &'static str {
    if is_chinese() {
        "确定要导入配置吗?这将覆盖当前配置。"
    } else {
        "Are you sure you want to import? This will overwrite current configuration."
    }
}

pub fn confirm_reset() -> &'static str {
    if is_chinese() {
        "确定要重置配置吗?这将删除所有自定义设置。"
    } else {
        "Are you sure you want to reset? This will delete all custom settings."
    }
}

pub fn common_config_snippet_editor_prompt(app: &str) -> String {
    let is_codex = app == "codex";
    if is_chinese() {
        if is_codex {
            format!("编辑 {app} 的通用配置片段(TOML,留空则清除):")
        } else {
            format!("编辑 {app} 的通用配置片段(JSON 对象,留空则清除):")
        }
    } else {
        if is_codex {
            format!("Edit common config snippet for {app} (TOML; empty to clear):")
        } else {
            format!("Edit common config snippet for {app} (JSON object; empty to clear):")
        }
    }
}

pub fn common_config_snippet_invalid_json(err: &str) -> String {
    if is_chinese() {
        format!("JSON 无效:{err}")
    } else {
        format!("Invalid JSON: {err}")
    }
}

pub fn common_config_snippet_invalid_toml(err: &str) -> String {
    if is_chinese() {
        format!("TOML 无效:{err}")
    } else {
        format!("Invalid TOML: {err}")
    }
}

pub fn failed_to_serialize_json(err: &str) -> String {
    if is_chinese() {
        format!("序列化 JSON 失败:{err}")
    } else {
        format!("Failed to serialize JSON: {err}")
    }
}

pub fn common_config_snippet_not_object() -> &'static str {
    if is_chinese() {
        "通用配置必须是 JSON 对象(例如:{\"env\":{...}})"
    } else {
        "Common config must be a JSON object (e.g. {\"env\":{...}})"
    }
}

pub fn common_config_snippet_saved() -> &'static str {
    if is_chinese() {
        "✓ 已保存通用配置片段"
    } else {
        "✓ Common config snippet saved"
    }
}

pub fn common_config_snippet_cleared() -> &'static str {
    if is_chinese() {
        "✓ 已清除通用配置片段"
    } else {
        "✓ Common config snippet cleared"
    }
}

pub fn common_config_snippet_apply_now() -> &'static str {
    if is_chinese() {
        "现在在适用时刷新 live 配置?"
    } else {
        "Refresh live config now when applicable?"
    }
}

pub fn common_config_snippet_no_current_provider() -> &'static str {
    if is_chinese() {
        "当前未选择供应商,已保存通用配置片段。"
    } else {
        "No current provider selected; common config snippet saved."
    }
}

pub fn common_config_snippet_no_current_provider_after_clear() -> &'static str {
    if is_chinese() {
        "当前未选择供应商,已清除通用配置片段。"
    } else {
        "No current provider selected; common config snippet cleared."
    }
}

pub fn common_config_snippet_applied() -> &'static str {
    if is_chinese() {
        "✓ 已在适用时刷新 live 配置(请重启对应客户端)"
    } else {
        "✓ Refreshed live config when applicable (restart the client)"
    }
}

pub fn common_config_snippet_apply_not_needed() -> &'static str {
    if is_chinese() {
        "当前应用使用 additive 模式,无需执行当前 provider 刷新。"
    } else {
        "This app uses additive mode; no current-provider refresh is needed."
    }
}

pub fn common_config_snippet_apply_hint() -> &'static str {
    if is_chinese() {
        "提示:切换一次供应商即可重新写入 live 配置。"
    } else {
        "Tip: switch provider once to re-write the live config."
    }
}

pub fn confirm_restore() -> &'static str {
    if is_chinese() {
        "确定要从备份恢复配置吗?"
    } else {
        "Are you sure you want to restore from backup?"
    }
}

pub fn exported_to(path: &str) -> String {
    if is_chinese() {
        format!("✓ 已导出到 '{}'", path)
    } else {
        format!("✓ Exported to '{}'", path)
    }
}

pub fn imported_from(path: &str) -> String {
    if is_chinese() {
        format!("✓ 已从 '{}' 导入", path)
    } else {
        format!("✓ Imported from '{}'", path)
    }
}

pub fn backup_created(id: &str) -> String {
    if is_chinese() {
        format!("✓ 已创建备份,ID: {}", id)
    } else {
        format!("✓ Backup created, ID: {}", id)
    }
}

pub fn restored_from(path: &str) -> String {
    if is_chinese() {
        format!("✓ 已从 '{}' 恢复", path)
    } else {
        format!("✓ Restored from '{}'", path)
    }
}

pub fn config_valid() -> &'static str {
    if is_chinese() {
        "✓ 配置文件有效"
    } else {
        "✓ Configuration is valid"
    }
}

pub fn config_reset_done() -> &'static str {
    if is_chinese() {
        "✓ 配置已重置为默认值"
    } else {
        "✓ Configuration reset to defaults"
    }
}

pub fn file_overwrite_confirm(path: &str) -> String {
    if is_chinese() {
        format!("文件 '{}' 已存在,是否覆盖?", path)
    } else {
        format!("File '{}' exists. Overwrite?", path)
    }
}

// MCP Management Additional
pub fn mcp_delete_server() -> &'static str {
    if is_chinese() {
        "🗑️  删除服务器"
    } else {
        "🗑️  Delete Server"
    }
}

pub fn mcp_enable_server() -> &'static str {
    if is_chinese() {
        "✅ 启用服务器"
    } else {
        "✅ Enable Server"
    }
}

pub fn mcp_disable_server() -> &'static str {
    if is_chinese() {
        "❌ 禁用服务器"
    } else {
        "❌ Disable Server"
    }
}

pub fn mcp_import_servers() -> &'static str {
    if is_chinese() {
        "📥 导入已有 MCP 服务器"
    } else {
        "📥 Import Existing MCP Servers"
    }
}

pub fn mcp_validate_command() -> &'static str {
    if is_chinese() {
        "✓ 验证命令"
    } else {
        "✓ Validate Command"
    }
}

pub fn select_server_to_delete() -> &'static str {
    if is_chinese() {
        "选择要删除的服务器:"
    } else {
        "Select server to delete:"
    }
}

pub fn select_server_to_enable() -> &'static str {
    if is_chinese() {
        "选择要启用的服务器:"
    } else {
        "Select server to enable:"
    }
}

pub fn select_server_to_disable() -> &'static str {
    if is_chinese() {
        "选择要禁用的服务器:"
    } else {
        "Select server to disable:"
    }
}

pub fn select_apps_to_enable() -> &'static str {
    if is_chinese() {
        "选择要启用的应用:"
    } else {
        "Select apps to enable for:"
    }
}

pub fn select_apps_to_disable() -> &'static str {
    if is_chinese() {
        "选择要禁用的应用:"
    } else {
        "Select apps to disable for:"
    }
}

pub fn enter_command_to_validate() -> &'static str {
    if is_chinese() {
        "输入要验证的命令:"
    } else {
        "Enter command to validate:"
    }
}

pub fn server_deleted(id: &str) -> String {
    if is_chinese() {
        format!("✓ 已删除服务器 '{}'", id)
    } else {
        format!("✓ Deleted server '{}'", id)
    }
}

pub fn server_enabled(id: &str) -> String {
    if is_chinese() {
        format!("✓ 已启用服务器 '{}'", id)
    } else {
        format!("✓ Enabled server '{}'", id)
    }
}

pub fn server_disabled(id: &str) -> String {
    if is_chinese() {
        format!("✓ 已禁用服务器 '{}'", id)
    } else {
        format!("✓ Disabled server '{}'", id)
    }
}

pub fn servers_imported(count: usize) -> String {
    if is_chinese() {
        format!("✓ 已导入 {count} 个 MCP 服务器")
    } else {
        format!("✓ Imported {count} MCP server(s)")
    }
}

pub fn command_valid(cmd: &str) -> String {
    if is_chinese() {
        format!("✓ 命令 '{}' 有效", cmd)
    } else {
        format!("✓ Command '{}' is valid", cmd)
    }
}

pub fn command_invalid(cmd: &str) -> String {
    if is_chinese() {
        format!("✗ 命令 '{}' 未找到", cmd)
    } else {
        format!("✗ Command '{}' not found", cmd)
    }
}

// Prompts Management Additional
pub fn prompts_show_content() -> &'static str {
    if is_chinese() {
        "👁️  查看完整内容"
    } else {
        "👁️  View Full Content"
    }
}

pub fn prompts_delete() -> &'static str {
    if is_chinese() {
        "🗑️  删除提示词"
    } else {
        "🗑️  Delete Prompt"
    }
}

pub fn prompts_view_current() -> &'static str {
    if is_chinese() {
        "📋 查看当前提示词"
    } else {
        "📋 View Current Prompt"
    }
}

pub fn select_prompt_to_view() -> &'static str {
    if is_chinese() {
        "选择要查看的提示词:"
    } else {
        "Select prompt to view:"
    }
}

pub fn select_prompt_to_delete() -> &'static str {
    if is_chinese() {
        "选择要删除的提示词:"
    } else {
        "Select prompt to delete:"
    }
}

pub fn prompt_deleted(id: &str) -> String {
    if is_chinese() {
        format!("✓ 已删除提示词 '{}'", id)
    } else {
        format!("✓ Deleted prompt '{}'", id)
    }
}

pub fn no_active_prompt() -> &'static str {
    if is_chinese() {
        "当前没有激活的提示词。"
    } else {
        "No active prompt."
    }
}

pub fn cannot_delete_active() -> &'static str {
    if is_chinese() {
        "无法删除当前激活的提示词。"
    } else {
        "Cannot delete the active prompt."
    }
}

pub fn no_servers_to_delete() -> &'static str {
    if is_chinese() {
        "没有可删除的服务器。"
    } else {
        "No servers to delete."
    }
}

pub fn no_prompts_to_delete() -> &'static str {
    if is_chinese() {
        "没有可删除的提示词。"
    } else {
        "No prompts to delete."
    }
}

// Provider Speedtest
pub fn speedtest_endpoint() -> &'static str {
    if is_chinese() {
        "🚀 测试端点速度"
    } else {
        "🚀 Speedtest endpoint"
    }
}

pub fn back() -> &'static str {
    if is_chinese() {
        "← 返回"
    } else {
        "← Back"
    }
}

// ============================================
// TUI UPDATE (TUI 自更新)