docs: issue-501

This commit is contained in:
shaw
2025-10-02 19:25:59 +08:00
parent 3f79e56209
commit fe894cc07a

View File

@@ -1613,21 +1613,49 @@
VSCode Claude 插件配置
</h6>
<p class="mb-3 text-sm text-indigo-700">
如果使用 VSCode Claude 插件需要在配置文件中进行设置
如果使用 VSCode Claude 插件请在 VSCode 设置中为扩展添加以下环境变量
</p>
<div class="mb-3 space-y-2">
<p class="text-sm text-indigo-700">
<strong>配置文件位置</strong>
<code class="rounded bg-indigo-100 px-1">~/.claude/config.json</code>
<strong>操作步骤</strong>
打开 VSCode依次选择文件首选项设置搜索
<code class="rounded bg-indigo-100 px-1">Claude Code: Environment Variables</code>
并点击 settings.json 中编辑
</p>
<p class="text-xs text-indigo-600">
💡 也可以直接编辑
<code class="rounded bg-indigo-100 px-1">~/.config/Code/User/settings.json</code>
</p>
<p class="text-xs text-indigo-600">💡 如果该文件不存在请手动创建</p>
</div>
<div
class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"
>
<div class="whitespace-nowrap text-gray-300">"claude-code.environmentVariables": [</div>
<div class="whitespace-nowrap text-gray-300">{</div>
<div class="whitespace-nowrap text-gray-300">"primaryApiKey": "crs"</div>
<div class="whitespace-nowrap text-gray-300">"name": "ANTHROPIC_BASE_URL",</div>
<div class="whitespace-nowrap text-gray-300">"value": "{{ currentBaseUrl }}"</div>
<div class="whitespace-nowrap text-gray-300">},</div>
<div class="whitespace-nowrap text-gray-300">{</div>
<div class="whitespace-nowrap text-gray-300">"name": "ANTHROPIC_AUTH_TOKEN",</div>
<div class="whitespace-nowrap text-gray-300">"value": "你的API密钥"</div>
<div class="whitespace-nowrap text-gray-300">}</div>
<div class="whitespace-nowrap text-gray-300">]</div>
</div>
<p class="mt-3 text-xs text-indigo-600">
💡 保存后重启 VSCode如果仍提示 Invalid API key请确认所填密钥有效且未过期
</p>
<div class="mt-4 rounded-lg border border-indigo-200 bg-white p-3 sm:p-4">
<p class="mb-3 text-sm text-indigo-700">
需要在配置文件中<code class="rounded bg-indigo-100 px-1">~/.claude/config.json</code
>进行设置
</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"
>
<div class="whitespace-nowrap text-gray-300">{</div>
<div class="whitespace-nowrap text-gray-300">"primaryApiKey": "crs"</div>
<div class="whitespace-nowrap text-gray-300">}</div>
</div>
</div>
</div>
</div>