Co-Pilot / 辅助式
更新于 24 days ago

codemap

JJordanCoin
0.4k
jordancoin/codemap
80
Agent 评分

💡 摘要

Codemap通过分析项目结构和依赖关系,为AI提供架构上下文。

🎯 适合人群

软件开发人员项目经理DevOps工程师技术架构师开源贡献者

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);文件读写范围与路径穿越风险。以最小权限运行,并在生产环境启用前审计代码与依赖。

codemap 🗺️

Run in Smithery

codemap — a project brain for your AI. Give LLMs instant architectural context without burning tokens.

License Go

codemap screenshot

Install

# macOS/Linux brew tap JordanCoin/tap && brew install codemap # Windows scoop bucket add codemap https://github.com/JordanCoin/scoop-codemap scoop install codemap

Other options: Releases | go install | Build from source

Quick Start

codemap . # Project tree codemap --only swift . # Just Swift files codemap --exclude .xcassets,Fonts,.png . # Hide assets codemap --depth 2 . # Limit depth codemap --diff # What changed vs main codemap --deps . # Dependency flow codemap github.com/user/repo # Remote GitHub repo

Options

| Flag | Description | |------|-------------| | --depth, -d <n> | Limit tree depth (0 = unlimited) | | --only <exts> | Only show files with these extensions | | --exclude <patterns> | Exclude files matching patterns | | --diff | Show files changed vs main branch | | --ref <branch> | Branch to compare against (with --diff) | | --deps | Dependency flow mode | | --importers <file> | Check who imports a file | | --skyline | City skyline visualization | | --animate | Animate the skyline (use with --skyline) | | --json | Output JSON |

Note: Flags must come before the path/URL: codemap --json github.com/user/repo

Smart pattern matching — no quotes needed:

  • .png → any .png file
  • Fonts → any /Fonts/ directory
  • *Test* → glob pattern

Modes

Diff Mode

See what you're working on:

codemap --diff codemap --diff --ref develop
╭─────────────────────────── myproject ──────────────────────────╮
│ Changed: 4 files | +156 -23 lines vs main                      │
╰────────────────────────────────────────────────────────────────╯
├── api/
│   └── (new) auth.go         ✎ handlers.go (+45 -12)
└── ✎ main.go (+29 -3)

⚠ handlers.go is used by 3 other files

Dependency Flow

See how your code connects:

codemap --deps .
╭──────────────────────────────────────────────────────────────╮
│                    MyApp - Dependency Flow                   │
├──────────────────────────────────────────────────────────────┤
│ Go: chi, zap, testify                                        │
╰──────────────────────────────────────────────────────────────╯

Backend ════════════════════════════════════════════════════
  server ───▶ validate ───▶ rules, config
  api ───▶ handlers, middleware

HUBS: config (12←), api (8←), utils (5←)

Skyline Mode

codemap --skyline --animate

codemap skyline

Remote Repos

Analyze any public GitHub or GitLab repo without cloning it yourself:

codemap github.com/anthropics/anthropic-cookbook codemap https://github.com/user/repo codemap gitlab.com/user/repo

Uses a shallow clone to a temp directory (fast, no history, auto-cleanup). If you already have the repo cloned locally, codemap will use your local copy instead.

Supported Languages

18 languages for dependency analysis: Go, Python, JavaScript, TypeScript, Rust, Ruby, C, C++, Java, Swift, Kotlin, C#, PHP, Bash, Lua, Scala, Elixir, Solidity

Powered by ast-grep. Install via brew install ast-grep for --deps mode.

Claude Integration

Hooks (Recommended) — Automatic context at session start, before/after edits, and more. → See docs/HOOKS.md

MCP Server — Deep integration with 7 tools for codebase analysis. → See docs/MCP.md

CLAUDE.md — Add to your project root to teach Claude when to run codemap:

cp /path/to/codemap/CLAUDE.md your-project/

Roadmap

  • [x] Diff mode, Skyline mode, Dependency flow
  • [x] Tree depth limiting (--depth)
  • [x] File filtering (--only, --exclude)
  • [x] Claude Code hooks & MCP server
  • [x] Remote repo support (GitHub, GitLab)
  • [ ] Enhanced analysis (entry points, key types)

Contributing

  1. Fork → 2. Branch → 3. Commit → 4. PR

License

MIT

五维分析
清晰度8/10
创新性8/10
实用性9/10
完整性8/10
可维护性7/10
优缺点分析

优点

  • 支持多种编程语言。
  • 提供可视化以便于理解。
  • 易于与现有工作流程集成。

缺点

  • 远程分析仅限于公共存储库。
  • 可能需要额外设置以实现完整功能。

相关技能

ccmp

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

claude-mods

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

agentic-qe

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 JordanCoin.