📐 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. 快速开始
- 按 Cmd/Ctrl+Shift+L 打开 YouCoder 面板。
- 首次使用:设置 API Key(面板底部设置区域或
~/.youcoder/config.toml)。
- 在聊天输入框输入需求,回车发送。
- 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.apiKey | API Key(存于 VSCode 密钥库) |
youcoder.baseUrl | 自定义 API 地址 |
youcoder.proxyUrl | HTTP 代理 |
youcoder.mode | 默认模式(plan/ask/act/yolo) |
youcoder.tools.exec.security | shell 执行策略(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
- Press Cmd/Ctrl+Shift+L to open the YouCoder panel.
- First time: set your API key (settings area at the panel bottom, or
~/.youcoder/config.toml).
- Type a request in the chat input and press Enter.
- 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:
| Command | Action |
| YouCoder: Start | Open the panel / new session |
| YouCoder: Stop | Stop the current session |
| YouCoder: Resume Session | Resume the most recent session |
| YouCoder: Select Model | Pick a model |
| YouCoder: Ask Selected Code | Ask about the selected code (auto-includes context) |
| YouCoder: Fix Selected Code | Ask the AI to fix the selection (with diff) |
| YouCoder: Review Selected Code | Review the selection |
| YouCoder: Toggle Mode | Cycle interaction mode (Plan/Ask/Act/YOLO) |
| YouCoder: Show Logs | Inspect 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
| Mode | Behavior |
| Plan | Read-only; plan before acting |
| Ask | Read-only; writes need confirmation |
| Act | All tools; every call confirmed |
| YOLO | Fully 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:
| Setting | Description |
youcoder.provider | Model provider (deepseek/anthropic/openai/...) |
youcoder.model | Model name |
youcoder.apiKey | API key (stored in the VS Code secret storage) |
youcoder.baseUrl | Custom API base URL |
youcoder.proxyUrl | HTTP proxy |
youcoder.mode | Default mode (plan/ask/act/yolo) |
youcoder.tools.exec.security | Shell execution policy (deny/allowlist/relaxed) |
youcoder.statusBarEnabled | Status bar indicator toggle |
7. Troubleshooting
| Issue | Solution |
| Panel won't open | Make sure the sidecar downloaded: check the OUTPUT panel (YouCoder channel); verify your network |
| Sidecar download failed | Manually 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 working | Reload the window (Cmd/Ctrl+Shift+P → Reload Window) |
| Full logs | YouCoder: Show Logs or ~/.youcoder/logs/ |