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