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 分