mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
2 lines
63 KiB
JavaScript
2 lines
63 KiB
JavaScript
import{_ as y}from"./index-CjeL8tVq.js";import{r as w,c as g,x,z as a,L as f,O as s,Q as h,ac as C,aT as d,P as e,y as n,C as c}from"./vue-vendor-Bsazo-x0.js";import"./element-plus-C5sO7D8l.js";import"./vendor-C8JtMHuO.js";const A={class:"card p-3 sm:p-6"},E={class:"mb-4 sm:mb-8"},S={class:"flex flex-wrap gap-1 rounded-xl bg-gray-100 p-1 dark:bg-gray-700 sm:gap-2 sm:p-2"},O=["onClick"],k={key:0,class:"tutorial-content"},I={class:"mb-6 sm:mb-10"},_={class:"mb-4 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50 to-pink-50 p-4 sm:mb-6 sm:p-6"},T={class:"space-y-4"},P={class:"rounded-lg border border-purple-200 bg-white p-3 dark:border-purple-700 dark:bg-gray-800 sm:p-4"},N={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},G={class:"whitespace-nowrap text-gray-300"},L={class:"rounded-lg border border-purple-200 bg-white p-3 dark:border-purple-700 dark:bg-gray-800 sm:p-4"},U={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},q={class:"whitespace-nowrap text-gray-300"},D={class:"mt-6 rounded-lg border border-blue-200 bg-blue-50 p-3 sm:p-4"},H={class:"mt-3 space-y-2"},R={class:"rounded bg-gray-100 p-2 font-mono text-sm dark:bg-gray-700"},j={class:"mt-8"},K={class:"space-y-4"},z={class:"rounded-lg border border-green-200 bg-white p-3 sm:p-4"},B={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},$={class:"whitespace-nowrap text-gray-300"},V={class:"rounded-lg border border-green-200 bg-white p-3 sm:p-4"},M={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},W={class:"whitespace-nowrap text-gray-300"},Y={class:"mt-8"},F={class:"space-y-4"},Q={class:"rounded-lg border border-yellow-200 bg-yellow-50 p-3 sm:p-4"},J={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},X={class:"whitespace-nowrap text-gray-300"},Z={key:1,class:"tutorial-content"},tt={class:"mb-6 sm:mb-10"},at={class:"mb-4 rounded-xl border border-orange-100 bg-gradient-to-r from-orange-50 to-yellow-50 p-4 sm:mb-6 sm:p-6"},et={class:"space-y-4"},st={class:"rounded-lg border border-orange-200 bg-white p-3 sm:p-4"},dt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},rt={class:"whitespace-nowrap text-gray-300"},ot={class:"rounded-lg border border-orange-200 bg-white p-3 sm:p-4"},bt={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},mt={class:"whitespace-nowrap text-gray-300"},lt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},it={class:"whitespace-nowrap text-gray-300"},xt={class:"mt-8"},nt={class:"space-y-4"},vt={class:"rounded-lg border border-green-200 bg-white p-3 sm:p-4"},pt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},gt={class:"whitespace-nowrap text-gray-300"},ct={class:"rounded-lg border border-green-200 bg-white p-3 sm:p-4"},ut={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},yt={class:"whitespace-nowrap text-gray-300"},wt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},ft={class:"whitespace-nowrap text-gray-300"},ht={class:"mt-8"},Ct={class:"space-y-4"},At={class:"rounded-lg border border-yellow-200 bg-yellow-50 p-3 sm:p-4"},Et={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},St={class:"whitespace-nowrap text-gray-300"},Ot={key:2,class:"tutorial-content"},kt={class:"mb-6 sm:mb-10"},It={class:"mb-4 rounded-xl border border-orange-100 bg-gradient-to-r from-orange-50 to-yellow-50 p-4 sm:mb-6 sm:p-6"},_t={class:"space-y-4"},Tt={class:"rounded-lg border border-orange-200 bg-white p-3 sm:p-4"},Pt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Nt={class:"whitespace-nowrap text-gray-300"},Gt={class:"rounded-lg border border-orange-200 bg-white p-3 sm:p-4"},Lt={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Ut={class:"whitespace-nowrap text-gray-300"},qt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Dt={class:"whitespace-nowrap text-gray-300"},Ht={class:"mt-8"},Rt={class:"space-y-4"},jt={class:"rounded-lg border border-green-200 bg-white p-3 sm:p-4"},Kt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},zt={class:"whitespace-nowrap text-gray-300"},Bt={class:"rounded-lg border border-green-200 bg-white p-3 sm:p-4"},$t={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Vt={class:"whitespace-nowrap text-gray-300"},Mt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Wt={class:"whitespace-nowrap text-gray-300"},Yt={class:"mt-8"},Ft={class:"space-y-4"},Qt={class:"rounded-lg border border-yellow-200 bg-yellow-50 p-3 sm:p-4"},Jt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Xt={class:"whitespace-nowrap text-gray-300"},Zt={__name:"TutorialView",setup(ta){const l=w("windows"),u=[{key:"windows",name:"Windows",icon:"fab fa-windows"},{key:"macos",name:"macOS",icon:"fab fa-apple"},{key:"linux",name:"Linux / WSL2",icon:"fab fa-linux"}],v=()=>{let m="";if(window.location.origin)m=window.location.origin;else{const t=window.location.protocol,r=window.location.hostname,i=window.location.port;m=t+"//"+r,i&&(t==="http:"&&i!=="80"||t==="https:"&&i!=="443")&&(m+=":"+i)}if(!m){const t=window.location.href,r=t.indexOf("/",8);if(r!==-1)m=t.substring(0,r);else return console.warn("无法获取完整的 origin,将使用相对路径"),""}return m},o=g(()=>v()+"/api"),b=g(()=>v()+"/gemini"),p=g(()=>v()+"/openai");return(m,t)=>(n(),x("div",A,[t[123]||(t[123]=a("div",{class:"mb-4 sm:mb-8"},[a("h3",{class:"mb-3 flex items-center text-xl font-bold text-gray-900 dark:text-gray-100 sm:mb-4 sm:text-2xl"},[a("i",{class:"fas fa-graduation-cap mr-2 text-blue-600 sm:mr-3"}),s(" Claude Code 使用教程 ")]),a("p",{class:"text-sm text-gray-600 dark:text-gray-400 sm:text-lg"}," 跟着这个教程,你可以轻松在自己的电脑上安装并使用 Claude Code。 ")],-1)),a("div",E,[a("div",S,[(n(),x(h,null,C(u,r=>a("button",{key:r.key,class:c(["flex flex-1 items-center justify-center gap-1 rounded-lg px-3 py-2 text-xs font-semibold transition-all duration-300 sm:gap-2 sm:px-6 sm:py-3 sm:text-sm",l.value===r.key?"bg-white text-blue-600 shadow-sm dark:bg-gray-800":"text-gray-600 hover:bg-white/50 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200"]),onClick:i=>l.value=r.key},[a("i",{class:c(r.icon)},null,2),s(" "+e(r.name),1)],10,O)),64))])]),l.value==="windows"?(n(),x("div",k,[t[37]||(t[37]=d('<div class="mb-4 sm:mb-10 sm:mb-6" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-blue-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>1</span> 安装 Node.js 环境 </h4><p class="mb-4 text-sm text-gray-600 dark:text-gray-400 sm:mb-4 sm:mb-6 sm:text-base" data-v-76b9a25b> Claude Code 需要 Node.js 环境才能运行。 </p><div class="mb-4 rounded-xl border border-blue-100 bg-gradient-to-r from-blue-50 to-indigo-50 p-4 sm:mb-4 sm:mb-6 sm:p-6" data-v-76b9a25b><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg" data-v-76b9a25b><i class="fab fa-windows mr-2 text-blue-600" data-v-76b9a25b></i> Windows 安装方法 </h5><div class="mb-3 sm:mb-4" data-v-76b9a25b><p class="mb-2 text-sm text-gray-700 dark:text-gray-600 sm:mb-3 sm:text-base" data-v-76b9a25b> 方法一:官网下载(推荐) </p><ol class="ml-2 list-inside list-decimal space-y-1 text-xs text-gray-600 dark:text-gray-600 sm:ml-4 sm:space-y-2 sm:text-sm" data-v-76b9a25b><li data-v-76b9a25b> 打开浏览器访问 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-700 sm:px-2 sm:text-sm" data-v-76b9a25b>https://nodejs.org/</code></li><li data-v-76b9a25b>点击 "LTS" 版本进行下载(推荐长期支持版本)</li><li data-v-76b9a25b> 下载完成后双击 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-700 sm:px-2 sm:text-sm" data-v-76b9a25b>.msi</code> 文件 </li><li data-v-76b9a25b>按照安装向导完成安装,保持默认设置即可</li></ol></div><div class="mb-3 sm:mb-4" data-v-76b9a25b><p class="mb-2 text-sm text-gray-700 dark:text-gray-600 sm:mb-3 sm:text-base" data-v-76b9a25b> 方法二:使用包管理器 </p><p class="mb-2 text-xs text-gray-600 dark:text-gray-400 sm:text-sm" data-v-76b9a25b> 如果你安装了 Chocolatey 或 Scoop,可以使用命令行安装: </p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 使用 Chocolatey</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>choco install nodejs</div><div class="mb-2 mt-3" data-v-76b9a25b># 或使用 Scoop</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>scoop install nodejs</div></div></div><div class="rounded-lg border border-blue-200 bg-blue-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-blue-800 sm:text-base" data-v-76b9a25b>Windows 注意事项</h6><ul class="space-y-1 text-xs text-blue-700 sm:text-sm sm:text-xs" data-v-76b9a25b><li data-v-76b9a25b>• 建议使用 PowerShell 而不是 CMD</li><li data-v-76b9a25b>• 如果遇到权限问题,尝试以管理员身份运行</li><li data-v-76b9a25b>• 某些杀毒软件可能会误报,需要添加白名单</li></ul></div></div><div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-green-800 sm:text-base" data-v-76b9a25b>验证安装是否成功</h6><p class="mb-2 text-xs text-green-700 sm:mb-3 sm:text-sm" data-v-76b9a25b> 安装完成后,打开 PowerShell 或 CMD,输入以下命令: </p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>node --version</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>npm --version</div></div><p class="mt-2 text-xs text-green-700 sm:text-sm" data-v-76b9a25b>如果显示版本号,说明安装成功了!</p></div></div><div class="mb-4 sm:mb-10 sm:mb-6" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-green-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>2</span> 安装 Claude Code </h4><div class="mb-4 rounded-xl border border-green-100 bg-gradient-to-r from-green-50 to-emerald-50 p-4 sm:mb-6 sm:p-6" data-v-76b9a25b><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg" data-v-76b9a25b><i class="fas fa-download mr-2 text-green-600" data-v-76b9a25b></i> 安装 Claude Code </h5><p class="mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base" data-v-76b9a25b> 打开 PowerShell 或 CMD,运行以下命令: </p><div class="mb-4 overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 全局安装 Claude Code</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> npm install -g @anthropic-ai/claude-code </div></div><p class="text-sm text-gray-600 dark:text-gray-400" data-v-76b9a25b> 这个命令会从 npm 官方仓库下载并安装最新版本的 Claude Code。 </p><div class="mt-4 rounded-lg border border-blue-200 bg-blue-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-blue-800 sm:text-base" data-v-76b9a25b>提示</h6><ul class="space-y-1 text-xs text-blue-700 sm:text-sm" data-v-76b9a25b><li data-v-76b9a25b>• 建议使用 PowerShell 而不是 CMD,功能更强大</li><li data-v-76b9a25b>• 如果遇到权限问题,以管理员身份运行 PowerShell</li></ul></div></div><div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b>验证 Claude Code 安装</h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>安装完成后,输入以下命令检查是否安装成功:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude --version</div></div><p class="mt-2 text-sm text-green-700" data-v-76b9a25b> 如果显示版本号,恭喜你!Claude Code 已经成功安装了。 </p></div></div>',2)),a("div",I,[t[36]||(t[36]=a("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[a("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-purple-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"3"),s(" 设置环境变量 ")],-1)),a("div",_,[t[9]||(t[9]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-cog mr-2 text-purple-600"}),s(" 配置 Claude Code 环境变量 ")],-1)),t[10]||(t[10]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 为了让 Claude Code 连接到你的中转服务,需要设置两个环境变量: ",-1)),a("div",T,[a("div",P,[t[1]||(t[1]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 方法一:PowerShell 临时设置(当前会话) ",-1)),t[2]||(t[2]=a("p",{class:"mb-3 text-sm text-gray-600"},"在 PowerShell 中运行以下命令:",-1)),a("div",N,[a("div",G,' $env:ANTHROPIC_BASE_URL = "'+e(o.value)+'" ',1),t[0]||(t[0]=a("div",{class:"whitespace-nowrap text-gray-300"},' $env:ANTHROPIC_AUTH_TOKEN = "你的API密钥" ',-1))]),t[3]||(t[3]=a("p",{class:"mt-2 text-xs text-yellow-700"},' 💡 记得将 "你的API密钥" 替换为在上方 "API Keys" 标签页中创建的实际密钥。 ',-1))]),a("div",L,[t[6]||(t[6]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 方法二:PowerShell 永久设置(用户级) ",-1)),t[7]||(t[7]=a("p",{class:"mb-3 text-sm text-gray-600"}," 在 PowerShell 中运行以下命令设置用户级环境变量: ",-1)),a("div",U,[t[4]||(t[4]=a("div",{class:"mb-2"},"# 设置用户级环境变量(永久生效)",-1)),a("div",q,' [System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "'+e(o.value)+'", [System.EnvironmentVariableTarget]::User) ',1),t[5]||(t[5]=a("div",{class:"whitespace-nowrap text-gray-300"},' [System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "你的API密钥", [System.EnvironmentVariableTarget]::User) ',-1))]),t[8]||(t[8]=d('<p class="mb-3 text-sm text-gray-600" data-v-76b9a25b>查看已设置的环境变量:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 查看用户级环境变量</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> [System.Environment]::GetEnvironmentVariable("ANTHROPIC_BASE_URL", [System.EnvironmentVariableTarget]::User) </div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> [System.Environment]::GetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", [System.EnvironmentVariableTarget]::User) </div></div><p class="mt-2 text-xs text-blue-700" data-v-76b9a25b> 💡 设置后需要重新打开 PowerShell 窗口才能生效。 </p>',3))])])]),a("div",D,[t[14]||(t[14]=d('<h6 class="mb-2 font-medium text-blue-800 dark:text-blue-300" data-v-76b9a25b>验证环境变量设置</h6><p class="mb-3 text-sm text-blue-700" data-v-76b9a25b> 设置完环境变量后,可以通过以下命令验证是否设置成功: </p><div class="space-y-4" data-v-76b9a25b><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 在 PowerShell 中验证: </h6><div class="space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $env:ANTHROPIC_BASE_URL</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $env:ANTHROPIC_AUTH_TOKEN</div></div></div><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 在 CMD 中验证: </h6><div class="space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo %ANTHROPIC_BASE_URL%</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo %ANTHROPIC_AUTH_TOKEN%</div></div></div></div>',3)),a("div",H,[t[12]||(t[12]=a("p",{class:"text-sm text-blue-700"},[a("strong",null,"预期输出示例:")],-1)),a("div",R,[a("div",null,e(o.value),1),t[11]||(t[11]=a("div",null,"cr_xxxxxxxxxxxxxxxxxx",-1))]),t[13]||(t[13]=a("p",{class:"text-xs text-blue-700"}," 💡 如果输出为空或显示变量名本身,说明环境变量设置失败,请重新设置。 ",-1))])]),a("div",j,[t[27]||(t[27]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-robot mr-2 text-green-600"}),s(" 配置 Gemini CLI 环境变量 ")],-1)),t[28]||(t[28]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 如果你使用 Gemini CLI,需要设置以下环境变量: ",-1)),a("div",K,[a("div",z,[t[17]||(t[17]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," PowerShell 设置方法 ",-1)),t[18]||(t[18]=a("p",{class:"mb-3 text-sm text-gray-600"},"在 PowerShell 中运行以下命令:",-1)),a("div",B,[a("div",$,' $env:CODE_ASSIST_ENDPOINT = "'+e(b.value)+'" ',1),t[15]||(t[15]=a("div",{class:"whitespace-nowrap text-gray-300"},' $env:GOOGLE_CLOUD_ACCESS_TOKEN = "你的API密钥" ',-1)),t[16]||(t[16]=a("div",{class:"whitespace-nowrap text-gray-300"},' $env:GOOGLE_GENAI_USE_GCA = "true" ',-1))]),t[19]||(t[19]=a("p",{class:"mt-2 text-xs text-yellow-700"}," 💡 使用与 Claude Code 相同的 API 密钥即可。 ",-1))]),a("div",V,[t[23]||(t[23]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," PowerShell 永久设置(用户级) ",-1)),t[24]||(t[24]=a("p",{class:"mb-3 text-sm text-gray-600"},"在 PowerShell 中运行以下命令:",-1)),a("div",M,[t[20]||(t[20]=a("div",{class:"mb-2"},"# 设置用户级环境变量(永久生效)",-1)),a("div",W,' [System.Environment]::SetEnvironmentVariable("CODE_ASSIST_ENDPOINT", "'+e(b.value)+'", [System.EnvironmentVariableTarget]::User) ',1),t[21]||(t[21]=a("div",{class:"whitespace-nowrap text-gray-300"},' [System.Environment]::SetEnvironmentVariable("GOOGLE_CLOUD_ACCESS_TOKEN", "你的API密钥", [System.EnvironmentVariableTarget]::User) ',-1)),t[22]||(t[22]=a("div",{class:"whitespace-nowrap text-gray-300"},' [System.Environment]::SetEnvironmentVariable("GOOGLE_GENAI_USE_GCA", "true", [System.EnvironmentVariableTarget]::User) ',-1))]),t[25]||(t[25]=a("p",{class:"mt-2 text-xs text-blue-700"}," 💡 设置后需要重新打开 PowerShell 窗口才能生效。 ",-1))]),t[26]||(t[26]=d('<div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b> 验证 Gemini CLI 环境变量 </h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>在 PowerShell 中验证:</p><div class="space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $env:CODE_ASSIST_ENDPOINT</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> echo $env:GOOGLE_CLOUD_ACCESS_TOKEN </div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $env:GOOGLE_GENAI_USE_GCA</div></div></div>',1))])]),a("div",Y,[t[34]||(t[34]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-code mr-2 text-indigo-600"}),s(" 配置 Codex 环境变量 ")],-1)),t[35]||(t[35]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 如果你使用支持 OpenAI API 的工具(如 Codex),需要设置以下环境变量: ",-1)),a("div",F,[a("div",Q,[t[31]||(t[31]=a("h6",{class:"mb-2 font-medium text-yellow-800"},"Codex 配置文件",-1)),t[32]||(t[32]=a("p",{class:"mb-3 text-sm text-yellow-700"},[s(" 在 "),a("code",{class:"rounded bg-yellow-100 px-1"},"~/.codex/config.toml"),s(" 文件中添加以下配置: ")],-1)),a("div",J,[t[29]||(t[29]=d('<div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model_provider = "crs"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model = "gpt-5"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model_reasoning_effort = "high"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>disable_response_storage = true</div><div class="mt-2" data-v-76b9a25b></div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>[model_providers.crs]</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>name = "crs"</div>',7)),a("div",X,'base_url = "'+e(p.value)+'"',1),t[30]||(t[30]=a("div",{class:"whitespace-nowrap text-gray-300"},'wire_api = "responses"',-1))]),t[33]||(t[33]=d('<p class="mt-3 text-sm text-yellow-700" data-v-76b9a25b> 在 <code class="rounded bg-yellow-100 px-1" data-v-76b9a25b>~/.codex/auth.json</code> 文件中配置API密钥: </p><div class="mt-2 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>{</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>"OPENAI_API_KEY": "你的API密钥"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>}</div></div><p class="mt-2 text-xs text-yellow-700" data-v-76b9a25b> 💡 使用与 Claude Code 相同的 API 密钥即可,格式如 cr_xxxxxxxxxx。 </p>',3))])])])]),t[38]||(t[38]=d('<div class="mb-6 sm:mb-8" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-orange-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>4</span> 开始使用 Claude Code </h4><div class="rounded-xl border border-orange-100 bg-gradient-to-r from-orange-50 to-yellow-50 p-4 sm:p-6" data-v-76b9a25b><p class="mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base" data-v-76b9a25b> 现在你可以开始使用 Claude Code 了! </p><div class="space-y-4" data-v-76b9a25b><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 启动 Claude Code </h6><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude</div></div></div><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 在特定项目中使用 </h6><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 进入你的项目目录</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>cd C:\\path\\to\\your\\project</div><div class="mb-2 mt-2" data-v-76b9a25b># 启动 Claude Code</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude</div></div></div></div></div></div><div class="mb-8" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><i class="fas fa-wrench mr-2 text-red-600 sm:mr-3" data-v-76b9a25b></i> Windows 常见问题解决 </h4><div class="space-y-4" data-v-76b9a25b><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 安装时提示 "permission denied" 错误 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>这通常是权限问题,尝试以下解决方法:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b>以管理员身份运行 PowerShell</li><li data-v-76b9a25b> 或者配置 npm 使用用户目录:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>npm config set prefix %APPDATA%\\npm</code></li></ul></div></details><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> PowerShell 执行策略错误 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>如果遇到执行策略限制,运行:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser </div></div></div></details><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 环境变量设置后不生效 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>设置永久环境变量后需要:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b>重新启动 PowerShell 或 CMD</li><li data-v-76b9a25b>或者注销并重新登录 Windows</li><li data-v-76b9a25b> 验证设置:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>echo $env:ANTHROPIC_BASE_URL</code></li></ul></div></details></div></div>',2))])):l.value==="macos"?(n(),x("div",Z,[t[79]||(t[79]=d('<div class="mb-6 sm:mb-10" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-blue-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>1</span> 安装 Node.js 环境 </h4><p class="mb-4 text-gray-600 sm:mb-6" data-v-76b9a25b>Claude Code 需要 Node.js 环境才能运行。</p><div class="mb-4 rounded-xl border border-gray-200 bg-gradient-to-r from-gray-50 to-slate-50 p-4 sm:mb-6 sm:p-6" data-v-76b9a25b><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg" data-v-76b9a25b><i class="fab fa-apple mr-2 text-gray-700" data-v-76b9a25b></i> macOS 安装方法 </h5><div class="mb-4" data-v-76b9a25b><p class="mb-3 text-gray-700" data-v-76b9a25b>方法一:使用 Homebrew(推荐)</p><p class="mb-2 text-xs text-gray-600 dark:text-gray-400 sm:text-sm" data-v-76b9a25b> 如果你已经安装了 Homebrew,使用它安装 Node.js 会更方便: </p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 更新 Homebrew</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>brew update</div><div class="mb-2 mt-3" data-v-76b9a25b># 安装 Node.js</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>brew install node</div></div></div><div class="mb-4" data-v-76b9a25b><p class="mb-3 text-gray-700" data-v-76b9a25b>方法二:官网下载</p><ol class="ml-2 list-inside list-decimal space-y-1 text-xs text-gray-600 dark:text-gray-400 sm:ml-4 sm:space-y-2 sm:text-sm" data-v-76b9a25b><li data-v-76b9a25b> 访问 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-700 sm:px-2 sm:text-sm" data-v-76b9a25b>https://nodejs.org/</code></li><li data-v-76b9a25b>下载适合 macOS 的 LTS 版本</li><li data-v-76b9a25b> 打开下载的 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-700 sm:px-2 sm:text-sm" data-v-76b9a25b>.pkg</code> 文件 </li><li data-v-76b9a25b>按照安装程序指引完成安装</li></ol></div><div class="rounded-lg border border-gray-200 bg-gray-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 sm:text-base" data-v-76b9a25b>macOS 注意事项</h6><ul class="space-y-1 text-xs text-gray-700 sm:text-sm" data-v-76b9a25b><li data-v-76b9a25b> • 如果遇到权限问题,可能需要使用 <code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>sudo</code></li><li data-v-76b9a25b>• 首次运行可能需要在系统偏好设置中允许</li><li data-v-76b9a25b>• 建议使用 Terminal 或 iTerm2</li></ul></div></div><div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b>验证安装是否成功</h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>安装完成后,打开 Terminal,输入以下命令:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>node --version</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>npm --version</div></div><p class="mt-2 text-sm text-green-700" data-v-76b9a25b>如果显示版本号,说明安装成功了!</p></div></div><div class="mb-6 sm:mb-10" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-green-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>2</span> 安装 Claude Code </h4><div class="mb-4 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50 to-pink-50 p-4 sm:mb-6 sm:p-6" data-v-76b9a25b><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg" data-v-76b9a25b><i class="fas fa-download mr-2 text-purple-600" data-v-76b9a25b></i> 安装 Claude Code </h5><p class="mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base" data-v-76b9a25b> 打开 Terminal,运行以下命令: </p><div class="mb-4 overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 全局安装 Claude Code</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> npm install -g @anthropic-ai/claude-code </div></div><p class="mb-2 text-sm text-gray-600" data-v-76b9a25b>如果遇到权限问题,可以使用 sudo:</p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> sudo npm install -g @anthropic-ai/claude-code </div></div></div><div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b>验证 Claude Code 安装</h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>安装完成后,输入以下命令检查是否安装成功:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude --version</div></div><p class="mt-2 text-sm text-green-700" data-v-76b9a25b> 如果显示版本号,恭喜你!Claude Code 已经成功安装了。 </p></div></div>',2)),a("div",tt,[t[78]||(t[78]=a("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[a("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-orange-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"3"),s(" 设置环境变量 ")],-1)),a("div",at,[t[51]||(t[51]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-cog mr-2 text-orange-600"}),s(" 配置 Claude Code 环境变量 ")],-1)),t[52]||(t[52]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 为了让 Claude Code 连接到你的中转服务,需要设置两个环境变量: ",-1)),a("div",et,[a("div",st,[t[40]||(t[40]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 方法一:临时设置(当前会话) ",-1)),t[41]||(t[41]=a("p",{class:"mb-3 text-sm text-gray-600"},"在 Terminal 中运行以下命令:",-1)),a("div",dt,[a("div",rt,' export ANTHROPIC_BASE_URL="'+e(o.value)+'" ',1),t[39]||(t[39]=a("div",{class:"whitespace-nowrap text-gray-300"},' export ANTHROPIC_AUTH_TOKEN="你的API密钥" ',-1))]),t[42]||(t[42]=a("p",{class:"mt-2 text-xs text-yellow-700"},' 💡 记得将 "你的API密钥" 替换为在上方 "API Keys" 标签页中创建的实际密钥。 ',-1))]),a("div",ot,[t[49]||(t[49]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 方法二:永久设置 ",-1)),t[50]||(t[50]=a("p",{class:"mb-3 text-sm text-gray-600"}," 编辑你的 shell 配置文件(根据你使用的 shell): ",-1)),a("div",bt,[t[43]||(t[43]=a("div",{class:"mb-2"},"# 对于 zsh (默认)",-1)),a("div",mt,` echo 'export ANTHROPIC_BASE_URL="`+e(o.value)+`"' >> ~/.zshrc `,1),t[44]||(t[44]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export ANTHROPIC_AUTH_TOKEN="你的API密钥"' >> ~/.zshrc `,-1)),t[45]||(t[45]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.zshrc",-1))]),a("div",lt,[t[46]||(t[46]=a("div",{class:"mb-2"},"# 对于 bash",-1)),a("div",it,` echo 'export ANTHROPIC_BASE_URL="`+e(o.value)+`"' >> ~/.bash_profile `,1),t[47]||(t[47]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export ANTHROPIC_AUTH_TOKEN="你的API密钥"' >> ~/.bash_profile `,-1)),t[48]||(t[48]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.bash_profile",-1))])])])]),a("div",xt,[t[69]||(t[69]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-robot mr-2 text-green-600"}),s(" 配置 Gemini CLI 环境变量 ")],-1)),t[70]||(t[70]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 如果你使用 Gemini CLI,需要设置以下环境变量: ",-1)),a("div",nt,[a("div",vt,[t[55]||(t[55]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," Terminal 设置方法 ",-1)),t[56]||(t[56]=a("p",{class:"mb-3 text-sm text-gray-600"},"在 Terminal 中运行以下命令:",-1)),a("div",pt,[a("div",gt,' export CODE_ASSIST_ENDPOINT="'+e(b.value)+'" ',1),t[53]||(t[53]=a("div",{class:"whitespace-nowrap text-gray-300"},' export GOOGLE_CLOUD_ACCESS_TOKEN="你的API密钥" ',-1)),t[54]||(t[54]=a("div",{class:"whitespace-nowrap text-gray-300"},' export GOOGLE_GENAI_USE_GCA="true" ',-1))]),t[57]||(t[57]=a("p",{class:"mt-2 text-xs text-yellow-700"}," 💡 使用与 Claude Code 相同的 API 密钥即可。 ",-1))]),a("div",ct,[t[66]||(t[66]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 永久设置方法 ",-1)),t[67]||(t[67]=a("p",{class:"mb-3 text-sm text-gray-600"},"添加到你的 shell 配置文件:",-1)),a("div",ut,[t[58]||(t[58]=a("div",{class:"mb-2"},"# 对于 zsh (默认)",-1)),a("div",yt,` echo 'export CODE_ASSIST_ENDPOINT="`+e(b.value)+`"' >> ~/.zshrc `,1),t[59]||(t[59]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_CLOUD_ACCESS_TOKEN="你的API密钥"' >> ~/.zshrc `,-1)),t[60]||(t[60]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_GENAI_USE_GCA="true"' >> ~/.zshrc `,-1)),t[61]||(t[61]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.zshrc",-1))]),a("div",wt,[t[62]||(t[62]=a("div",{class:"mb-2"},"# 对于 bash",-1)),a("div",ft,` echo 'export CODE_ASSIST_ENDPOINT="`+e(b.value)+`"' >> ~/.bash_profile `,1),t[63]||(t[63]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_CLOUD_ACCESS_TOKEN="你的API密钥"' >> ~/.bash_profile `,-1)),t[64]||(t[64]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_GENAI_USE_GCA="true"' >> ~/.bash_profile `,-1)),t[65]||(t[65]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.bash_profile",-1))])]),t[68]||(t[68]=d('<div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b> 验证 Gemini CLI 环境变量 </h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>在 Terminal 中验证:</p><div class="space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $CODE_ASSIST_ENDPOINT</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $GOOGLE_CLOUD_ACCESS_TOKEN</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $GOOGLE_GENAI_USE_GCA</div></div></div>',1))])]),a("div",ht,[t[76]||(t[76]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-code mr-2 text-indigo-600"}),s(" 配置 Codex 环境变量 ")],-1)),t[77]||(t[77]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 如果你使用支持 OpenAI API 的工具(如 Codex),需要设置以下环境变量: ",-1)),a("div",Ct,[a("div",At,[t[73]||(t[73]=a("h6",{class:"mb-2 font-medium text-yellow-800"},"Codex 配置文件",-1)),t[74]||(t[74]=a("p",{class:"mb-3 text-sm text-yellow-700"},[s(" 在 "),a("code",{class:"rounded bg-yellow-100 px-1"},"~/.codex/config.toml"),s(" 文件中添加以下配置: ")],-1)),a("div",Et,[t[71]||(t[71]=d('<div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model_provider = "crs"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model = "gpt-5"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model_reasoning_effort = "high"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>disable_response_storage = true</div><div class="mt-2" data-v-76b9a25b></div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>[model_providers.crs]</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>name = "crs"</div>',7)),a("div",St,'base_url = "'+e(p.value)+'"',1),t[72]||(t[72]=a("div",{class:"whitespace-nowrap text-gray-300"},'wire_api = "responses"',-1))]),t[75]||(t[75]=d('<p class="mt-3 text-sm text-yellow-700" data-v-76b9a25b> 在 <code class="rounded bg-yellow-100 px-1" data-v-76b9a25b>~/.codex/auth.json</code> 文件中配置API密钥: </p><div class="mt-2 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>{</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>"OPENAI_API_KEY": "你的API密钥"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>}</div></div><p class="mt-2 text-xs text-yellow-700" data-v-76b9a25b> 💡 使用与 Claude Code 相同的 API 密钥即可,格式如 cr_xxxxxxxxxx。 </p>',3))])])])]),t[80]||(t[80]=d('<div class="mb-8" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-yellow-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>4</span> 开始使用 Claude Code </h4><div class="rounded-xl border border-yellow-100 bg-gradient-to-r from-yellow-50 to-amber-50 p-4 sm:p-6" data-v-76b9a25b><p class="mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base" data-v-76b9a25b> 现在你可以开始使用 Claude Code 了! </p><div class="space-y-4" data-v-76b9a25b><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 启动 Claude Code </h6><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude</div></div></div><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 在特定项目中使用 </h6><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 进入你的项目目录</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>cd /path/to/your/project</div><div class="mb-2 mt-2" data-v-76b9a25b># 启动 Claude Code</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude</div></div></div></div></div></div><div class="mb-8" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><i class="fas fa-wrench mr-2 text-red-600 sm:mr-3" data-v-76b9a25b></i> macOS 常见问题解决 </h4><div class="space-y-4" data-v-76b9a25b><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 安装时提示权限错误 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>尝试以下解决方法:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b> 使用 sudo 安装:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>sudo npm install -g @anthropic-ai/claude-code</code></li><li data-v-76b9a25b> 或者配置 npm 使用用户目录:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>npm config set prefix ~/.npm-global</code></li></ul></div></details><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> macOS 安全设置阻止运行 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>如果系统阻止运行 Claude Code:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b>打开"系统偏好设置" → "安全性与隐私"</li><li data-v-76b9a25b>点击"仍要打开"或"允许"</li><li data-v-76b9a25b> 或者在 Terminal 中运行:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>sudo spctl --master-disable</code></li></ul></div></details><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 环境变量不生效 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>检查以下几点:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b>确认修改了正确的配置文件(.zshrc 或 .bash_profile)</li><li data-v-76b9a25b>重新启动 Terminal</li><li data-v-76b9a25b> 验证设置:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>echo $ANTHROPIC_BASE_URL</code></li></ul></div></details></div></div>',2))])):l.value==="linux"?(n(),x("div",Ot,[t[121]||(t[121]=d('<div class="mb-6 sm:mb-10" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-blue-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>1</span> 安装 Node.js 环境 </h4><p class="mb-4 text-gray-600 sm:mb-6" data-v-76b9a25b>Claude Code 需要 Node.js 环境才能运行。</p><div class="mb-4 rounded-xl border border-orange-100 bg-gradient-to-r from-orange-50 to-red-50 p-4 sm:mb-6 sm:p-6" data-v-76b9a25b><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg" data-v-76b9a25b><i class="fab fa-ubuntu mr-2 text-orange-600" data-v-76b9a25b></i> Linux 安装方法 </h5><div class="mb-4" data-v-76b9a25b><p class="mb-3 text-gray-700" data-v-76b9a25b>方法一:使用官方仓库(推荐)</p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 添加 NodeSource 仓库</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - </div><div class="mb-2 mt-3" data-v-76b9a25b># 安装 Node.js</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>sudo apt-get install -y nodejs</div></div></div><div class="mb-4" data-v-76b9a25b><p class="mb-3 text-gray-700" data-v-76b9a25b>方法二:使用系统包管理器</p><p class="mb-2 text-xs text-gray-600 dark:text-gray-400 sm:text-sm" data-v-76b9a25b> 虽然版本可能不是最新的,但对于基本使用已经足够: </p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># Ubuntu/Debian</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>sudo apt update</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>sudo apt install nodejs npm</div><div class="mb-2 mt-3" data-v-76b9a25b># CentOS/RHEL/Fedora</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>sudo dnf install nodejs npm</div></div></div><div class="rounded-lg border border-orange-200 bg-orange-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-orange-800 sm:text-base" data-v-76b9a25b>Linux 注意事项</h6><ul class="space-y-1 text-xs text-orange-700 sm:text-sm" data-v-76b9a25b><li data-v-76b9a25b>• 某些发行版可能需要安装额外的依赖</li><li data-v-76b9a25b>• 如果遇到权限问题,使用 <code class="rounded bg-orange-200 px-1" data-v-76b9a25b>sudo</code></li><li data-v-76b9a25b>• 确保你的用户在 npm 的全局目录有写权限</li></ul></div></div><div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b>验证安装是否成功</h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>安装完成后,打开终端,输入以下命令:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>node --version</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>npm --version</div></div><p class="mt-2 text-sm text-green-700" data-v-76b9a25b>如果显示版本号,说明安装成功了!</p></div></div><div class="mb-6 sm:mb-10" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-green-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>2</span> 安装 Claude Code </h4><div class="mb-4 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50 to-pink-50 p-4 sm:mb-6 sm:p-6" data-v-76b9a25b><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg" data-v-76b9a25b><i class="fas fa-download mr-2 text-purple-600" data-v-76b9a25b></i> 安装 Claude Code </h5><p class="mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base" data-v-76b9a25b> 打开终端,运行以下命令: </p><div class="mb-4 overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 全局安装 Claude Code</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> npm install -g @anthropic-ai/claude-code </div></div><p class="mb-2 text-sm text-gray-600" data-v-76b9a25b>如果遇到权限问题,可以使用 sudo:</p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> sudo npm install -g @anthropic-ai/claude-code </div></div></div><div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b>验证 Claude Code 安装</h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>安装完成后,输入以下命令检查是否安装成功:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude --version</div></div><p class="mt-2 text-sm text-green-700" data-v-76b9a25b> 如果显示版本号,恭喜你!Claude Code 已经成功安装了。 </p></div></div>',2)),a("div",kt,[t[120]||(t[120]=a("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[a("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-orange-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"3"),s(" 设置环境变量 ")],-1)),a("div",It,[t[93]||(t[93]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-cog mr-2 text-orange-600"}),s(" 配置 Claude Code 环境变量 ")],-1)),t[94]||(t[94]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 为了让 Claude Code 连接到你的中转服务,需要设置两个环境变量: ",-1)),a("div",_t,[a("div",Tt,[t[82]||(t[82]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 方法一:临时设置(当前会话) ",-1)),t[83]||(t[83]=a("p",{class:"mb-3 text-sm text-gray-600"},"在终端中运行以下命令:",-1)),a("div",Pt,[a("div",Nt,' export ANTHROPIC_BASE_URL="'+e(o.value)+'" ',1),t[81]||(t[81]=a("div",{class:"whitespace-nowrap text-gray-300"},' export ANTHROPIC_AUTH_TOKEN="你的API密钥" ',-1))]),t[84]||(t[84]=a("p",{class:"mt-2 text-xs text-yellow-700"},' 💡 记得将 "你的API密钥" 替换为在上方 "API Keys" 标签页中创建的实际密钥。 ',-1))]),a("div",Gt,[t[91]||(t[91]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 方法二:永久设置 ",-1)),t[92]||(t[92]=a("p",{class:"mb-3 text-sm text-gray-600"},"编辑你的 shell 配置文件:",-1)),a("div",Lt,[t[85]||(t[85]=a("div",{class:"mb-2"},"# 对于 bash (默认)",-1)),a("div",Ut,` echo 'export ANTHROPIC_BASE_URL="`+e(o.value)+`"' >> ~/.bashrc `,1),t[86]||(t[86]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export ANTHROPIC_AUTH_TOKEN="你的API密钥"' >> ~/.bashrc `,-1)),t[87]||(t[87]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.bashrc",-1))]),a("div",qt,[t[88]||(t[88]=a("div",{class:"mb-2"},"# 对于 zsh",-1)),a("div",Dt,` echo 'export ANTHROPIC_BASE_URL="`+e(o.value)+`"' >> ~/.zshrc `,1),t[89]||(t[89]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export ANTHROPIC_AUTH_TOKEN="你的API密钥"' >> ~/.zshrc `,-1)),t[90]||(t[90]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.zshrc",-1))])])])]),a("div",Ht,[t[111]||(t[111]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-robot mr-2 text-green-600"}),s(" 配置 Gemini CLI 环境变量 ")],-1)),t[112]||(t[112]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 如果你使用 Gemini CLI,需要设置以下环境变量: ",-1)),a("div",Rt,[a("div",jt,[t[97]||(t[97]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 终端设置方法 ",-1)),t[98]||(t[98]=a("p",{class:"mb-3 text-sm text-gray-600"},"在终端中运行以下命令:",-1)),a("div",Kt,[a("div",zt,' export CODE_ASSIST_ENDPOINT="'+e(b.value)+'" ',1),t[95]||(t[95]=a("div",{class:"whitespace-nowrap text-gray-300"},' export GOOGLE_CLOUD_ACCESS_TOKEN="你的API密钥" ',-1)),t[96]||(t[96]=a("div",{class:"whitespace-nowrap text-gray-300"},' export GOOGLE_GENAI_USE_GCA="true" ',-1))]),t[99]||(t[99]=a("p",{class:"mt-2 text-xs text-yellow-700"}," 💡 使用与 Claude Code 相同的 API 密钥即可。 ",-1))]),a("div",Bt,[t[108]||(t[108]=a("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base"}," 永久设置方法 ",-1)),t[109]||(t[109]=a("p",{class:"mb-3 text-sm text-gray-600"},"添加到你的 shell 配置文件:",-1)),a("div",$t,[t[100]||(t[100]=a("div",{class:"mb-2"},"# 对于 bash (默认)",-1)),a("div",Vt,` echo 'export CODE_ASSIST_ENDPOINT="`+e(b.value)+`"' >> ~/.bashrc `,1),t[101]||(t[101]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_CLOUD_ACCESS_TOKEN="你的API密钥"' >> ~/.bashrc `,-1)),t[102]||(t[102]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_GENAI_USE_GCA="true"' >> ~/.bashrc `,-1)),t[103]||(t[103]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.bashrc",-1))]),a("div",Mt,[t[104]||(t[104]=a("div",{class:"mb-2"},"# 对于 zsh",-1)),a("div",Wt,` echo 'export CODE_ASSIST_ENDPOINT="`+e(b.value)+`"' >> ~/.zshrc `,1),t[105]||(t[105]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_CLOUD_ACCESS_TOKEN="你的API密钥"' >> ~/.zshrc `,-1)),t[106]||(t[106]=a("div",{class:"whitespace-nowrap text-gray-300"},` echo 'export GOOGLE_GENAI_USE_GCA="true"' >> ~/.zshrc `,-1)),t[107]||(t[107]=a("div",{class:"whitespace-nowrap text-gray-300"},"source ~/.zshrc",-1))])]),t[110]||(t[110]=d('<div class="rounded-lg border border-green-200 bg-green-50 p-3 sm:p-4" data-v-76b9a25b><h6 class="mb-2 font-medium text-green-800 dark:text-green-300" data-v-76b9a25b> 验证 Gemini CLI 环境变量 </h6><p class="mb-3 text-sm text-green-700" data-v-76b9a25b>在终端中验证:</p><div class="space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $CODE_ASSIST_ENDPOINT</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $GOOGLE_CLOUD_ACCESS_TOKEN</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>echo $GOOGLE_GENAI_USE_GCA</div></div></div>',1))])]),a("div",Yt,[t[118]||(t[118]=a("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-600 sm:mb-3 sm:text-lg"},[a("i",{class:"fas fa-code mr-2 text-indigo-600"}),s(" 配置 Codex 环境变量 ")],-1)),t[119]||(t[119]=a("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 如果你使用支持 OpenAI API 的工具(如 Codex),需要设置以下环境变量: ",-1)),a("div",Ft,[a("div",Qt,[t[115]||(t[115]=a("h6",{class:"mb-2 font-medium text-yellow-800"},"Codex 配置文件",-1)),t[116]||(t[116]=a("p",{class:"mb-3 text-sm text-yellow-700"},[s(" 在 "),a("code",{class:"rounded bg-yellow-100 px-1"},"~/.codex/config.toml"),s(" 文件中添加以下配置: ")],-1)),a("div",Jt,[t[113]||(t[113]=d('<div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model_provider = "crs"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model = "gpt-5"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>model_reasoning_effort = "high"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>disable_response_storage = true</div><div class="mt-2" data-v-76b9a25b></div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>[model_providers.crs]</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>name = "crs"</div>',7)),a("div",Xt,'base_url = "'+e(p.value)+'"',1),t[114]||(t[114]=a("div",{class:"whitespace-nowrap text-gray-300"},'wire_api = "responses"',-1))]),t[117]||(t[117]=d('<p class="mt-3 text-sm text-yellow-700" data-v-76b9a25b> 在 <code class="rounded bg-yellow-100 px-1" data-v-76b9a25b>~/.codex/auth.json</code> 文件中配置API密钥: </p><div class="mt-2 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>{</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>"OPENAI_API_KEY": "你的API密钥"</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>}</div></div><p class="mt-2 text-xs text-yellow-700" data-v-76b9a25b> 💡 使用与 Claude Code 相同的 API 密钥即可,格式如 cr_xxxxxxxxxx。 </p>',3))])])])]),t[122]||(t[122]=d('<div class="mb-8" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><span class="mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-yellow-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm" data-v-76b9a25b>4</span> 开始使用 Claude Code </h4><div class="rounded-xl border border-yellow-100 bg-gradient-to-r from-yellow-50 to-amber-50 p-4 sm:p-6" data-v-76b9a25b><p class="mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base" data-v-76b9a25b> 现在你可以开始使用 Claude Code 了! </p><div class="space-y-4" data-v-76b9a25b><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 启动 Claude Code </h6><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude</div></div></div><div data-v-76b9a25b><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-600 sm:text-base" data-v-76b9a25b> 在特定项目中使用 </h6><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># 进入你的项目目录</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>cd /path/to/your/project</div><div class="mb-2 mt-2" data-v-76b9a25b># 启动 Claude Code</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>claude</div></div></div></div></div></div><div class="mb-8" data-v-76b9a25b><h4 class="mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl" data-v-76b9a25b><i class="fas fa-wrench mr-2 text-red-600 sm:mr-3" data-v-76b9a25b></i> Linux 常见问题解决 </h4><div class="space-y-4" data-v-76b9a25b><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 安装时提示权限错误 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>尝试以下解决方法:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b> 使用 sudo 安装:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>sudo npm install -g @anthropic-ai/claude-code</code></li><li data-v-76b9a25b> 或者配置 npm 使用用户目录:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>npm config set prefix ~/.npm-global</code></li><li data-v-76b9a25b> 然后添加到 PATH:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>export PATH=~/.npm-global/bin:$PATH</code></li></ul></div></details><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 缺少依赖库 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>某些 Linux 发行版需要安装额外依赖:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm" data-v-76b9a25b><div class="mb-2" data-v-76b9a25b># Ubuntu/Debian</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b>sudo apt install build-essential</div><div class="mb-2 mt-2" data-v-76b9a25b># CentOS/RHEL</div><div class="whitespace-nowrap text-gray-300" data-v-76b9a25b> sudo dnf groupinstall "Development Tools" </div></div></div></details><details class="rounded-lg border border-gray-200 bg-gray-50" data-v-76b9a25b><summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 sm:p-4 sm:text-base" data-v-76b9a25b> 环境变量不生效 </summary><div class="px-3 pb-3 text-gray-600 sm:px-4 sm:pb-4" data-v-76b9a25b><p class="mb-2" data-v-76b9a25b>检查以下几点:</p><ul class="list-inside list-disc space-y-1 text-sm" data-v-76b9a25b><li data-v-76b9a25b>确认修改了正确的配置文件(.bashrc 或 .zshrc)</li><li data-v-76b9a25b> 重新启动终端或运行 <code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>source ~/.bashrc</code></li><li data-v-76b9a25b> 验证设置:<code class="rounded bg-gray-200 px-1 text-xs sm:text-sm" data-v-76b9a25b>echo $ANTHROPIC_BASE_URL</code></li></ul></div></details></div></div>',2))])):f("",!0),t[124]||(t[124]=a("div",{class:"rounded-xl bg-gradient-to-r from-blue-500 to-purple-600 p-4 text-center text-white sm:p-6"},[a("h5",{class:"mb-2 text-lg font-semibold sm:text-xl"},"🎉 恭喜你!"),a("p",{class:"mb-3 text-sm text-blue-100 sm:mb-4 sm:text-base"}," 你已经成功安装并配置了 Claude Code,现在可以开始享受 AI 编程助手带来的便利了。 "),a("p",{class:"text-xs text-blue-200 sm:text-sm"}," 如果在使用过程中遇到任何问题,可以查看官方文档或社区讨论获取帮助。 ")],-1))]))}},ra=y(Zt,[["__scopeId","data-v-76b9a25b"]]);export{ra as default};
|