webcode为网页 AI 提供本地编码能力。 通过 VS Code 插件与浏览器插件,打破网页 AI 与本地项目之间的边界,使 ChatGPT、Gemini、DeepSeek 等网页 AI 连接到本地 VS Code,获得读写文件、运行命令的能力,还支持 MCP 和 Skills。 中文 | English
工作原理与使用边界webcode 通过初始化提示词,让网页 AI 按约定格式输出工具调用,由浏览器扩展识别并交给本地 VS Code 执行,再将结果回填到网页对话中,让 AI 继续处理任务。 网页 AI 的上下文窗口、最大输入长度和最大输出长度等限制由平台决定,还可能受到平台预设提示词和产品规则的影响。webcode 无法突破这些限制,因此即使模型名称相同,也不能保证与官方 API 相同的能力和表现。 webcode 目前不支持上下文压缩。随着对话和工具结果不断累积,部分平台可能提示对话过长、无法继续,也可能不再保留完整的历史上下文,表现为遗忘之前的需求、约束或执行结果。具体处理方式因平台而异,长任务的连续性和可靠性难以保证。 本项目更适合代码阅读、Code Review、小范围修改、整理并提交代码等范围明确、通常能在几十轮交互内完成的任务。对于需要大量上下文或长时间连续执行的复杂任务,建议使用具备上下文管理能力的官方 API 编码工具。 请合理控制使用频率和规模,避免滥用。设置发送延迟并不能消除平台风控和账号封禁的风险。 使用示例DeepSeek 网页版:鹈鹕测试下面是本次录屏演示中通过 webcode 连接 DeepSeek 网页版生成的 SVG,任务是绘制一只骑自行车的鹈鹕,也称为“鹈鹕测试”。 提示词:
操作演示(1.5 倍速) https://github.com/user-attachments/assets/448873b4-922a-4cac-b421-70a189394576 生成结果 通过 webcode 和 DeepSeek 网页版生成的 SVG:一只骑自行车的鹈鹕 快速开始1. 安装 VS Code 扩展
2. 启动 Gateway
当状态栏显示端口号时,说明本地 Gateway 已经启动。 3. 打开目标网页 AI
首次使用时,需要在这个独立 Edge profile 中登录一次目标 AI 站点。当 bridge 显示 4. 在对话中使用
如果初始化上下文超过当前 AI 站点的输入框限制,webcode 会优先把完整上下文作为 txt 附件添加到消息中,并在输入框里保留一段简短说明。 例如:
内置工具webcode 内置 具体工具清单见 内置工具说明。 MCP需要接入浏览器自动化、GitHub、数据库或其他外部能力时,可以通过 具体配置方式见 MCP 服务配置指南。 Skillswebcode 可以把当前 VS Code 工作区中的本地 Skills 暴露给网页 AI,让模型按需读取项目工作流、模板、领域说明或脚本资源。 具体使用方式见 Skills 使用指南。 项目规则初始化时,webcode 会从 VS Code 当前打开的主工作区根目录读取项目规则文件,并随初始化结果发送给网页 AI:
如果 目前已内置支持的 AI 平台及其他平台支持webcode 目前已内置支持以下 AI 平台:
如需支持其他平台,可以通过 VS Code 配置快速接入新的站点。稳定平台可以加入内置站点列表,实验或私有站点通常只需要配置 具体步骤见 站点支持扩展指南。 从源码构建源码下载、依赖安装、打包脚本、产物说明和本地安装方式见 构建指南。 常见问题首次启动环境、触发词无反应、工具调用执行后页面没有变化、查看历史工具调用等问题见 常见问题。 参与贡献欢迎提交 Issue 和 Pull Request。 致谢感谢 LINUX DO 社区提供技术交流与开源分享的平台。 许可证
webcodeLocal coding capabilities for web AI. Through a VS Code extension and browser extension, webcode breaks the boundary between web AI and local projects, connecting ChatGPT, Gemini, DeepSeek, and other web AI products to local VS Code with file access, command execution, and MCP and Skills support. English | 中文
How It Works and Limitationswebcode uses initialization prompts to have web AI output tool calls in an agreed format. The browser extension detects these calls and forwards them to local VS Code for execution, then writes the results back into the web conversation so the AI can continue the task. The platform determines limits such as the context window, maximum input length, and maximum output length. Platform-provided prompts and product rules may also affect the AI's behavior. webcode cannot bypass these limits, so even when the model name is the same, it cannot guarantee the same capabilities and performance as the official API. webcode currently does not support context compaction. As the conversation and tool results accumulate, some platforms may report that the conversation is too long to continue, or may stop retaining the full conversation history, causing the AI to forget earlier requirements, constraints, or execution results. Handling varies by platform, and continuity and reliability for long tasks cannot be guaranteed. This project is best suited to clearly scoped tasks that can typically be completed within a few dozen conversational turns, such as reading code, code review, small changes, and preparing and committing code. For complex tasks that require extensive context or prolonged execution, consider coding tools built on official APIs that provide context management. Keep usage frequency and volume reasonable, and avoid abuse. Adding a send delay does not eliminate the risk of platform abuse-prevention measures or account bans. ExamplesDeepSeek Web: The Pelican TestThis SVG was generated in the recorded demo using the DeepSeek web app connected through webcode. The task is to draw a pelican riding a bicycle, also known as the "pelican test." Prompt:
Demo (1.5× speed) https://github.com/user-attachments/assets/448873b4-922a-4cac-b421-70a189394576 Generated result SVG of a pelican riding a bicycle, generated using webcode and the DeepSeek web app Quick Start1. Install the VS Code Extension
2. Start the Gateway
When the status bar shows a port number, the local gateway is running. 3. Open a Supported AI Product
On first use, sign in to the target AI site once in the isolated Edge profile. When the bridge extension shows 4. Use It in Chat
If the initialization context exceeds the current AI site's input limit, webcode first attaches the full context as a txt file and keeps a short instruction in the input box. For example:
Built-in Toolswebcode includes built-in local tools such as See the built-in tools reference. MCPUse See the MCP server configuration guide. Skillswebcode can expose local Skills from the current VS Code workspace so the web AI can load project workflows, templates, domain notes, or script resources on demand. See the Skills guide. Project RulesDuring initialization, webcode reads project rule files from the root of the primary VS Code workspace and sends them with the initialization result:
If both Currently Supported AI Platforms and Additional Platform Supportwebcode currently includes built-in support for the following AI platforms:
To support other platforms, you can add new sites through VS Code configuration. Stable platforms can be added as built-in sites; experimental or private sites usually only need See the site support guide. Build From SourceSee the build guide for repository checkout, dependency installation, packaging scripts, artifacts, and local installation. FAQSee the FAQ guide for first-launch setup, trigger-word issues, tool calls that executed but did not update the page, and tool-call history logs. ContributingIssues and pull requests are welcome. AcknowledgmentsThanks to the LINUX DO community for providing a platform for technical discussions and open-source sharing. License |
