通过作为 OpenClaw 节点连接的 VS Code/Cursor IDE 操作代码,提供 40 多种命令,涵盖文件操作、语言智能、Git、测试等功能。
VS 代码 / 光标节点技能是一项面向实际任务的技能,主要用于通过 OpenClaw 节点协议远程控制 VS 代码或光标 IDE;OpenClaw 节点 VS 代码 - 您需要安装的 VS 代码/ 扩展名( re)。
从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
通过 OpenClaw Node 协议远程控制 VS Code 或 Cursor IDE。
openclaw-node-vscode(状态栏显示 🟢)nodes status 中可见allowCommands 白名单中nodes invoke --node "" --invokeCommand " " --invokeParamsJson '{"key":"val"}'
对于耗时较长的操作,必须同时指定 invokeTimeoutMs(Gateway 内部超时)和 timeoutMs(HTTP 层超时,其值必须更大)。
超时配置参考:
| 类型 | invokeTimeoutMs | timeoutMs |
|---|---|---|
| 文件/编辑器/语言功能 | 15000 | 20000 |
| Git | 30000 | 35000 |
| 测试 | 60000 | 65000 |
| Agent 计划/提问 | 180000 | 185000 |
| Agent 运行 | 300000 | 305000 |
| 分类 | 前缀 | 核心命令 | 参考文档 |
|---|---|---|---|
| 文件 | vscode.file.* |
read、write、edit、delete | commands/file.md |
| 目录 | vscode.dir.* |
list | commands/file.md |
| 语言功能 | vscode.lang.* |
definition、references、hover、symbols、rename、codeActions、format | commands/language.md |
| 编辑器 | vscode.editor.* |
active、openFiles、selections | commands/editor.md |
| 诊断信息 | vscode.diagnostics.* |
get | commands/editor.md |
| Git | vscode.git.* |
status、diff、log、blame、stage、commit、stash | commands/git.md |
| 测试 | vscode.test.* |
list、run、results | commands/test-debug.md |
| 调试 | vscode.debug.* |
launch、stop、breakpoint、evaluate、stackTrace、variables | commands/test-debug.md |
| 终端 | vscode.terminal.* |
run(默认禁用) | commands/terminal.md |
| Agent | vscode.agent.* |
status、run、setup(仅 Cursor 支持) | commands/agent.md |
| 工作区 | vscode.workspace.* |
info | commands/editor.md |
nodes invoke --node "my-vscode" --invokeCommand "vscode.file.read" --invokeParamsJson '{"path":"src/main.ts"}'
→ { content, totalLines, language }
nodes invoke --node "my-vscode" --invokeCommand "vscode.lang.references" --invokeParamsJson '{"path":"src/main.ts","line":10,"character":5}'
→ { locations: [{ path, line, character }] }
nodes invoke --node "my-vscode" --invokeCommand "vscode.git.status"
→ { branch, staged, modified, untracked, ahead, behind }
nodes invoke --node "my-vscode" --invokeCommand "vscode.git.stage" --invokeParamsJson '{"paths":["src/main.ts"]}'
nodes invoke --node "my-vscode" --invokeCommand "vscode.git.commit" --invokeParamsJson '{"message":"fix: resolve type error"}'
nodes invoke --node "my-vscode" --invokeCommand "vscode.agent.run" --invokeParamsJson '{"prompt":"Add error handling to all API endpoints","mode":"plan"}' --invokeTimeoutMs 180000 --timeoutMs 185000
→ { output, exitCode }
详见 references/workflows.md 中的分步详细说明:
| 错误 | 原因 | 解决方案 |
|---|---|---|
node command not allowed |
未列入 Gateway 白名单 | 添加至 gateway.nodes.allowCommands |
node not found |
扩展未连接 | 检查扩展状态栏指示 |
timeout |
操作耗时过长 | 同时增大两个超时参数 |
path traversal blocked |
路径超出工作区范围 | 仅使用相对路径 |
read-only mode |
扩展处于只读模式 | 禁用 openclaw.readOnly 设置项 |
../ 路径均被拦截readOnly 和 confirmWrites 约束相关专题
热门下载
相关下载
精品课程
共0课时 | 0人学习
共102课时 | 10.5万人学习
共162课时 | 27.7万人学习