Devmap

io.github.itsflaid由 GitHub 账号 itsflaid 发布v0.9.0更新于 Nov 7, 2026

Query a codebase map (routes, features, flows, impact) built by static analysis.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

DevMap 提供由静态分析预先生成的代码库地图,让助手查询功能、路由、流程、依赖关系与改动影响。

可以做什么
  • 获取项目概览:框架、统计、入口点、关键文件、功能与路由数量
  • 查看整个项目、单个功能或单个文件的依赖关系,并按关键词定位代码
  • 追踪某个功能或 API 请求的端到端流程,列出页面与 API 路由及其处理文件和 HTTP 方法
  • 评估修改某个文件的影响,包括直接与传递依赖方及受影响的功能
  • 重新分析项目以刷新快照,仅写入 .devmap 目录内
适用场景
适合助手在已有代码库上工作时先建立整体认识,避免逐个读取大量文件,或在修改共享文件前确认影响范围。适用于所支持的前端与后端技术栈,其中 Next.js 与 Express 的分析最深入。
运行要求
通过 npx 从 npm 包 @flaid/devmap 以 stdio 在本地运行,需要 Node.js 22.12 或更高版本。需先构建快照(例如运行 devmap analyze)。除非启用 AI 解读,MCP 服务器本身不需要 API 密钥。
安装前请注意
服务器默认只读且仅做静态分析,但 devmap_analyze 会写入 .devmap/ 内,且可由助手触发;以 --auto-refresh 或 --allow-ai 启动会改变这一行为。快照过期时结果可能已过时。CLI 的可选 AI 配置会把提供商 API 密钥保存在本地配置文件中,并向该提供商发送请求,但不会发送完整仓库源码。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Devmap,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

DevMap

[npm version] [license] [node]

Analyze once. Reuse context everywhere. A CLI that maps your codebase for developers and AI agents: entry points, critical files, features and routes.

Documentation · Website · GitHub

Every new AI chat about your code starts from zero — you re-explain the same codebase every time. DevMap fixes that.

It's a CLI that combines static analysis with optional AI interpretation to build a structured, reusable understanding layer of your project — once. That layer (.devmap/index.json, feature maps, DEVMAP.md) is what you and any AI agent read afterward, instead of re-scanning or re-pasting the whole repo. Full repo source stays local — nothing gets sent wholesale to the AI model.

Install

bash
npm install --global @flaid/devmap

Or run without a global install:

bash
npx @flaid/devmap --help

Requirements

  • Node.js 22.12 or newer
  • An API key for an AI provider: Groq, OpenRouter, or any custom OpenAI-compatible endpoint

Static analysis still works when AI is not configured.

Quick Start

Run these commands from the root of the project you want to understand:

bash
devmap initdevmap analyzedevmap onboardingdevmap doctor

devmap init selects a provider, validates its key, stores configuration locally, prepares .devmap/, generates DEVMAP.md, and integrates with AGENTS.md safely.

AI Provider Setup

Choose Groq, OpenRouter, or a custom OpenAI-compatible endpoint with the arrow keys during:

bash
devmap init

Groq keys are available at https://console.groq.com/keys. OpenRouter keys are available at https://openrouter.ai/keys.

For custom endpoints, DevMap asks for the base URL (prefilled with http://localhost:20128/v1) and lists the models your server exposes, so any OpenAI-compatible self-hosted gateway works out of the box.

For OpenRouter, DevMap prompts:

txt
OpenRouter model [openrouter/free]:

Press Enter to use the free router, or type any free or paid OpenRouter model ID. The selected model is saved and used as the primary choice.

For non-interactive Groq setup:

bash
GROQ_API_KEY="your-key" devmap init

On PowerShell:

powershell
$env:GROQ_API_KEY="your-key"devmap initRemove-Item Env:GROQ_API_KEY

For non-interactive OpenRouter setup:

bash
OPENROUTER_API_KEY="your-key" devmap init

The key is stored locally in ~/.devmap/config.json. Requests go directly from your machine to the selected provider. DevMap does not send the key to a DevMap-owned server.

Commands

bash
devmap initdevmap analyzedevmap analyze --freshdevmap map                    # full project mapdevmap map <feature-or-file>  # scoped to one feature or filedevmap flow                   # curated top flowsdevmap flow <feature-or-route>devmap explain <target>       # file, feature, or functiondevmap onboarding --writedevmap onboarding --write --language iddevmap doctordevmap config model autodevmap mcp                    # run as an MCP server

Groq and OpenRouter use the model selected during init. Change either provider's model with:

bash
devmap config model <model-id>devmap config model auto

MCP Server

devmap mcp runs DevMap as a Model Context Protocol server over stdio. An AI agent asks the project map questions with tool calls and gets structured JSON back, instead of reading a whole context file up front.

bash
devmap analyzeclaude mcp add devmap -- npx -y @flaid/devmap mcp

Other clients launch the same command (npx -y @flaid/devmap mcp) as a stdio server:

json
{  "mcpServers": {    "devmap": {      "command": "npx",      "args": ["-y", "@flaid/devmap", "mcp"]    }  }}

Tools: devmap_overview, devmap_map, devmap_flow, devmap_routes, devmap_impact, devmap_find, devmap_analyze and, only with --allow-ai, devmap_explain.

The server is read-only and static by default: no AI provider is contacted unless you start it with --allow-ai, and it only writes inside .devmap/ when the agent calls devmap_analyze or you start it with --auto-refresh. Every answer reports whether the snapshot is stale. See the MCP guide for client setup and tool inputs.

Generated Context

DevMap generates:

  • .devmap/index.json for lightweight AI-agent navigation
  • .devmap/features/*.json for focused feature maps and source priority
  • .devmap/snapshot.json for the full structured project analysis archive
  • DEVMAP.md for human and AI-agent usage guidance
  • a small DevMap block in AGENTS.md only after confirmation when the file already exists

Existing AGENTS.md and DEVMAP.md files are never overwritten.

For AI Agents

Read .devmap/index.json first, open the relevant feature map, and inspect its sourcePriority files. Use .devmap/snapshot.json only when the lightweight navigation layer is insufficient.

Use --json for scripts, editors, CI, or AI agents:

bash
devmap analyze --jsondevmap onboarding --jsondevmap doctor --json

JSON mode writes one parseable JSON document to stdout without ANSI colors, terminal decoration, or streamed partial output.

Supported Stacks

  • Frontend: Next.js, Astro, SvelteKit, Nuxt, Remix, React Router v7, TanStack Router/Start, Expo Router, SolidStart, Qwik City, Angular, React, Vue, Svelte
  • Backend: Express, NestJS, Fastify, Hono, Elysia, Koa, AdonisJS

Detection covers the full list above; Next.js and Express receive the deepest analysis. Multi-package workspaces are classified per project type, so a monorepo containing a CLI and a web app is reported as both.

Privacy

  • Project analysis runs locally before AI interpretation.
  • Full repository source is not sent to the selected provider.
  • .env files and common generated directories are ignored.
  • API keys are stored locally and should never be committed.

Links

License

MIT

来源:packages/cli/README.md,提交 2c9a5e8

工具

7

devmap_overview

Project overview

Entry point for understanding the project: framework, stats, entry points, most critical files, detected features, flows and route counts. Call this first.

无需输入参数。

devmap_map

Dependency map

Dependency map for the whole project (omit target), one feature (feature name) or one file (project-relative path): what it imports, what imports it, and related files. Use it to find where to look before reading code.

输入参数depthtargetincludeMermaid

devmap_flow

Trace a flow

Trace how a feature or API request works end to end (ordered steps with file paths). Omit target to list the curated top flows. Static analysis only, no AI.

输入参数alltarget

devmap_routes

List routes

List detected page and API routes with their handler file and HTTP methods. Filter by kind, path prefix or method.

输入参数kindlimitmethodprefix

devmap_impact

Change impact

What is affected if a file changes: direct and transitive dependents (follow imports up to `depth` hops), affected features, critical dependents, areas likely impacted, and what it imports. Call this before editing a shared file.

输入参数file必填depthlimit

devmap_find

Find code

Locate features, files and routes by keyword using DevMap's index (paths, exported symbols, function names, search terms, purposes). Faster and more precise than grepping the whole repo for a concept.

输入参数limitquery必填

devmap_analyze

Refresh the project map

Re-analyze the project and refresh the DevMap snapshot (writes only inside .devmap/). Call it when a result reports snapshot.stale = true, or when no snapshot exists. Returns status "unchanged" without re-analyzing if no file changed (pass fresh: true to force a full rebuild). Static analysis only: no AI is used, so AI-derived data (domain, architecture) is not regenerated and aiDataDropped is reported when it is lost. If it takes longer than timeoutSeconds it keeps running in the background and status is "running"; call again to wait for it.

输入参数freshtimeoutSeconds

版本历史

1
  1. v0.9.0最新Oct 31, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分