📐 VSCode 扩展指南

在编辑器里获得完整的 YouCoder 体验

1. 安装

1.1 从 Marketplace 安装(推荐)

# 打开 VSCode → 扩展 (Cmd+Shift+X) → 搜索 "YouCoder"
marketplace.visualstudio.com/items?itemName=Youcoder-for-Roosevelt.youcoder

1.2 手动安装 .vsix

# 从下载页获取 youcoder-vscode-latest.vsix
code --install-extension youcoder-0.1.30.vsix
# 或 扩展面板 → ... → 从 VSIX 安装

1.3 依赖

扩展内置了引擎 sidecar(youcoder-server),首次使用时自动下载对应平台的二进制,无需手动安装。

2. 快速开始

  1. Cmd/Ctrl+Shift+L 打开 YouCoder 面板。
  2. 首次使用:设置 API Key(面板底部设置区域或 ~/.youcoder/config.toml)。
  3. 在聊天输入框输入需求,回车发送。
  4. AI 执行工具时会弹出确认(接受/拒绝),状态实时同步到其他设备。

3. 命令

在命令面板(Cmd/Ctrl+Shift+P)中输入 YouCoder 查看全部命令:

命令功能
YouCoder: Start启动面板 / 新会话
YouCoder: Stop停止当前会话
YouCoder: Resume Session恢复最近会话
YouCoder: Select Model选择模型
YouCoder: Ask Selected Code对选中的代码提问(自动附带代码上下文)
YouCoder: Fix Selected Code让 AI 修复选中的代码(自动 Diff)
YouCoder: Review Selected Code审查选中的代码
YouCoder: Toggle Mode切换交互模式(Plan/Ask/Act/YOLO)
YouCoder: Show Logs查看引擎日志

4. 聊天功能

  • @ 文件引用:输入 @ 选择工作区文件,AI 会读取其内容。
  • 选中提问:在编辑器中选中代码 → 右键 → YouCoder → Ask/Fix/Review。
  • 流式输出:回答实时流式显示,可随时停止。
  • Diff 预览:AI 修改文件后,点击文件标题查看改动,选择接受或拒绝。
  • 多端同步:同一账号下,聊天与授权状态与 TUI / 桌面端实时同步。

5. 模式

模式行为
Plan只读,先规划再执行
Ask只读,写入需确认
Act全工具,每次调用确认
YOLO全自动(Pro)

YouCoder: Toggle Mode 或面板顶部的模式按钮切换。

6. 设置

在 VSCode 设置中搜索 youcoder 可配置 22 项设置,常用项:

设置说明
youcoder.provider模型供应商(deepseek/anthropic/openai/...)
youcoder.model模型名称
youcoder.apiKeyAPI Key(存于 VSCode 密钥库)
youcoder.baseUrl自定义 API 地址
youcoder.proxyUrlHTTP 代理
youcoder.mode默认模式(plan/ask/act/yolo)
youcoder.tools.exec.securityshell 执行策略(deny/allowlist/relaxed)
youcoder.statusBarEnabled状态栏显示开关

7. 故障排查

问题解决方案
面板无法打开确认 sidecar 已下载:查看输出面板(YouCoder 通道)日志;检查网络
sidecar 下载失败手动从下载页获取 youcoder-server 放入 ~/.youcoder/bin/
提示未配置 Key设置 youcoder.apiKey 或环境变量 / 配置文件
命令不生效重载窗口(Cmd/Ctrl+Shift+P → Reload Window)
查看完整日志YouCoder: Show Logs~/.youcoder/logs/

📐 VS Code Extension Guide

The full YouCoder experience inside your editor

1. Installation

1.1 From the Marketplace (recommended)

# Open VS Code → Extensions (Cmd+Shift+X) → search "YouCoder"
marketplace.visualstudio.com/items?itemName=Youcoder-for-Roosevelt.youcoder

1.2 Install the .vsix manually

# Grab youcoder-vscode-latest.vsix from the download page
code --install-extension youcoder-0.1.30.vsix
# or Extensions → ... → Install from VSIX

1.3 Dependencies

The extension bundles an engine sidecar (youcoder-server) and downloads the right binary for your platform on first use — no manual setup needed.

2. Quick Start

  1. Press Cmd/Ctrl+Shift+L to open the YouCoder panel.
  2. First time: set your API key (settings area at the panel bottom, or ~/.youcoder/config.toml).
  3. Type a request in the chat input and press Enter.
  4. When the AI needs to run a tool, a confirmation appears (Accept/Reject) and syncs to your other devices.

3. Commands

Type YouCoder in the command palette (Cmd/Ctrl+Shift+P) to see all commands:

CommandAction
YouCoder: StartOpen the panel / new session
YouCoder: StopStop the current session
YouCoder: Resume SessionResume the most recent session
YouCoder: Select ModelPick a model
YouCoder: Ask Selected CodeAsk about the selected code (auto-includes context)
YouCoder: Fix Selected CodeAsk the AI to fix the selection (with diff)
YouCoder: Review Selected CodeReview the selection
YouCoder: Toggle ModeCycle interaction mode (Plan/Ask/Act/YOLO)
YouCoder: Show LogsInspect engine logs

4. Chat Features

  • @ file references: type @ to pick a workspace file; the AI reads its content.
  • Ask about selection: select code in the editor → right-click → YouCoder → Ask/Fix/Review.
  • Streaming: answers stream in real time and can be stopped anytime.
  • Diff preview: when the AI modifies a file, click its title to review the change and accept or reject it.
  • Multi-device sync: chat and approvals stay in sync with the TUI and desktop app under the same account.

5. Modes

ModeBehavior
PlanRead-only; plan before acting
AskRead-only; writes need confirmation
ActAll tools; every call confirmed
YOLOFully autonomous (Pro)

Switch with YouCoder: Toggle Mode or the mode button at the top of the panel.

6. Settings

Search youcoder in VS Code settings for 22 configurable options. Common ones:

SettingDescription
youcoder.providerModel provider (deepseek/anthropic/openai/...)
youcoder.modelModel name
youcoder.apiKeyAPI key (stored in the VS Code secret storage)
youcoder.baseUrlCustom API base URL
youcoder.proxyUrlHTTP proxy
youcoder.modeDefault mode (plan/ask/act/yolo)
youcoder.tools.exec.securityShell execution policy (deny/allowlist/relaxed)
youcoder.statusBarEnabledStatus bar indicator toggle

7. Troubleshooting

IssueSolution
Panel won't openMake sure the sidecar downloaded: check the OUTPUT panel (YouCoder channel); verify your network
Sidecar download failedManually grab youcoder-server from the download page into ~/.youcoder/bin/
"No key configured"Set youcoder.apiKey, or use env vars / the config file
Commands not workingReload the window (Cmd/Ctrl+Shift+P → Reload Window)
Full logsYouCoder: Show Logs or ~/.youcoder/logs/