An open-source AI agent framework with DeepSeek integration and full filesystem access via WebView2.
中文 | Deutsch | français | 日本語 | Русский | Português (Brasil)
🎉 DeepSeek WebView2 Integration: Embed https://chat.deepseek.com in VSCode with 20+ filesystem tools (read, write, edit, grep, shell, etc.)
Qwen Code is an open-source AI agent framework for the terminal and desktop. This version adds DeepSeek WebView2 integration while preserving all original Qwen Code tool infrastructure. It helps you understand large codebases, automate tedious work, and ship faster.
This codebase has been enhanced with DeepSeek WebView2 support:
- 🚀 Official DeepSeek Chat - Embed https://chat.deepseek.com directly in VSCode
- 🔧 Full Tool Access - All 20+ Qwen Code tools available to DeepSeek
- 📑 VSCode Extension - Sidebar panel with tool bridging
- 🖥️ Desktop App - WebView2-based Windows application
- 🏠 Local Execution - Tools run on your machine, securely
Quick Start:
# VSCode Extension
cd packages/vscode-deepseek-webview
npm install && npm run compile
# Press F5 in VSCode
# Or use the CLI
npx qwen-deepseek ui📖 Full Guide: packages/vscode-deepseek-webview/README.md
- Flexible AI Support: Works with DeepSeek, OpenAI, Anthropic, Gemini, and more
- Full Tool Access: 20+ built-in tools for filesystem operations, shell commands, web fetching, and more
- Multiple UIs: Terminal CLI, WebView2 desktop app, VSCode extension, or web interface
- Open-Source & Extensible: Build on top of the framework with MCP protocol support
- Cross-Platform: Works on Windows, macOS, and Linux
New! Use the official DeepSeek chat embedded in VSCode with full tool access:
# Build and run the extension
cd packages/vscode-deepseek-webview
npm install
npm run compile
# Press F5 to launch Extension Development HostThis gives you:
- 🚀 Official DeepSeek UI - Uses chat.deepseek.com directly
- 🔧 Full Tool Access - read_file, write_file, edit, grep, shell, etc.
- 📑 Sidebar Integration - Chat panel in VSCode activity bar
- 🔐 Permission Control - Approve/deny tool executions
Full Documentation: packages/vscode-deepseek-webview/README.md
# Install globally
npm install -g @qwen-code/qwen-code
# Start interactive chat
qwen
# Or run a single command
qwen -p "Explain the structure of this project"# Clone and run
git clone https://github.com/QwenLM/qwen-code.git
cd qwen-code
npm install
# Start the WebView2 UI
npm run start:ui
# Or start the Tool API server only
npm run start:webview2# Interactive chat with DeepSeek
npx qwen-deepseek chat
# Browser-based UI
npx qwen-deepseek ui
# API server only
npx qwen-deepseek server --port 3456No API key needed! The WebView2 extension uses your browser session at https://chat.deepseek.com.
For CLI and programmatic use:
- Get your API key from DeepSeek Platform
- Set it via environment variable or settings file
export DEEPSEEK_API_KEY="sk-your-api-key"
qwenCreate ~/.qwen/settings.json:
{
"deepSeek": {
"apiKey": "sk-your-api-key",
"baseUrl": "https://api.deepseek.com/v1",
"model": "deepseek-chat"
}
}The DeepSeek WebView2 extension provides:
- Sidebar Chat - DeepSeek in VSCode activity bar
- Panel Mode - Full editor panel view
- Tool Integration - All Qwen Code tools available
- Permission System - Control tool access
Commands:
DeepSeek: Open- Open in editor panelDeepSeek: Focus- Focus the panelDeepSeek: New Conversation- Start freshDeepSeek: Start Tool API Server- Manual server start
📖 Guide: packages/vscode-deepseek-webview/QUICKSTART.md
cd your-project/
qwen
# Then in the session:
/help
/model
/statsExample prompts:
What does this project do?
Explain the codebase structure.
Help me refactor this function.
Generate unit tests for this module.
The WebView2 app provides a modern desktop experience:
- Native Windows UI with dark theme
- Tool call visualization with real-time status
- Settings panel for API configuration
- Permission prompts for sensitive operations
- Full filesystem access via Qwen Code tools
To run:
npm run start:uiOr build the .NET host app:
cd packages/webview2-deepseek/host-app
dotnet build
dotnet run# Single command execution
qwen -p "Find all TypeScript files and count lines of code"
# In scripts
#!/bin/bash
qwen -p "Generate a summary of changes in git diff"// In your extension
import { activateDeepSeekChat } from '@qwen-code/webview2-deepseek/vscode';
export async function activate(context) {
const deepseek = await activateDeepSeekChat(context);
deepseek.openChat();
}Full Guide: See VSCODE_EXTENSION_GUIDE.md for complete VSCode extension development instructions.
import { DeepSeekClient, ToolBridge } from '@qwen-code/webview2-deepseek';
import { ToolRegistry, Config } from '@qwen-code/qwen-code-core';
// Setup
const config = new Config({ targetDir: '/my/project' });
const toolRegistry = new ToolRegistry(config);
await toolRegistry.discoverAllTools();
const bridge = new ToolBridge(toolRegistry);
const client = new DeepSeekClient({ apiKey: 'sk-...' });
client.setToolRegistry(toolRegistry);
// Chat with tools
const response = await client.chat([
{ role: 'user', content: 'Refactor the main function to use async/await' }
]);All 20+ Qwen Code tools are available to DeepSeek:
| Tool | Description | Default Permission |
|---|---|---|
read_file |
Read file content | allow |
write_file |
Write content to file | ask |
edit |
Find-and-replace in file | ask |
glob |
Find files by pattern | allow |
grep |
Search file contents | allow |
ls |
List directory contents | allow |
shell |
Execute shell command | ask |
web_fetch |
Fetch web page content | ask |
todo_write |
Manage task list | allow |
ask_user_question |
Ask user for input | ask |
memory |
Read/write persistent notes | allow |
glob_to_list_files |
Find and read multiple files | allow |
| File | Scope |
|---|---|
~/.qwen/settings.json |
User (global) |
.qwen/settings.json |
Project |
{
"deepSeek": {
"apiKey": "sk-your-api-key",
"baseUrl": "https://api.deepseek.com/v1",
"model": "deepseek-chat"
},
"workspace": {
"targetDir": "/path/to/project",
"excludePatterns": ["node_modules", ".git", "dist"]
},
"tools": {
"shell": {
"enabled": true,
"requirePermission": true
}
}
}| Variable | Description |
|---|---|
DEEPSEEK_API_KEY |
Your DeepSeek API key |
DEEPSEEK_BASE_URL |
API base URL (default: https://api.deepseek.com/v1) |
DEEPSEEK_MODEL |
Model name (default: deepseek-chat) |
QWEN_WORKSPACE |
Default workspace directory |
DeepSeek: Open- Open chat in editor panelDeepSeek: Focus- Focus the chat panelDeepSeek: New Conversation- Start a new conversationDeepSeek: Start Tool API Server- Start the tool server
/help- Display available commands/clear- Clear conversation history/stats- Show session information/model- Switch model/exitor/quit- Exit
Ctrl+C- Cancel current operationCtrl+D- Exit (on empty line)Up/Down- Navigate command history
┌─────────────────────────────────────────────────┐
│ VSCode Extension │
│ │
│ ┌──────────────────────────────────────────┐ │
│ │ Sidebar Webview │ │
│ │ ┌────────────────────────────────────┐ │ │
│ │ │ https://chat.deepseek.com │ │ │
│ │ │ (Official DeepSeek UI in iframe) │ │ │
│ │ └────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────┘ │
│ │ │
│ │ postMessage │
│ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Extension Host (Node.js) │ │
│ │ • ToolBridge │ │
│ │ • Tool API Server (localhost:3456) │ │
│ └──────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Qwen Code Core Tools │ │
│ │ read_file, write_file, edit, grep... │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ Terminal │
│ │
│ ┌──────────────────────────────────────────┐ │
│ │ Qwen Code CLI │ │
│ │ • Interactive chat │ │
│ │ • Command parsing │ │
│ └──────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Qwen Code Core │ │
│ │ • ToolRegistry │ │
│ │ • FileSystemService │ │
│ │ • Permission System │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
- Node.js 20+
- npm 9+
- (Optional) .NET 8 SDK for WebView2 host app
# Clone
git clone https://github.com/QwenLM/qwen-code.git
cd qwen-code
# Install dependencies
npm install
# Build all packages
npm run build
# Build WebView2 package
npm run build:webview2
# Build VSCode extension
cd packages/vscode-deepseek-webview
npm install && npm run compile# Development mode with hot reload
npm run dev
# Run tests
npm run test
# Run WebView2 tests
npm run test:webview2
# Full preflight check
npm run preflightWhen running the Tool API server (npm run start:webview2):
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/api/tools |
GET | Get all tools (DeepSeek format) |
/api/tools/list |
GET | List tools with descriptions |
/api/tools/execute |
POST | Execute a single tool |
/api/tools/execute-batch |
POST | Execute multiple tools |
/api/tools/permission |
POST | Check tool permission |
curl -X POST http://localhost:3456/api/tools/execute \
-H "Content-Type: application/json" \
-d '{
"toolName": "read_file",
"params": {
"file_path": "C:/project/main.ts"
}
}'DeepSeek page doesn't load:
- Check your internet connection
- DeepSeek may have CORS restrictions for iframes
- Try opening in panel mode instead of sidebar
Tools not working:
- Check if tool server is running:
DeepSeek: Start Tool API Server - Ensure workspace folder is open
- Check Output panel for errors
Tool API Server won't start:
- Ensure Node.js 20+ is installed
- Check if port 3456 is available
- Verify
@qwen-code/qwen-code-coreis installed
WebView2 not loading:
- Install WebView2 runtime: https://developer.microsoft.com/en-us/microsoft-edge/webview2/
- Check .NET 8 SDK is installed
- Verify
appsettings.jsonexists
DeepSeek API errors:
- Verify API key is correct
- Check network connectivity
- Ensure API key has sufficient quota
Permission denied for tools: Some tools require explicit permission. When prompted, approve the tool execution.
| Model | Accuracy |
|---|---|
| deepseek-chat | 42.1% |
| deepseek-coder | 38.7% |
| qwen3-coder-plus | 37.5% |
- VSCode DeepSeek WebView2 - Embed chat.deepseek.com in VSCode
- WebView2 Desktop App - Native Windows application
- VS Code Extension - Traditional IDE integration
- MCP Protocol - External tool support
- TypeScript SDK - Build custom integrations
- Telegram/WeChat/DingTalk Channels - Chat platform integrations
- Discord: https://discord.gg/RN7tqZCeDK
- Dingtalk: https://qr.dingtalk.com/action/joingroup?code=v1,k1,+FX6Gf/ZDlTahTIRi8AEQhIaBlqykA0j+eBKKdhLeAE=&_dt_no_comment=1&origin=1
This project builds upon and integrates several excellent open-source projects:
-
Qwen Code (Original) - The core tool infrastructure, filesystem tools, permission system, and CLI framework. This enhanced version preserves all original Qwen Code functionality while adding DeepSeek WebView2 integration.
-
Google Gemini CLI - The original inspiration and architectural foundation for Qwen Code. We acknowledge and appreciate the excellent work of the Gemini CLI team.
- DeepSeek - Advanced AI models (deepseek-chat, deepseek-coder) used in the WebView2 integration. Their OpenAI-compatible API makes integration seamless.
- Node.js - Runtime environment
- TypeScript - Type-safe development
- Express - Tool API server
- WebView2 - Windows desktop app
- VSCode Extension API - IDE integration
We thank all contributors and users who have helped build and improve this project.
Apache-2.0 - See LICENSE for details.
| Document | Location |
|---|---|
| VSCode Extension Guide | packages/vscode-deepseek-webview/README.md |
| Quick Start (5 min) | packages/vscode-deepseek-webview/QUICKSTART.md |
| WebView2 Implementation | packages/webview2-deepseek/README.md |
| VSCode Extension Tutorial | packages/webview2-deepseek/VSCODE_EXTENSION_GUIDE.md |
| Architecture Comparison | packages/webview2-deepseek/CLARIFICATION.md |
| Migration Guide | ./MIGRATION_GUIDE.md |
| Original Qwen Code Docs | https://qwenlm.github.io/qwen-code-docs/ |
Built with ❤️ by the Qwen Team and Contributors
