Newshot

Show HN: Sidekick AI —— 一款本地优先、支持混合向量搜索的 VS Code 扩展

Translation(model translation, not the source's own text)

Sidekick AI

Sidekick AI 是一个 local-first、云端辅助的 VS Code 扩展。它在本地索引当前工作区,检索相关的代码上下文,并把该上下文连同你的提示词一起发送到云端模型,用于聊天和行内代码生成。

工作原理

  • 本地索引:Sidekick 扫描受支持的源码和文本文件,将其分块,并构建本地向量/全文索引以供代码搜索。
  • 混合检索:从本地工作区索引中检索相关代码片段,并将其随模型请求一起发送,使 LLM 能够给出项目感知的建议。
  • 云端模型:默认提供方为 OpenRouter,同时也支持 OpenAI 兼容 API 和 Anthropic。
  • BYOK 模型访问:你提供自己的 API key,并选择想要使用的提供方/模型。

被索引的工作区数据保留在你的机器上。提示词和检索到的片段会发送到在 VS Code 设置中选择的云端提供方。

快速上手

  • 在 VS Code 中安装 Sidekick AI,并打开一个项目文件夹。
  • 打开命令面板(Windows/Linux 上为 Ctrl+Shift+P,macOS 上为 Cmd+Shift+P)。
  • 将 sidekick.provider 设置为你想要使用的提供方,然后运行 Sidekick AI: Set Cloud API Key,并粘贴提示所要求提供方的 API key。
  • 从命令面板打开 Open Sidekick Chat,开始与该扩展聊天。

每个提供方的 API key 都存储在其各自的 VS Code SecretStorage 条目中,而不是存放在工作区或 settings.json 里。

配置云端提供方

该扩展在 sidekick 命名空间下提供以下设置:


        {
  "sidekick.provider": "openrouter",
  "sidekick.selectedModel": "openrouter/free",
  "sidekick.baseUrl": "https://openrouter.ai/api/v1"
}
      

OpenAI


        {
  "sidekick.provider": "openai",
  "sidekick.selectedModel": "openai/gpt-4o-mini",
  "sidekick.baseUrl": "https://api.openai.com/v1"
}
      

OpenRouter

使用 openrouter 作为提供方,并选择一个 OpenRouter 支持的模型 ID。如有需要,可为 OpenAI 兼容端点覆盖 sidekick.baseUrl。

Anthropic

使用 anthropic 作为提供方,并选择一个 Anthropic 支持的模型。Anthropic 使用其原生 Messages API;OpenAI 和 OpenRouter 使用 OpenAI 兼容的 /chat/completions 端点。

命令

  • Sidekick AI: Set Cloud API Key —— 安全地存储你的提供方 API key。
  • Open Sidekick Chat —— 启动聊天界面。

说明

  • 该扩展面向本地工作区感知的编码辅助,而非纯远程助手。
  • 提供方可能会根据其定价和条款对 API 使用收费。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗