Repository navigation
Expand file tree
/
Copy pathdeplink.html
More file actions
2266 lines (2082 loc) · 157 KB
/
Copy pathdeplink.html
File metadata and controls
2266 lines (2082 loc) · 157 KB
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
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CC Switch 深链接生成器</title>
<!-- 图标内联:页面同时挂在仓库和官网(ccswitch.io/deplink.html),不依赖相对路径 -->
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAImUlEQVR42uVXeXDU1R1/v/c7dzeb3bCbhFwk2aSEBBJCCAshJFZRQA5p6wAWWkSorYxjK5Q6OmI7XgNOp+iohdYL60gpIseMVqy0tBKOJhxJgcQAOQjk2iS72ez5u9779b1NVjkakE47/aO/3Z39ve/7ve/5+R4/DvyPL+7/XgF4Ow8zDAOH/xh4LZ1+AUNv4XV7t7rY21TYiP9TLWLCydf4ik5vDKrQf8UD7odW/WrJb7a2p0womGGQC0LIUoECB7kPfjjro9qn5jW6cx1uwwAG9QSEAHIsw/1bCsT8zLIcYRPzkjU1NXviogXrHS5XzpTvLnshdphhYnsVLmfl4tLshe781KLl7pxVlMZzjIAxwDoy9OEo/WuvwNFiTS3ECOkGxogowQU9ng5P84WjajgMUsYXVNsyM8brCKn0+em5zlk6kRaKKOB4a38NpSkalktc5sIf3JvyII3MaKGBowjHks3mLJg3dw1vMlmIEtQK0H706O8ZlgWCxcK7KiuXx89MdzmrKCSCsqqc6Ro8HaNNSJh8ZEtx7ZvPFb77xjrX1jhebq4A4UKFs4Ig3vP0Uwfu2vDTtxa+tOmUIy+vlG531NbtjwaGQsQzILeyYjnlZ5M4a1GavZScA52DoUtf9ATPl+ZZJh16qfiYSYBWENJBSa55chygN1UgrqGUmOgksS6PDA4CW3p6waLNm+qLFi54LDIw0H257uR+gg2QlJn5DVvRxJn5diF7rM2UyhNOBxt7/5idIqTXbCo9KULGzHEQtF2OtC3c2LxgBDPMrdKQphdUI5FAb2PjwcyyskVigtWiybLuqq5aQBTL7Dpz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ZsIfn12w4e2VFfsyiAU62VGCQf9eNntge8Zs2zjFa0yVuyABIn7f6YbnfGpzNfZYsSDymgxRehqTtPo7KQ+ZBUPafXRgz8W+0IXPL/QdarjiP33TbkjcHqNtWVL22pal036JiG9NEg9OnO/8/HsHex/9JNVt5Ymz81RvzH1+RsScJILaIGjddKjlGYeZJxnFYH+vCUeCKnpi9bgnj7w86XCGQ0ilfMnwItxqHoiFxW4WxjACR4c8/Iv99Rvn/vb4N7n5y9Y5rCabicwYqThCzxp+MYFjUBjcU2C587W6zq07a9t2JdskXlV4JHuS2OigolVOsVWd2lbS4EoTs0n8VdoPRp2KST2gZQM8ubf+8QueQPNnX/QeON3hOznj4TVbcyeOLw+SoUPqbj1rV31ZWBDsEax5s4xea3ly0Dx1gqN61Xt1D5SMc0zLS0l0Bf0mHUo2aLKGQGq6NDbZxjvbepSOWMUaLjs3eiBWn0k69gWV/s2fNj1PhefPmrmk8N55a9WoDIb6ve29u3c8Z5d4O0M64t9PNr6brbb2Fls8YFGZZQ7lsXL70fuipI6KIsPhQTu758DQrvt+dnZ+bXPoFJ0TSQnGNx3J4kMlxwCW4zm+7MGVr1OFOVEEh3+9bVkKivDmBHPs9J9Ode43elqaHIIXVBcKbhrBc12BxrU7apdaRRZc8Piblm1ufuCj40MHaIrHK+Ath1ISCtLcGKxrunbx0F/foInRsGvXi+HzTSfcRePm0FRRdKw3dATqL7b21QGogtJ805TcsUIWPb+vvmvf1Bc+mTjv1b9VICKTzgO0+dzeWD7SH+p37nrmg4d/NLb+D7s30vX5nsF/iMS6c93+0wFVDX9aFzhAu12vV+0ORFAwVuOJtY09gaahqBag3tSQoYHREP913ojojBDvmMOT8Jhpl7zhDk9A6aPr0jzzpM5+tXsgoPviJX24v8ROGKPyvo3Xsi+FX98/RqZNY7R+8p98Nfvq4FU9Y2QNr15/3euft1YnehkuXZIAAAAASUVORK5CYII=">
<script>
// 先于样式应用保存的外观,避免深色模式下闪一下白屏
try {
var savedTheme = localStorage.getItem('ccswitch-deeplink-theme');
if (savedTheme === 'light' || savedTheme === 'dark') document.documentElement.setAttribute('data-theme', savedTheme);
} catch (e) { }
</script>
<style>
/* 令牌照抄 docs/design-system.html(v7),与 App 的 src/index.css 一致:
中性面 + 主题橙只用在操作上,深色模式跟随系统或手动切换 */
:root {
--action-bg: #f97316;
--action-hover: #ea620a;
--action-fg: #ffffff;
--action-text: #c2410c;
--action-soft: #fff1e6;
--ring: #f97316;
--bg-app: #ffffff;
--bg-sidebar: #f5f5f7;
--bg-subtle: #efeff2;
--bg-selected: #e4e4ea;
--bg-card: #ffffff;
--border: #e4e4e9;
--border-strong: #cfcfd6;
--text-1: #18181b;
--text-2: #52525b;
--text-3: #65656e;
--inverse-bg: #18181b;
--inverse-fg: #ffffff;
--success: #16a34a;
--success-text: #007634;
--success-soft: #e8f7ee;
--warning: #d97706;
--warning-text: #a64a00;
--warning-soft: #fef3c7;
--danger: #dc2626;
--danger-text: #b91c1c;
--danger-soft: #fee2e2;
--agent-claude: #c2613f;
--agent-codex: #3f3f46;
--agent-gemini: #3367d6;
--agent-opencode: #0f766e;
--agent-pi: #7c3aed;
--shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
--shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
--shadow-lg: 0 20px 40px rgba(16, 24, 40, .16), 0 4px 12px rgba(16, 24, 40, .08);
--r-control: 6px;
--r-panel: 10px;
--font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
"Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
--dur: 150ms;
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--action-bg: #ea580c; --action-hover: #f06d1f; --action-text: #fb923c; --action-soft: rgba(249, 115, 21, 0.12); --ring: #d77a3c;
--bg-app: #1c1c1e; --bg-sidebar: #161618; --bg-subtle: #26262a; --bg-selected: #313136; --bg-card: #2e2e33;
--border: #3e3e45; --border-strong: #4a4a52;
--text-1: #e4e4e7; --text-2: #ababb3; --text-3: #9a9aa2;
--inverse-bg: #f4f4f5; --inverse-fg: #18181b;
--success: #4ade80; --success-text: #4ade80; --success-soft: #0f2b1a;
--warning: #fbbf24; --warning-text: #fcd34d; --warning-soft: #33260a;
--danger: #f87171; --danger-text: #fca5a5; --danger-soft: #3a1414;
--agent-claude: #e08a6a; --agent-codex: #d4d4d8; --agent-gemini: #8ab4f8; --agent-opencode: #5eead4; --agent-pi: #c4b5fd;
--shadow-sm: 0 0 0 1px rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .4);
--shadow-md: 0 4px 12px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4);
--shadow-lg: 0 20px 40px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .4);
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--action-bg: #ea580c; --action-hover: #f06d1f; --action-text: #fb923c; --action-soft: rgba(249, 115, 21, 0.12); --ring: #d77a3c;
--bg-app: #1c1c1e; --bg-sidebar: #161618; --bg-subtle: #26262a; --bg-selected: #313136; --bg-card: #2e2e33;
--border: #3e3e45; --border-strong: #4a4a52;
--text-1: #e4e4e7; --text-2: #ababb3; --text-3: #9a9aa2;
--inverse-bg: #f4f4f5; --inverse-fg: #18181b;
--success: #4ade80; --success-text: #4ade80; --success-soft: #0f2b1a;
--warning: #fbbf24; --warning-text: #fcd34d; --warning-soft: #33260a;
--danger: #f87171; --danger-text: #fca5a5; --danger-soft: #3a1414;
--agent-claude: #e08a6a; --agent-codex: #d4d4d8; --agent-gemini: #8ab4f8; --agent-opencode: #5eead4; --agent-pi: #c4b5fd;
--shadow-sm: 0 0 0 1px rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .4);
--shadow-md: 0 4px 12px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4);
--shadow-lg: 0 20px 40px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .4);
color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg-app); color: var(--text-1); font-size: 13px; line-height: 20px; }
h1, h2, h3, h4 { margin: 0; color: var(--text-1); }
p { margin: 0; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-subtle); border-radius: 4px; padding: 1px 5px; color: var(--text-1); }
a { color: var(--action-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 14px; height: 14px; }
/* ---------- 外壳:照 App 的侧栏 + 内容 ---------- */
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.rail {
position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
background: var(--bg-sidebar); border-right: 1px solid var(--border);
padding: 18px 8px 14px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 15px; font-weight: 600; }
.brand img { width: 22px; height: 22px; border-radius: 6px; }
.rail .tag { padding: 2px 8px 10px 38px; font-size: 11px; color: var(--text-3); }
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail .grp { padding: 14px 8px 4px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.rail nav a {
display: flex; align-items: center; height: 28px; padding: 0 8px; border-radius: var(--r-control);
color: var(--text-2); font-size: 13px; white-space: nowrap; transition: background-color var(--dur), color var(--dur);
}
.rail nav a:hover { background: var(--bg-subtle); color: var(--text-1); text-decoration: none; }
.rail nav a.on { background: var(--bg-selected); color: var(--text-1); font-weight: 500; }
.rail .foot { margin-top: auto; padding: 16px 8px 0; display: flex; flex-direction: column; gap: 10px; }
.rail .foot a { font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.main { min-width: 0; padding: 0 40px 96px; }
.main > * { max-width: 860px; }
.masthead { padding: 44px 0 28px; border-bottom: 1px solid var(--border); }
.eyebrow { font: 500 12px var(--font-mono); color: var(--action-text); }
.masthead h1 { font-size: 30px; line-height: 38px; letter-spacing: -.01em; margin: 10px 0 10px; font-weight: 700; }
.masthead > p { max-width: 64ch; font-size: 14px; line-height: 22px; color: var(--text-2); }
.masthead .notice { margin-top: 20px; }
section { padding: 36px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 8px; }
section:last-child { border-bottom: 0; }
section > h2, details.fold > summary h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
/* 阅读优先级低的节默认折叠,标题一行可点开 */
details.fold > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "展开"; margin-left: auto; font-size: 12px; color: var(--action-text); }
details.fold[open] > summary::after { content: "收起"; }
details.fold > summary:hover h2 { color: var(--action-text); }
.fold-hint { font-size: 13px; color: var(--text-2); }
details.fold > summary + * { margin-top: 12px; }
.lede { max-width: 70ch; margin-top: 6px; font-size: 13px; line-height: 21px; color: var(--text-2); }
.lede + * { margin-top: 20px; }
h3.sub { font-size: 15px; line-height: 22px; font-weight: 600; margin: 32px 0 12px; }
h3.sub:first-of-type { margin-top: 24px; }
/* ---------- 按钮 ---------- */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
height: 32px; padding: 0 14px; border-radius: var(--r-control); border: 1px solid transparent;
font: 500 13px/20px var(--font-sans); cursor: pointer; background: transparent; color: var(--text-1);
text-decoration: none; transition: background-color var(--dur), color var(--dur), scale var(--dur);
}
.btn:hover { text-decoration: none; }
.btn:active { scale: .96; }
.btn.compact { height: 28px; padding: 0 12px; }
.btn.solid { background: var(--action-bg); color: var(--action-fg); font-weight: 600; }
.btn.solid:hover { background: var(--action-hover); }
.btn.neutral { border-color: var(--border-strong); background: var(--bg-card); }
.btn.neutral:hover { background: var(--bg-subtle); }
.btn.copied, .btn.copied:hover { border-color: transparent; background: var(--success-soft); color: var(--success-text); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* ---------- 分段控件(选中项是浮起的白块) ---------- */
.seg { display: inline-flex; align-items: stretch; height: 36px; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg-subtle); max-width: 100%; overflow-x: auto; }
.seg button {
display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 0; border-radius: 7px;
background: transparent; color: var(--text-2); font: 500 13px var(--font-sans); cursor: pointer; white-space: nowrap;
transition: color var(--dur), background-color var(--dur);
}
.seg button:hover { color: var(--text-1); }
.seg button[aria-pressed="true"] { color: var(--text-1); background: var(--bg-card); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg.sm { height: 28px; border-radius: 8px; }
.seg.sm button { padding: 0 10px; border-radius: 5px; font-size: 12px; }
/* ---------- 通知条 ---------- */
.notice { display: flex; align-items: flex-start; gap: 10px; border-radius: var(--r-panel); padding: 10px 14px; font-size: 13px; line-height: 20px; }
.notice > svg { margin-top: 2px; }
.notice .grow { flex: 1; min-width: 0; }
.notice ul { margin: 0; padding-left: 18px; }
.notice li + li { margin-top: 4px; }
.notice code { background: var(--bg-card); }
.notice.neutral { background: var(--bg-subtle); } .notice.neutral > svg { color: var(--text-2); }
.notice.warning { background: var(--warning-soft); } .notice.warning > svg { color: var(--warning-text); }
/* ---------- 卡片 / 徽章 ---------- */
.card { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg-card); padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 9999px; font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.chip.app { border: 1px solid var(--border-strong); color: var(--text-2); }
.chip.app .d { width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--text-3)); }
.chip.action { background: var(--action-soft); color: var(--action-text); }
/* ---------- 表单 ---------- */
.fsec { padding: 20px 0; border-top: 1px solid var(--border); }
.fsec:first-child { padding-top: 0; border-top: 0; }
.fsec > h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.fsec > .hint { margin-bottom: 12px; }
.fsec > h4 + .fields, .fsec > h4 + div > .fields { margin-top: 12px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields > .full { grid-column: 1 / -1; }
.fields + .fields, .fields + div > .fields, div + .fields { margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12px; font-weight: 500; color: var(--text-1); }
.field .opt { font-weight: 400; color: var(--text-3); }
.hint { font-size: 12px; line-height: 18px; color: var(--text-2); }
.hint:empty { display: none; }
.input {
height: 32px; width: 100%; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-control);
background: var(--bg-card); color: var(--text-1); font: 13px var(--font-sans); outline: none;
transition: border-color var(--dur), box-shadow var(--dur);
}
textarea.input { height: auto; min-height: 64px; padding: 8px 10px; line-height: 20px; resize: vertical; }
.input.mono { font-family: var(--font-mono); font-size: 12px; line-height: 18px; }
select.input {
appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888890' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent); }
.subpanel { margin-top: 14px; padding: 14px; border-radius: var(--r-panel); background: var(--bg-sidebar); border: 1px solid var(--border); }
.subpanel > .hint:first-child { margin-bottom: 12px; }
.form-foot { padding-top: 20px; border-top: 1px solid var(--border); }
/* 生成结果 */
.result { margin-top: 16px; padding: 14px; border-radius: var(--r-panel); background: var(--bg-sidebar); border: 1px solid var(--border); }
.result > .label { font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.linkbox {
padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--r-control);
background: var(--bg-card); font: 12px/18px var(--font-mono); color: var(--text-1); word-break: break-all; cursor: text;
max-height: 180px; overflow-y: auto; white-space: pre-wrap;
}
/* ---------- 代码块 ---------- */
.code { margin: 14px 0 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-sidebar); overflow: hidden; }
.code figcaption { padding: 6px 12px; font-size: 11px; line-height: 16px; color: var(--text-3); border-bottom: 1px solid var(--border); }
.code pre { margin: 0; padding: 12px; font: 12px/18px var(--font-mono); color: var(--text-1); white-space: pre-wrap; word-break: break-word; }
.code pre + figcaption { border-top: 1px solid var(--border); }
.code .foot { padding: 8px 12px; font-size: 12px; line-height: 18px; color: var(--text-2); border-top: 1px solid var(--border); }
/* ---------- 示例卡片 ---------- */
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg-card); padding: 16px 18px 18px; transition: border-color var(--dur), box-shadow var(--dur); }
.ex:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ex-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ex-head h3 { font-size: 14px; line-height: 22px; font-weight: 600; }
.ex-desc { margin-top: 6px; color: var(--text-2); line-height: 21px; }
.params { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 10px; margin: 12px 0 0; font-size: 12px; line-height: 20px; }
.params dt { color: var(--text-3); }
.params dd { margin: 0; color: var(--text-1); }
.ex-note { margin-top: 10px; font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: flex-start; }
.ex-note svg { margin-top: 2px; color: var(--warning-text); }
.ex .actions { margin-top: 14px; }
.rules { margin: 14px 0 0; padding-left: 18px; color: var(--text-2); line-height: 21px; max-width: 76ch; }
.rules li + li { margin-top: 6px; }
.rules strong { color: var(--text-1); font-weight: 600; }
/* ---------- 解析结果 ---------- */
.pgroup { margin-top: 16px; }
.pgroup > h4 { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-card); }
.kv dt, .kv dd { margin: 0; padding: 7px 12px; border-top: 1px solid var(--border); font-size: 12px; line-height: 18px; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
.kv dt { color: var(--text-2); background: var(--bg-sidebar); word-break: break-all; }
.kv dd { font-family: var(--font-mono); word-break: break-all; }
.kv dd .plain { font-family: var(--font-sans); }
.kv dd .sub { display: block; color: var(--text-2); }
.flag { font-family: var(--font-sans); color: var(--text-2); margin-left: 6px; }
.flag.danger, .kv dd.danger, .kv dt.danger { color: var(--danger-text); }
.flag.ok { color: var(--success-text); }
.flag.warn, .kv dd.warn, .kv dt.warn { color: var(--warning-text); }
.kv dd > .flag:first-child { margin-left: 0; }
.perror { margin-top: 16px; padding: 10px 14px; border-radius: var(--r-panel); background: var(--danger-soft); color: var(--danger-text); font-size: 13px; }
details.raw { margin-top: 8px; }
details.raw summary { cursor: pointer; font-size: 12px; color: var(--text-2); }
details.raw summary:hover { color: var(--text-1); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid2 .card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.grid2 .card h3 { font-size: 14px; font-weight: 600; }
.faq { margin: 20px 0 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 20px; }
.faq dt { font-weight: 600; }
.faq dd { margin: 0; color: var(--text-2); line-height: 21px; }
/* Toast(照 App 的 sonner 样式) */
#toaster { position: fixed; bottom: 18px; left: 50%; translate: -50% 0; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px 10px 12px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg-card); color: var(--text-1); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 20px; animation: tin 200ms cubic-bezier(.4, 0, .2, 1); pointer-events: auto; }
.toast > svg { margin-top: 2px; color: var(--danger); }
.toast.info > svg { color: var(--text-2); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 860px) {
.shell { display: block; }
.rail {
position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 8px;
padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto;
}
.brand span, .rail .tag, .rail .grp, .rail .foot a { display: none; }
.brand { padding: 0; }
.rail nav { flex-direction: row; }
.rail .foot { margin: 0 0 0 auto; padding: 0; }
.main { padding: 0 16px 72px; }
section { scroll-margin-top: 56px; }
.masthead { padding-top: 28px; }
.masthead h1 { font-size: 24px; line-height: 32px; }
.fields, .fields.three, .grid2 { grid-template-columns: minmax(0, 1fr); }
.kv { grid-template-columns: 110px minmax(0, 1fr); }
.faq { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.faq dd { margin-bottom: 10px; }
}
</style>
</head>
<body>
<svg width="0" height="0" style="position: absolute" aria-hidden="true">
<symbol id="i-copy" viewBox="0 0 24 24"><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></symbol>
<symbol id="i-check" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5" /></symbol>
<symbol id="i-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" /><path d="M12 16v-4" /><path d="M12 8h.01" /></symbol>
<symbol id="i-alert" viewBox="0 0 24 24"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /><path d="M12 9v4" /><path d="M12 17h.01" /></symbol>
<symbol id="i-x" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" /><path d="m15 9-6 6" /><path d="m9 9 6 6" /></symbol>
<symbol id="i-import" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><path d="m7 10 5 5 5-5" /><path d="M12 15V3" /></symbol>
<symbol id="i-external" viewBox="0 0 24 24"><path d="M15 3h6v6" /><path d="M10 14 21 3" /><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /></symbol>
</svg>
<div class="shell">
<aside class="rail">
<div class="brand"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAXaklEQVR42u1bCXxU5bX/vrvOPpnsIQtZWMISCZGwhE0WsahoKfhetYpbWvC1fW1d+tRX2me171WrtHUvyhO09FmrFsXWBVlECSC7QFhCSCCE7MnMZNa7vnPuvRO2YIOE/n79lfkxzOTeO3e+s/3P/5zzDUf+yR/cZQVcVsBlBVxWwGUFXFbAP++DvWR3pvBgGEPB8MpQeIG3+t9cEENZCh/GG3DwXu/DZy5qmZdKdh0evRxn4LD2JZ/r9TyoA+53aRTBXirhOZ5nR9/yzYeuvOXmX2SVjJzaXlOzWYpEQyhkb57AWMLPGp5x1XO3jF1+24T82/KS7QP2NPh3xhVNZlAJ/wAeYLg5uDyZ9bPFHxVOmHB1PBQigstFTn6x5/N3f/zQOKKd6wAgPNVA+pwke/qOxdfWJzls9pisEo9DIGv3n9g46zfrpmq6cXPa3yHB9Kv0EOv4ml48dFxuWdnVofZ2SZHiS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8ALCo8lum8A98WrH48Mqd+YU371nyPvbA+v6OiZnLmI/nH56l7X8ztufc6ampMM+IBmLMNxQARNh3t9w/MimF5febW2EGgLWs+pB0wMa/NHato54tO34iR0D7FHipiHNQWOqTVTJ9FGeKYluAQqERQ6k2BuCkWi3yHM87CiJQSbmgfaS/SeDNQfrpcbmLrnzQvYIMBe7LxZdnLfbRNgIORO2wiL9MgsOoxWmk6rnXrhZisXjLrvgyPM5CiVs4zOY9IyePznaHtyHt9q+q3FdmhghdhrX7RxkPOgaTylxTzV3iEArFASCGoM/2h49WfnqlhsF4IgZHpvNCTPlh/+88z/WHmzbgDUIpb13fy/NdvmebS+xOAxJf1/yjbk/jHR2sUjAHD4f3bz0pftaDh42NjnlePnMdI99APAGkqCp4MZkX2NwD57fsr9zHVEGEJHVDYaHoVRSaC9LT+J9rX65CwXD4Sha94P9LetnLllbUpbru2prfccnuxoCe41w+Ar7A7h+2BpqgMyWl5b9CEbioaFfm/UAesT+1atf3P/O6iWwbZCHKknO9bnyMJd3A2FhjUYFYfwRKXyoJVSDn991JLznZFv0eFaKkAdK0qAHrfq8fMrIfPuwdbvlKlQY8gBjmxwo/fP6rn34TOwdvNCdIf33gwlrXI6v219bufjwmo9/B7Hv6qw/dtA6bygoJMldPBbu0CoAJhkH/mQ76e9uPN4ROcHglriwGt12OLzlxun2vHinGhN4xk4EBidQsbMah0Y6Ngsdc3jzVYXvv62yp/YMsMHmlhOG8OaOkUQ80s21nXte31q7PN0lMKlu0ZZkZ8krVbXPYsOAY8x9fS+sbn4eB3ruZMEhOhm6fFXT7z7dZ4y18D7a2cQMq84+DW7/nj+YsLbKJLbInvODB+wcjSnwlW+u7dgOsfxRor2fsObUEueV5UNcFZsPhDdvqg5tv9Q/mLgkvxg5zxdR/SxXPluwhBJO//vsdPsPq4AzfxNkzup6i10ssbGjq5uxrf0dDEMu/2zusgL+iR//D9n3iOKzh/I8AAAAAElFTkSuQmCC" alt=""><span>CC Switch</span></div>
<div class="tag">深链接工具</div>
<nav>
<div class="grp">工具</div>
<a href="#generator">生成器</a>
<a href="#parser">解析器</a>
<a href="#base64">Base64 编解码</a>
<div class="grp">示例</div>
<a href="#ex-provider">供应商</a>
<a href="#ex-usage">用量查询脚本</a>
<a href="#ex-mcp">MCP</a>
<a href="#ex-prompt">提示词</a>
<a href="#ex-skill">Skill 仓库</a>
<div class="grp">帮助</div>
<a href="#faq">常见问题</a>
</nav>
<div class="foot">
<div class="seg sm" id="themeSeg" role="group" aria-label="外观">
<button type="button" data-theme-value="system" aria-pressed="true">自动</button>
<button type="button" data-theme-value="light" aria-pressed="false">浅色</button>
<button type="button" data-theme-value="dark" aria-pressed="false">深色</button>
</div>
<a href="https://github.com/farion1231/cc-switch/blob/main/docs/guides/deeplink-site-integration-guide-zh.md" target="_blank" rel="noopener">站长接入指南<svg class="i sm"><use href="#i-external" /></svg></a>
</div>
</aside>
<main class="main">
<header class="masthead" id="top">
<div class="eyebrow">ccswitch://v1/import</div>
<h1>深链接生成器</h1>
<p>生成 CC Switch 的导入链接:用户点一下,就能把供应商、MCP、提示词或 Skill 仓库导入 CC Switch。也可以把收到的链接贴进解析器,看看里面写了什么。</p>
<div class="notice neutral">
<svg class="i"><use href="#i-info" /></svg>
<div class="grow">
<ul>
<li>本页按 <strong>CC Switch v4.0.10</strong> 的规则生成链接。<code>apiFormat</code>、<code>iconUrl</code> 参数和 <code>app=pi</code> 需要 v4.0.10 及以上:更早的版本会忽略 <code>apiFormat</code>(一律用应用的默认格式)和 <code>iconUrl</code>,并拒绝导入 Pi 供应商。</li>
<li>「导入后立即切换 / 添加 / 启用」由用户在确认框里的开关决定,链接里的 <code>enabled</code> 只是开关的初始值,一般不用写。</li>
<li>完整说明见 <a href="https://github.com/farion1231/cc-switch/blob/main/docs/guides/deeplink-site-integration-guide-zh.md" target="_blank" rel="noopener">站长深链接接入指南</a>。示例里的域名和 Key 都是假的,导入后无法实际使用。</li>
</ul>
</div>
</div>
</header>
<!-- 生成器 -->
<section id="generator">
<h2>生成器</h2>
<p class="lede">填好表单生成链接。点「在 CC Switch 中打开」可以在本机直接试导入。</p>
<div class="seg" id="genSeg" role="tablist" aria-label="资源类型">
<button type="button" data-panel="gen-provider" aria-pressed="true">供应商</button>
<button type="button" data-panel="gen-mcp" aria-pressed="false">MCP</button>
<button type="button" data-panel="gen-prompt" aria-pressed="false">提示词</button>
<button type="button" data-panel="gen-skill" aria-pressed="false">Skill 仓库</button>
</div>
<!-- 供应商生成器 -->
<div class="card gen-panel" id="gen-provider" data-generate="generateLink" style="margin-top: 16px;">
<div class="fsec">
<h4>基本信息</h4>
<div class="fields">
<div class="field">
<label for="app">应用</label>
<select class="input" id="app" onchange="updateModelFields()">
<option value="claude">Claude Code</option>
<option value="codex">Codex</option>
<option value="gemini">Gemini CLI</option>
<option value="grokbuild">Grok Build</option>
<option value="opencode">OpenCode</option>
<option value="openclaw">OpenClaw</option>
<option value="hermes">Hermes</option>
<option value="pi">Pi</option>
</select>
<span class="hint">Claude Desktop、MiniMax Code 的供应商暂不支持深链接导入</span>
</div>
<div class="field">
<label for="apiFormat">接口格式 <span class="opt">apiFormat</span></label>
<select class="input" id="apiFormat"></select>
<span class="hint" id="apiFormatHint"></span>
</div>
<div class="field full">
<label for="name">供应商名称</label>
<input class="input" type="text" id="name" placeholder="例如:Example AI">
<span class="hint">必填。地址和 API Key 也必须给出,写在 URL 参数或配置文件里都行。</span>
</div>
<div class="field full">
<span class="label">填写方式</span>
<div>
<div class="seg sm" id="modeSeg" role="group" aria-label="填写方式">
<button type="button" data-mode="url" aria-pressed="true">URL 参数</button>
<button type="button" data-mode="config" aria-pressed="false">配置文件</button>
</div>
</div>
<input type="hidden" id="importMode" value="url">
<span class="hint">URL 参数:地址、Key 直接写在链接里。配置文件:放一份 Base64 编码的 JSON 或 TOML,适合要带额外设置的情况。</span>
</div>
</div>
</div>
<div class="fsec">
<h4>连接</h4>
<!-- URL 参数模式 -->
<div id="urlModeFields">
<div class="fields">
<div class="field full">
<label for="endpoint">API 地址</label>
<input class="input" type="url" id="endpoint" placeholder="https://api.example.com/v1">
<span class="hint">Anthropic 格式在 Claude Code 里不带 /v1,OpenAI 两种格式一般带 /v1;OpenCode、OpenClaw、Hermes、Pi 以在该应用里实测能通的写法为准。</span>
</div>
<div class="field full">
<label for="apiKey">API Key</label>
<input class="input" type="text" id="apiKey" placeholder="sk-xxxxx 或 AIzaSyXXXXX">
</div>
<div class="field">
<label for="extraEndpoints">备用地址 <span class="opt">可选,逗号分隔</span></label>
<input class="input" type="text" id="extraEndpoints" placeholder="https://api2.example.com/v1, …">
<span class="hint">导入后加为自定义端点</span>
</div>
<div class="field">
<label for="homepage">官网 <span class="opt">可选</span></label>
<input class="input" type="url" id="homepage" placeholder="https://example.com">
</div>
</div>
</div>
<!-- 配置文件模式 -->
<div id="configModeFields" style="display: none;">
<div id="generalConfigGroup">
<div class="field">
<label for="configJson" id="configJsonLabel">配置文件(JSON)</label>
<textarea class="input mono" id="configJson" rows="10"></textarea>
<span class="hint">生成时自动 Base64 编码</span>
</div>
</div>
<!-- Codex / Grok Build 的 TOML 配置 -->
<div id="codexConfigGroup" style="display: none;">
<div id="codexAuthGroup" style="margin-bottom: 14px;">
<div class="field">
<label for="codexAuthJson">认证信息(JSON)</label>
<textarea class="input mono" id="codexAuthJson" rows="5"></textarea>
<span class="hint">包含 API Key 的认证信息对象</span>
</div>
</div>
<div class="field">
<label for="codexConfigToml" id="tomlConfigLabel">Codex 配置文件 (TOML)</label>
<textarea class="input mono" id="codexConfigToml" rows="10"></textarea>
<span class="hint" id="tomlConfigHint">config.toml 的原始内容。只收选中的那张 [model_providers.<id>] 表和顶层的模型相关字段</span>
</div>
</div>
<div class="subpanel">
<p class="hint">用 URL 参数覆盖配置文件里的 Key 和地址。留空就完全用配置文件;两边都有时以 URL 参数为准。</p>
<div class="fields">
<div class="field">
<label for="overrideApiKey">API Key <span class="opt">可选</span></label>
<input class="input" type="text" id="overrideApiKey" placeholder="覆盖配置文件中的 Key">
</div>
<div class="field">
<label for="overrideEndpoint">API 地址 <span class="opt">可选</span></label>
<input class="input" type="url" id="overrideEndpoint" placeholder="覆盖配置文件中的地址">
</div>
</div>
</div>
</div>
</div>
<div class="fsec">
<h4>模型</h4>
<div class="fields">
<div class="field full">
<label for="model" id="modelLabel">默认模型(可选)</label>
<input class="input" type="text" id="model" placeholder="例如:example-chat">
<span class="hint" id="modelHint"></span>
</div>
</div>
<div id="claudeFields">
<div class="subpanel">
<p class="hint">Claude Code 三档模型。中转站提供的是原版 Claude 模型时全部留空,Claude Code 会用自带的模型列表;只有 DeepSeek、Kimi 这类非原生模型才需要写上。</p>
<div class="fields three">
<div class="field">
<label for="haikuModel">Haiku</label>
<input class="input" type="text" id="haikuModel" placeholder="example-fast">
<span class="hint"><code>ANTHROPIC_DEFAULT_HAIKU_MODEL</code></span>
</div>
<div class="field">
<label for="sonnetModel">Sonnet</label>
<input class="input" type="text" id="sonnetModel" placeholder="example-chat">
<span class="hint"><code>ANTHROPIC_DEFAULT_SONNET_MODEL</code></span>
</div>
<div class="field">
<label for="opusModel">Opus</label>
<input class="input" type="text" id="opusModel" placeholder="example-pro">
<span class="hint"><code>ANTHROPIC_DEFAULT_OPUS_MODEL</code></span>
</div>
</div>
</div>
</div>
</div>
<div class="fsec">
<h4>展示与确认</h4>
<div class="fields">
<div class="field">
<label for="icon">图标 <span class="opt">可选</span></label>
<input class="input" type="text" id="icon" placeholder="例如:openai、anthropic、google">
<span class="hint">CC Switch 内置的图标名,只能是小写字母、数字和 . _ -</span>
</div>
<div class="field">
<label for="iconUrl">自己的图标 <span class="opt">iconUrl</span></label>
<input class="input" type="url" id="iconUrl" placeholder="https://example.com/logo.png">
<span class="hint">内置图标里没有你的品牌时用。下载失败退回上面的内置图标</span>
</div>
<p class="hint full">iconUrl 要求:https、域名(不能是 IP)、默认端口;公开可访问(不带 Cookie 和 Referer);5 秒内下完、不超过 256 KB;<code>Content-Type</code> 是 PNG、JPEG、WebP 或 SVG 且与文件一致。建议用方形图。</p>
<div class="field">
<label for="enabled">确认框开关的初始值 <span class="opt">enabled</span></label>
<select class="input" id="enabled">
<option value="">不指定(推荐,按应用默认)</option>
<option value="true">打开</option>
<option value="false">关闭</option>
</select>
</div>
<p class="hint full">确认框里有「导入后立即切换 / 添加到应用配置」开关,用户可以改。Claude Code、Codex、Gemini CLI、Grok Build 默认关闭;OpenCode、OpenClaw、Hermes、Pi 默认打开。</p>
<div class="field full">
<label for="notes">备注 <span class="opt">可选</span></label>
<textarea class="input" id="notes" rows="2" placeholder="例如:公司专用账号"></textarea>
</div>
</div>
</div>
<div class="fsec">
<h4>用量查询 <span class="opt" style="font-weight: 400; color: var(--text-3);">可选</span></h4>
<p class="hint">带上查询脚本,导入后供应商卡片上会直接显示余额。写法见下方<a href="#ex-usage">用量查询脚本示例</a>。</p>
<div class="fields">
<div class="field full">
<span class="label">查询脚本</span>
<div class="actions">
<button type="button" class="btn neutral compact" onclick="fillUsageTemplate('generic')">填入通用余额模板</button>
<button type="button" class="btn neutral compact" onclick="fillUsageTemplate('newapi')">填入 NewAPI 模板</button>
<button type="button" class="btn neutral compact" onclick="fillUsageTemplate('sub2api')">填入 Sub2API 模板</button>
</div>
<textarea class="input mono" id="usageScript" rows="10" placeholder="点上面的按钮填入模板,或者粘贴自己的脚本"></textarea>
<span class="hint">占位符:<code>{{baseUrl}}</code> <code>{{apiKey}}</code> <code>{{accessToken}}</code> <code>{{userId}}</code></span>
</div>
<div class="field">
<label for="usageEnabled">启用用量查询</label>
<select class="input" id="usageEnabled">
<option value="">不指定(带脚本即启用)</option>
<option value="true">启用</option>
<option value="false">禁用</option>
</select>
</div>
<div class="field">
<label for="usageAutoInterval">自动查询间隔(分钟)</label>
<input class="input" type="number" id="usageAutoInterval" placeholder="30" min="0">
<span class="hint">0 表示不自动查询</span>
</div>
<div class="field">
<label for="usageBaseUrl">查询地址 <span class="opt">usageBaseUrl</span></label>
<input class="input" type="url" id="usageBaseUrl" placeholder="不填就用供应商地址">
<span class="hint">脚本里的请求必须与它同源</span>
</div>
<div class="field">
<label for="usageApiKey">查询专用 Key <span class="opt">可选</span></label>
<input class="input" type="text" id="usageApiKey" placeholder="不填就用供应商的 Key">
</div>
<div class="field">
<label for="usageAccessToken">Access Token <span class="opt">可选</span></label>
<input class="input" type="text" id="usageAccessToken" placeholder="某些接口需要的访问令牌">
</div>
<div class="field">
<label for="usageUserId">User ID <span class="opt">可选</span></label>
<input class="input" type="text" id="usageUserId" placeholder="某些接口需要的用户 ID">
</div>
</div>
</div>
<div class="form-foot">
<button type="button" class="btn solid" onclick="generateLink()">生成链接</button>
<div id="result" class="result" style="display: none;">
<div class="label">深链接</div>
<div class="linkbox" id="linkText" onclick="selectText(this)"></div>
<div class="actions">
<a id="testLink" class="btn solid compact"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" onclick="copyText(document.getElementById('linkText').textContent, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</div>
</div>
</div>
<!-- MCP 生成器 -->
<div class="card gen-panel" id="gen-mcp" data-generate="generateMcpLink" style="margin-top: 16px; display: none;">
<div class="fsec">
<div class="fields">
<div class="field full">
<label for="mcpApps">目标应用</label>
<input class="input" type="text" id="mcpApps" placeholder="例如:claude,codex">
<span class="hint">多个应用用逗号分隔。可选值:claude、codex、gemini、grokbuild、opencode、hermes、pi、mcode(openclaw 会被忽略)</span>
</div>
<div class="field full">
<label for="mcpConfig">MCP 配置(JSON)</label>
<textarea class="input mono" id="mcpConfig" rows="9" placeholder='{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-xxx"],
"type": "stdio"
}
}
}'></textarea>
<span class="hint">导入即写入所选应用的配置文件;已存在同 ID 的服务器只勾上新的应用,不覆盖配置。</span>
</div>
</div>
</div>
<div class="form-foot">
<button type="button" class="btn solid" onclick="generateMcpLink()">生成链接</button>
<div id="mcpResult" class="result" style="display: none;">
<div class="label">深链接</div>
<div class="linkbox" id="mcpUrl" onclick="selectText(this)"></div>
<div class="actions">
<a id="mcpImportBtn" class="btn solid compact"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" onclick="copyText(document.getElementById('mcpUrl').textContent, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</div>
</div>
</div>
<!-- 提示词生成器 -->
<div class="card gen-panel" id="gen-prompt" data-generate="generatePromptLink" style="margin-top: 16px; display: none;">
<div class="fsec">
<div class="fields">
<div class="field">
<label for="promptApp">目标应用</label>
<select class="input" id="promptApp">
<option value="claude">Claude Code</option>
<option value="codex">Codex</option>
<option value="gemini">Gemini CLI</option>
<option value="grokbuild">Grok Build</option>
<option value="opencode">OpenCode</option>
<option value="pi">Pi</option>
<option value="mcode">MiniMax Code</option>
</select>
<span class="hint">OpenClaw、Hermes 的提示词由工作区编辑器和记忆管理负责,不建议用深链接分发</span>
</div>
<div class="field">
<label for="promptName">名称</label>
<input class="input" type="text" id="promptName" placeholder="例如:代码审查专家">
</div>
<div class="field full">
<label for="promptContent">内容</label>
<textarea class="input" id="promptContent" rows="7" placeholder="# 角色定义
你是一位专业的…"></textarea>
<span class="hint">Markdown,生成时自动 Base64 编码</span>
</div>
<div class="field">
<label for="promptDescription">描述 <span class="opt">可选</span></label>
<input class="input" type="text" id="promptDescription" placeholder="例如:专注代码质量">
</div>
<div class="field">
<label for="promptEnabled">「导入后立即启用」的初始值</label>
<select class="input" id="promptEnabled">
<option value="">不指定(开关默认关闭,推荐)</option>
<option value="true">打开(确认后替换当前的提示词文件)</option>
</select>
<span class="hint">用户可以在确认框里改</span>
</div>
</div>
</div>
<div class="form-foot">
<button type="button" class="btn solid" onclick="generatePromptLink()">生成链接</button>
<div id="promptResult" class="result" style="display: none;">
<div class="label">深链接</div>
<div class="linkbox" id="promptUrl" onclick="selectText(this)"></div>
<div class="actions">
<a id="promptImportBtn" class="btn solid compact"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" onclick="copyText(document.getElementById('promptUrl').textContent, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</div>
</div>
</div>
<!-- Skill 生成器 -->
<div class="card gen-panel" id="gen-skill" data-generate="generateSkillLink" style="margin-top: 16px; display: none;">
<div class="fsec">
<div class="fields">
<div class="field">
<label for="skillRepo">GitHub 仓库</label>
<input class="input" type="text" id="skillRepo" placeholder="owner/repo-name">
<span class="hint">必须是 GitHub 上的公开仓库</span>
</div>
<div class="field">
<label for="skillBranch">分支</label>
<input class="input" type="text" id="skillBranch" placeholder="main" value="main">
</div>
<p class="hint full">添加的是仓库,用户还要在 Skills 管理界面自己选择安装哪些 Skill。</p>
</div>
</div>
<div class="form-foot">
<button type="button" class="btn solid" onclick="generateSkillLink()">生成链接</button>
<div id="skillResult" class="result" style="display: none;">
<div class="label">深链接</div>
<div class="linkbox" id="skillUrl" onclick="selectText(this)"></div>
<div class="actions">
<a id="skillImportBtn" class="btn solid compact"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" onclick="copyText(document.getElementById('skillUrl').textContent, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</div>
</div>
</div>
</section>
<!-- 解析器 -->
<section id="parser">
<h2>解析器</h2>
<p class="lede">贴一条 <code>ccswitch://</code> 链接,查看它会导入什么。会被 CC Switch 拒绝或忽略的参数会标出来。</p>
<div class="card" data-generate="parseDeepLink">
<div class="field">
<label for="parseUrl">深链接</label>
<textarea class="input mono" id="parseUrl" rows="3" placeholder="ccswitch://v1/import?resource=provider&app=claude&…"></textarea>
</div>
<div class="actions" style="margin-top: 12px;">
<button type="button" class="btn solid" onclick="parseDeepLink()">解析</button>
</div>
<div id="parseResult" style="display: none;">
<div id="parseBasicInfo"></div>
<div id="parseUrlParams"></div>
<div id="parseConfigContent"></div>
</div>
</div>
</section>
<!-- Base64 -->
<section id="base64">
<details class="fold">
<summary><h2>Base64 编解码</h2><span class="fold-hint">生成器会自动编码;手动检查链接里的配置时再用</span></summary>
<p class="lede">按 UTF-8 编码,中文没问题。编码结果可以直接放进链接的 <code>config</code> 或 <code>content</code> 参数(生成器会自动做这一步);解码用来检查链接里的配置对不对。</p>
<div class="grid2">
<div class="card">
<h3>编码</h3>
<textarea class="input mono" id="encodeInput" rows="6" placeholder="输入要编码的文本,JSON、TOML、Markdown 都可以"></textarea>
<div class="actions"><button type="button" class="btn neutral" onclick="encodeToBase64()">编码为 Base64</button></div>
<div id="encodeResult" style="display: none;">
<div class="linkbox" id="encodeOutput"></div>
<div class="actions">
<button type="button" class="btn neutral compact" onclick="copyText(document.getElementById('encodeOutput').textContent, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制结果</span></button>
</div>
</div>
</div>
<div class="card">
<h3>解码</h3>
<textarea class="input mono" id="decodeInput" rows="6" placeholder="粘贴 Base64,例如 eyJlbnYiOnsiaGVsbG8iOiJ3b3JsZCJ9fQ=="></textarea>
<div class="actions"><button type="button" class="btn neutral" onclick="decodeFromBase64()">解码为文本</button></div>
<div id="decodeResult" style="display: none;">
<div class="linkbox" id="decodeOutput"></div>
<div class="actions">
<button type="button" class="btn neutral compact" onclick="copyText(document.getElementById('decodeOutput').textContent, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制结果</span></button>
<span id="jsonFormat" style="display: none;"><button type="button" class="btn neutral compact" onclick="formatJson()">格式化 JSON</button></span>
</div>
</div>
</div>
</div>
</details>
</section>
<!-- 供应商示例 -->
<section id="ex-provider">
<h2>供应商示例</h2>
<p class="lede">每条都能直接点开试导入。链接都按规则做过 URL 转义,可以照着改。</p>
<div class="ex-list">
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-claude)"><i class="d"></i>Claude Code</span><h3>完整 JSON 配置(非原生模型)</h3></div>
<p class="ex-desc">通过 Base64 编码的 JSON 配置导入。中转站提供的是原版 Claude 模型时,模型字段全部留空即可;只有 DeepSeek、Kimi 这类非原生模型才需要像这样写上四档模型。</p>
<dl class="params">
<dt>必需</dt><dd><code>resource=provider</code> <code>app=claude</code> <code>name</code>,地址和 Key(URL 参数或 config 里)</dd>
<dt>可选</dt><dd><code>config</code>(Base64 JSON)<code>configFormat=json</code></dd>
</dl>
<figure class="code">
<figcaption>解码后的 config</figcaption>
<pre>{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-test-key123",
"ANTHROPIC_BASE_URL": "https://api.example.com",
"ANTHROPIC_MODEL": "example-chat",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "example-fast",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "example-chat",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "example-pro"
}
}</pre>
</figure>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=claude&name=Example%20AI&configFormat=json&config=eyJlbnYiOnsiQU5USFJPUElDX0FVVEhfVE9LRU4iOiJzay10ZXN0LWtleTEyMyIsIkFOVEhST1BJQ19CQVNFX1VSTCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tIiwiQU5USFJPUElDX01PREVMIjoiZXhhbXBsZS1jaGF0IiwiQU5USFJPUElDX0RFRkFVTFRfSEFJS1VfTU9ERUwiOiJleGFtcGxlLWZhc3QiLCJBTlRIUk9QSUNfREVGQVVMVF9TT05ORVRfTU9ERUwiOiJleGFtcGxlLWNoYXQiLCJBTlRIUk9QSUNfREVGQVVMVF9PUFVTX01PREVMIjoiZXhhbXBsZS1wcm8ifX0%3D"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=claude&name=Example%20AI&configFormat=json&config=eyJlbnYiOnsiQU5USFJPUElDX0FVVEhfVE9LRU4iOiJzay10ZXN0LWtleTEyMyIsIkFOVEhST1BJQ19CQVNFX1VSTCI6Imh0dHBzOi8vYXBpLmV4YW1wbGUuY29tIiwiQU5USFJPUElDX01PREVMIjoiZXhhbXBsZS1jaGF0IiwiQU5USFJPUElDX0RFRkFVTFRfSEFJS1VfTU9ERUwiOiJleGFtcGxlLWZhc3QiLCJBTlRIUk9QSUNfREVGQVVMVF9TT05ORVRfTU9ERUwiOiJleGFtcGxlLWNoYXQiLCJBTlRIUk9QSUNfREVGQVVMVF9PUFVTX01PREVMIjoiZXhhbXBsZS1wcm8ifX0%3D" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-claude)"><i class="d"></i>Claude Code</span><h3>配置文件 + URL 参数覆盖</h3></div>
<p class="ex-desc">配置文件放地址和额外的环境变量,Key 用 URL 参数给出。两边都有时以 URL 参数为准。</p>
<dl class="params">
<dt>必需</dt><dd><code>name</code> <code>config</code></dd>
<dt>可选</dt><dd><code>apiKey</code>(覆盖配置文件里的值)</dd>
</dl>
<figure class="code">
<figcaption>解码后的 config</figcaption>
<pre>{
"env": {
"ANTHROPIC_BASE_URL": "https://api.example.com",
"API_TIMEOUT_MS": "600000"
}
}</pre>
<div class="foot">URL 参数:<code>apiKey=sk-test-key123</code></div>
</figure>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=claude&name=Example%20AI&apiKey=sk-test-key123&configFormat=json&config=eyJlbnYiOnsiQU5USFJPUElDX0JBU0VfVVJMIjoiaHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20iLCJBUElfVElNRU9VVF9NUyI6IjYwMDAwMCJ9fQ%3D%3D"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=claude&name=Example%20AI&apiKey=sk-test-key123&configFormat=json&config=eyJlbnYiOnsiQU5USFJPUElDX0JBU0VfVVJMIjoiaHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20iLCJBUElfVElNRU9VVF9NUyI6IjYwMDAwMCJ9fQ%3D%3D" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-codex)"><i class="d"></i>Codex</span><h3>附带 config.toml</h3></div>
<p class="ex-desc">Codex 的 config 是 <code>{"auth": {...}, "config": "<config.toml 原文>"}</code>。CC Switch 只收选中的那张 <code>[model_providers.<id>]</code> 表和顶层的模型相关字段,导入后表名统一改成 <code>custom</code>。</p>
<dl class="params">
<dt>必需</dt><dd><code>name</code> <code>config</code></dd>
<dt>可选</dt><dd><code>configFormat=json</code>(也可以用 <code>configFormat=toml</code> 直接放 config.toml 原文)</dd>
</dl>
<figure class="code">
<figcaption>auth</figcaption>
<pre>{
"OPENAI_API_KEY": "sk-test-key123"
}</pre>
<figcaption>config(TOML)</figcaption>
<pre>model_provider = "example"
model = "example-coder"
[model_providers.example]
name = "Example AI"
base_url = "https://api.example.com/v1"
wire_api = "responses"</pre>
</figure>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=codex&name=Example%20AI&configFormat=json&config=eyJhdXRoIjp7Ik9QRU5BSV9BUElfS0VZIjoic2stdGVzdC1rZXkxMjMifSwiY29uZmlnIjoibW9kZWxfcHJvdmlkZXIgPSBcImV4YW1wbGVcIlxubW9kZWwgPSBcImV4YW1wbGUtY29kZXJcIlxuXG5bbW9kZWxfcHJvdmlkZXJzLmV4YW1wbGVdXG5uYW1lID0gXCJFeGFtcGxlIEFJXCJcbmJhc2VfdXJsID0gXCJodHRwczovL2FwaS5leGFtcGxlLmNvbS92MVwiXG53aXJlX2FwaSA9IFwicmVzcG9uc2VzXCIifQ%3D%3D"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=codex&name=Example%20AI&configFormat=json&config=eyJhdXRoIjp7Ik9QRU5BSV9BUElfS0VZIjoic2stdGVzdC1rZXkxMjMifSwiY29uZmlnIjoibW9kZWxfcHJvdmlkZXIgPSBcImV4YW1wbGVcIlxubW9kZWwgPSBcImV4YW1wbGUtY29kZXJcIlxuXG5bbW9kZWxfcHJvdmlkZXJzLmV4YW1wbGVdXG5uYW1lID0gXCJFeGFtcGxlIEFJXCJcbmJhc2VfdXJsID0gXCJodHRwczovL2FwaS5leGFtcGxlLmNvbS92MVwiXG53aXJlX2FwaSA9IFwicmVzcG9uc2VzXCIifQ%3D%3D" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-gemini)"><i class="d"></i>Gemini CLI</span><h3>Gemini 配置</h3></div>
<p class="ex-desc">Gemini 的 config 是扁平的键值对,只读 <code>GEMINI_API_KEY</code>、<code>GOOGLE_GEMINI_BASE_URL</code>、<code>GEMINI_MODEL</code> 三个键。</p>
<dl class="params">
<dt>必需</dt><dd><code>name</code> <code>config</code></dd>
<dt>可选</dt><dd><code>configFormat=json</code></dd>
</dl>
<figure class="code">
<figcaption>解码后的 config</figcaption>
<pre>{
"GEMINI_API_KEY": "AIzaSy-test-key123",
"GOOGLE_GEMINI_BASE_URL": "https://api.example.com"
}</pre>
</figure>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=gemini&name=Example%20Gemini&configFormat=json&config=eyJHRU1JTklfQVBJX0tFWSI6IkFJemFTeS10ZXN0LWtleTEyMyIsIkdPT0dMRV9HRU1JTklfQkFTRV9VUkwiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSJ9"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=gemini&name=Example%20Gemini&configFormat=json&config=eyJHRU1JTklfQVBJX0tFWSI6IkFJemFTeS10ZXN0LWtleTEyMyIsIkdPT0dMRV9HRU1JTklfQkFTRV9VUkwiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSJ9" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-opencode)"><i class="d"></i>OpenCode</span><h3>用 apiFormat 声明 Anthropic 格式</h3></div>
<p class="ex-desc">OpenCode、OpenClaw、Hermes、Pi 自己支持多种接口格式,<code>apiFormat</code> 会换算成它们配置里的协议字段,客户端直接用这种格式请求接口。不写时用 OpenAI Chat Completions。</p>
<dl class="params">
<dt>必需</dt><dd><code>name</code> <code>endpoint</code> <code>apiKey</code></dd>
<dt>可选</dt><dd><code>apiFormat</code> <code>model</code>(OpenCode / OpenClaw / Hermes 不写就没有可选的模型)</dd>
</dl>
<figure class="code">
<figcaption>链接参数</figcaption>
<pre>app=opencode
endpoint=https://api.example.com/v1
apiFormat=anthropic → OpenCode 的 npm = @ai-sdk/anthropic
model=example-chat</pre>
</figure>
<p class="ex-note"><svg class="i sm"><use href="#i-alert" /></svg><span>需要 v4.0.10 及以上。更早的版本会忽略 apiFormat,按 Chat Completions 导入。</span></p>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=opencode&name=Example%20AI&endpoint=https%3A%2F%2Fapi.example.com%2Fv1&apiKey=sk-test-key123&apiFormat=anthropic&model=example-chat"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=opencode&name=Example%20AI&endpoint=https%3A%2F%2Fapi.example.com%2Fv1&apiKey=sk-test-key123&apiFormat=anthropic&model=example-chat" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-pi)"><i class="d"></i>Pi</span><h3>Pi 供应商(必须写模型)</h3></div>
<p class="ex-desc">Pi 的供应商节点必须带模型,链接里没写 <code>model</code> 会被拒绝。<code>apiFormat</code> 换算成 Pi 的 <code>api</code> 字段。</p>
<dl class="params">
<dt>必需</dt><dd><code>name</code> <code>endpoint</code> <code>apiKey</code> <code>model</code></dd>
<dt>可选</dt><dd><code>apiFormat</code></dd>
</dl>
<figure class="code">
<figcaption>链接参数</figcaption>
<pre>app=pi
endpoint=https://api.example.com/v1
apiFormat=openai_chat → Pi 的 api = openai-completions
model=example-chat</pre>
</figure>
<p class="ex-note"><svg class="i sm"><use href="#i-alert" /></svg><span>需要 v4.0.10 及以上,更早的版本会拒绝导入。</span></p>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=pi&name=Example%20AI&endpoint=https%3A%2F%2Fapi.example.com%2Fv1&apiKey=sk-test-key123&apiFormat=openai_chat&model=example-chat"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=pi&name=Example%20AI&endpoint=https%3A%2F%2Fapi.example.com%2Fv1&apiKey=sk-test-key123&apiFormat=openai_chat&model=example-chat" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-claude)"><i class="d"></i>Claude Code</span><h3>带上自己的图标</h3></div>
<p class="ex-desc">内置图标里没有你的品牌时,用 <code>iconUrl</code> 给一个图片地址。确认框一打开就下载,导入后作为卡片图标;下载失败时退回 <code>icon</code>,没写 <code>icon</code> 就显示名称首字母。这条示例借用 CC Switch 自己的图标。</p>
<dl class="params">
<dt>必需</dt><dd><code>name</code> <code>endpoint</code> <code>apiKey</code></dd>
<dt>可选</dt><dd><code>iconUrl</code> <code>icon</code>(下载失败时的退路)</dd>
</dl>
<figure class="code">
<figcaption>链接参数</figcaption>
<pre>iconUrl=https://raw.githubusercontent.com/farion1231/cc-switch/main/src-tauri/icons/128x128.png</pre>
</figure>
<p class="ex-note"><svg class="i sm"><use href="#i-alert" /></svg><span>需要 v4.0.10 及以上,更早的版本会忽略 iconUrl。图片会被重新画成 96×96 的 PNG 存进 CC Switch,之后不再访问这个地址。</span></p>
<div class="actions">
<a class="btn solid compact" href="ccswitch://v1/import?resource=provider&app=claude&name=Example%20AI&endpoint=https%3A%2F%2Fapi.example.com&apiKey=sk-test-key123&iconUrl=https%3A%2F%2Fraw.githubusercontent.com%2Ffarion1231%2Fcc-switch%2Fmain%2Fsrc-tauri%2Ficons%2F128x128.png"><svg class="i sm"><use href="#i-import" /></svg>在 CC Switch 中打开</a>
<button type="button" class="btn neutral compact" data-link="ccswitch://v1/import?resource=provider&app=claude&name=Example%20AI&endpoint=https%3A%2F%2Fapi.example.com&apiKey=sk-test-key123&iconUrl=https%3A%2F%2Fraw.githubusercontent.com%2Ffarion1231%2Fcc-switch%2Fmain%2Fsrc-tauri%2Ficons%2F128x128.png" onclick="copyDeepLink(this.dataset.link, this)"><svg class="i sm"><use href="#i-copy" /></svg><span>复制链接</span></button>
</div>
</article>
</div>
</section>
<!-- 用量查询脚本示例 -->
<section id="ex-usage">
<h2>用量查询脚本示例</h2>
<p class="lede">让用户导入后,直接在供应商卡片上看到余额。</p>
<ul class="rules">
<li>脚本是一段 JavaScript 表达式,返回 <code>{ request, extractor }</code>:<code>request</code> 描述发什么请求,<code>extractor(response)</code> 从响应 JSON 里取数。请求由 CC Switch 代发,脚本本身没有网络能力。</li>
<li>占位符:<code>{{apiKey}}</code>(<code>usageApiKey</code>,没给时用供应商 Key)、<code>{{baseUrl}}</code>(<code>usageBaseUrl</code>,没给时用供应商地址)、<code>{{accessToken}}</code>、<code>{{userId}}</code>。</li>
<li><strong>每次只发一个请求,必须是 HTTPS,且与 <code>{{baseUrl}}</code> 同源</strong>;响应必须是 JSON。余额接口在另一个域名时,用 <code>usageBaseUrl</code> 指过去。</li>
<li><code>extractor</code> 返回对象或对象数组,字段都可选:<code>remaining</code>、<code>used</code>、<code>total</code>(数字)、<code>unit</code>、<code>planName</code>、<code>extra</code>(字符串)、<code>isValid</code>(布尔)、<code>invalidMessage</code>(字符串)。<strong>数字字段如果接口返回的是字符串,要先用 <code>Number()</code> 转。</strong></li>
<li>带了 <code>usageScript</code> 就默认启用(v4.0.10 起);要兼容更早的版本,同时写上 <code>usageEnabled=true</code>。<code>usageAutoInterval</code> 是自动查询间隔(分钟),别设得太短。</li>
</ul>
<div class="ex-list" style="margin-top: 20px;">
<article class="ex">
<div class="ex-head"><span class="chip app" style="--dot: var(--agent-claude)"><i class="d"></i>Claude Code</span><h3>通用余额接口</h3></div>
<p class="ex-desc">用 API Key 查余额。按你的接口改 <code>url</code> 和 <code>extractor</code> 里的字段名即可。Key 失效时返回 <code>isValid: false</code>,卡片会显示失效原因。</p>
<dl class="params">
<dt>必需</dt><dd><code>usageScript</code>(Base64,推荐 URL-safe 写法)</dd>
<dt>可选</dt><dd><code>usageEnabled</code> <code>usageApiKey</code> <code>usageBaseUrl</code> <code>usageAutoInterval</code></dd>
</dl>
<figure class="code">
<figcaption>查询脚本(链接里是它的 Base64)</figcaption>
<pre>({
request: {
url: "{{baseUrl}}/user/balance",
method: "GET",
headers: {
"Authorization": "Bearer {{apiKey}}"
}
},