feat: INTEGRATION.md per-app guide, VS Code panel buttons wired + one-click install button, DSH install route
Browse filesFiles changed (6)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158# 各软件接入指南
AgentLens 支持 7 个 AI 编程工具。每个工具的接入方式不同,下面逐个说明。
> 通用前提:如果 App 没反应,**完全退出再重开**(Mac:`Cmd+Q`,不是关窗口)。MCP 配置和 Skill 都是启动时加载的。
---
## 1. Claude Code
**接入方式**:MCP 工具 + Skill
**自动接入**:
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js install --target claude```
**接入后**:- 配置文件:`~/.claude/settings.json` 的 `mcpServers.agentlens`- Skill:`~/.claude/skills/agentlens/SKILL.md`
**怎么用**:1. 重启 Claude Code2. 在对话里说:「用 agentlens 扫描当前项目」,或输入 `/agentlens`3. Claude 会调用 `agentlens_scan` 等工具,返回结果
**验证**:输入 `/mcp` 查看 agentlens 是否已连接。
---
## 2. Cursor
**接入方式**:VS Code 扩展(图形面板)+ MCP 工具
**图形界面接入(推荐)**:1. 双击 `ext/vscode/agentlens-0.2.0.vsix` 安装2. 重启 Cursor3. `Cmd+Shift+P` 输入 `AgentLens` → 选择「打开设置面板」4. 面板里有按钮:扫描配置 / 迁移规则 / 检测漂移 / 体检文件 / 一键接入所有 App
**MCP 接入**:
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js install --target cursor```
写入 `.cursor/mcp.json`。
**怎么用**:重启 Cursor 后,对话里直接说「用 agentlens 扫描项目」,或在面板里点按钮。
---
## 3. Codex
**接入方式**:MCP 工具 + Skill
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js install --target codex```
**接入后**:- MCP:`.mcp.json`(项目级)- Skill:`~/.codex/skills/agentlens/SKILL.md`
**怎么用**:重启 Codex,对话里说「用 agentlens 扫描」,或输入 `/agentlens`。
---
## 4. ZCode
**接入方式**:MCP 工具 + Skill
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js install --target zcode```
**接入后**:- MCP:`~/.zcode/mcp.json` 的 `mcpServers.agentlens`- Skill:`~/.zcode/skills/agentlens/SKILL.md`
**怎么用**:重启 ZCode,对话里说「用 agentlens 扫描」或输入 `/agentlens`。
---
## 5. WorkBuddy
**接入方式**:MCP 工具 + Skill
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js install --target workbuddy```
**接入后**:- MCP:`~/.workbuddy/mcp.json` 的 `mcpServers.agentlens`- Skill:`~/.workbuddy/skills/agentlens/SKILL.md`
**怎么用**:重启 WorkBuddy,在设置 → MCP 里能看到 agentlens;对话中说「用 agentlens 扫描」或 `/agentlens`。
---
## 6. MiMo Desktop
**接入方式**:MCP 工具 + Skill(该 App 未开放输入区 UI 插件接口,无法加自定义按钮)
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js install --target mimo```
**接入后**:- MCP:`~/.config/mimocode/mimocode.jsonc` 的 `mcp.agentlens`- Skill:`~/.agents/skills/agentlens/SKILL.md`
**怎么用**:1. 重启 MiMo Desktop2. 设置 → MCP 里能看到 agentlens3. 对话里说「用 agentlens 扫描项目」,或输入 `/agentlens`
**关于「完全访问」旁的按钮**:MiMo Desktop 的渲染层没有给第三方开放 UI 插件接口(没有 slot / ModuleLoader 机制),所以无法在「完全访问」旁加按钮。最接近的替代是 `/agentlens` 斜杠命令(输入框敲 `/` 就出现)。
---
## 7. DSH(DeepSeek Harness)
**接入方式**:客户端插件(输入区按钮 + 设置页面板)+ Host 工具
**接入**:1. 插件已复制到 `~/DSH-Plugins/agentlens/`2. 已注册到 `~/.dsh/profiles/desktop/package.json`(dependency + bundles)3. **⌘Q 完全退出 DSH,重新打开**
**接入后**:- **输入区**:「完全访问」旁边多一个「🩺 体检」按钮 → 点击扫描当前项目,弹窗显示结果- **设置页**:新增「AgentLens 迁移」区块 → 路径选择 + 扫描 + 源/目标 Agent 迁移 + 一键接入所有 App
**怎么用**:点「🩺 体检」按钮,或进设置页用迁移面板。
---
## 各 App 对比
| App | MCP | Skill | 图形按钮/面板 ||---|---|---|---|| Claude Code | ✅ | ✅ `/agentlens` | — || Cursor | ✅ | — | ✅ VS Code 扩展面板 || Codex | ✅ | ✅ `/agentlens` | — || ZCode | ✅ | ✅ `/agentlens` | — || WorkBuddy | ✅ | ✅ `/agentlens` | — || MiMo Desktop | ✅ | ✅ `/agentlens` | —(产品未开放 UI 接口) || DSH | ✅ | — | ✅ 输入区「体检」按钮 + 设置「迁移」面板 |
## 不需要任何 App 的用法
```bashnode ~/Downloads/mimo/agentlens/dist/cli/index.js scan --path ~/项目node ~/Downloads/mimo/agentlens/dist/cli/index.js move --from cursor --to claude --path ~/项目node ~/Downloads/mimo/agentlens/dist/cli/index.js check src/index.js --path ~/项目```110 unmodified lines111112113114115116110 unmodified linesnode ~/Downloads/mimo/agentlens/dist/cli/index.js check src/index.js --path ~/你的项目```### 各 App 接入后长什么样| App | 接入后你会看到什么 | 怎么触发 |110 unmodified lines111112113114115116117118110 unmodified linesnode ~/Downloads/mimo/agentlens/dist/cli/index.js check src/index.js --path ~/你的项目```### 各软件接入指南(详细版见 [INTEGRATION.md](INTEGRATION.md))### 各 App 接入后长什么样| App | 接入后你会看到什么 | 怎么触发 |
68 unmodified lines697071727374153 unmodified lines22822923023123223368 unmodified linesreturn String(d.text || '');}async function callMigrate(path, from, to) {const r = await fetch('/agentlens/migrate', {method: 'POST',153 unmodified lines'button',{ type: 'button', disabled: busy !== '' || from === to, onClick: doMigrate },busy === 'migrate' ? '迁移中…' : '开始迁移')),error ? h('p', { className: 'agentlens-hint', style: { color: '#ff8a80' } }, `出错了:${error}`) : null,68 unmodified lines69707172737475767778798081153 unmodified lines23523623723823924024124224324424524624724824925025125225325425525625725825926068 unmodified linesreturn String(d.text || '');}async function callInstall() {const r = await fetch('/agentlens/install', { method: 'POST', credentials: 'same-origin' });const d = await r.json();if (!r.ok || d.ok === false) throw new Error(d.error || `HTTP ${r.status}`);return String(d.text || '');}async function callMigrate(path, from, to) {const r = await fetch('/agentlens/migrate', {method: 'POST',153 unmodified lines'button',{ type: 'button', disabled: busy !== '' || from === to, onClick: doMigrate },busy === 'migrate' ? '迁移中…' : '开始迁移'),h('button',{type: 'button',disabled: busy !== '',title: '把 AgentLens 接入本机所有检测到的 AI 工具(相当于跑一次 agentlens install)',onClick: async () => {setBusy('install');setError('');try {setOut(await callInstall());} catch (err) {setError(String((err && err.message) || err));} finally {setBusy('');}},},busy === 'install' ? '接入中…' : '一键接入所有 App')),error ? h('p', { className: 'agentlens-hint', style: { color: '#ff8a80' } }, `出错了:${error}`) : null,
99 unmodified lines10010110210310410510610799 unmodified lines},};const disposers = [];for (const route of [scanRoute, migrateRoute]) {try {disposers.push(server.register(route));} catch (error) {99 unmodified lines10010110210310410510610710810911011111211311411511611711811912099 unmodified lines},};const installRoute = {kind: "exact",path: "/agentlens/install",async handler(req, res) {try {const text = await runAgentlens(entry, ["install", "--target", "all"], process.cwd());json(res, 200, { ok: true, text });} catch (error) {json(res, 500, { ok: false, error: String((error && error.message) || error) });}},};const disposers = [];for (const route of [scanRoute, migrateRoute, installRoute]) {try {disposers.push(server.register(route));} catch (error) {
123456261 unmodified lines26826927027127227327427527627727827944 unmodified lines324325326327328329import * as vscode from "vscode";import { readFileSync, existsSync, readdirSync, statSync, mkdirSync, writeFileSync } from "node:fs";import { resolve, join, dirname } from "node:path";import {parsers,generateConfig,261 unmodified lines);panel.onDidDispose(() => { panel = undefined; });panel.webview.html = getPanelHtml();const root = getWorkspaceRoot();if (root) updatePanelContent(root);}}));// === Auto check on save (if enabled) ===context.subscriptions.push(vscode.workspace.onDidSaveTextDocument(async (doc) => {44 unmodified lines<button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'move'});})()">迁移规则</button><button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'drift'});})()">检测漂移</button><button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'check'});})()">体检文件</button></div><div id="results"><p class="empty">点击「扫描配置」开始</p></div><script>1234567261 unmodified lines26927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033144 unmodified lines376377378379380381382import * as vscode from "vscode";import { readFileSync, existsSync, readdirSync, statSync, mkdirSync, writeFileSync } from "node:fs";import { resolve, join, dirname } from "node:path";import { homedir } from "node:os";import {parsers,generateConfig,261 unmodified lines);panel.onDidDispose(() => { panel = undefined; });panel.webview.html = getPanelHtml();// Wire the panel buttons to real commands — without this the buttons do nothing.panel.webview.onDidReceiveMessage(async (msg) => {switch (msg?.command) {case "scan":await vscode.commands.executeCommand("agentlens.scan");break;case "move":await vscode.commands.executeCommand("agentlens.move");break;case "drift":await vscode.commands.executeCommand("agentlens.drift");break;case "check":await vscode.commands.executeCommand("agentlens.checkFile");break;case "install":await vscode.commands.executeCommand("agentlens.installAll");break;default:break;}});const root = getWorkspaceRoot();if (root) updatePanelContent(root);}}));// === One-click install into every detected AI app ===context.subscriptions.push(vscode.commands.registerCommand("agentlens.installAll", async () => {const { execFile } = await import("node:child_process");const { promisify } = await import("node:util");const execFileAsync = promisify(execFile);const entry = (context as any).extensionPath? resolve((context as any).extensionPath, "agentlens-cli", "index.js"): undefined;const cli = entry && existsSync(entry) ? entry : join(homedir(), "Downloads", "mimo", "agentlens", "dist", "cli", "index.js");if (!existsSync(cli)) {vscode.window.showWarningMessage("AgentLens: 找不到安装器入口(需要先构建 agentlens 项目)");return;}try {const { stdout, stderr } = await execFileAsync(process.execPath, [cli, "install", "--target", "all"], { timeout: 120_000 });outputChannel.clear();outputChannel.appendLine(stdout || "");if (stderr) outputChannel.appendLine(stderr);outputChannel.show();vscode.window.showInformationMessage("AgentLens: 已接入所有检测到的 AI 工具(重启对应 App 生效)");} catch (err: any) {vscode.window.showErrorMessage(`AgentLens 接入失败: ${err?.message ?? err}`);}}));// === Auto check on save (if enabled) ===context.subscriptions.push(vscode.workspace.onDidSaveTextDocument(async (doc) => {44 unmodified lines<button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'move'});})()">迁移规则</button><button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'drift'});})()">检测漂移</button><button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'check'});})()">体检文件</button><button class="btn" onclick="(function(){const v=acquireVsCodeApi();v.postMessage({command:'install'});})()">一键接入所有 App</button></div><div id="results"><p class="empty">点击「扫描配置」开始</p></div><script>
INTEGRATION.mdAdded+158
README.md+2
ext/dsh-plugin/client.js+27
ext/dsh-plugin/index.js+14-1
ext/vscode/agentlens-0.2.0.vsixAdded
ext/vscode/src/extension.ts+53