mcp%3Asetup-codemap-cli by neolabhq/context-engineering-kit
npx skills add https://github.com/neolabhq/context-engineering-kit --skill mcp:setup-codemap-cli$ARGUMENTS
询问用户希望将配置存储在何处:
选项:
./CLAUDE.md
* 钩子设置保存至:./.claude/settings.json./CLAUDE.local.md
* 钩子设置保存至:./.claude/settings.local.json
* 请确认这些文件已列入 .gitignore,若未列出则添加~/.claude/CLAUDE.md
* 钩子设置保存至:~/.claude/settings.json广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
存储用户的选择,并在后续步骤中使用相应的路径。
通过运行 codemap -help 来检查 codemap 是否已安装。
如果未安装,则继续执行设置。
阅读以下文档以了解 Codemap 的功能:
brew tap JordanCoin/tap && brew install codemap
scoop bucket add codemap https://github.com/JordanCoin/scoop-codemap
scoop install codemap
安装后,验证 codemap 是否正常工作:
codemap .
使用步骤 1 中确定的路径。成功安装 Codemap 后,使用以下内容更新相应的 CLAUDE.md 文件:
## 使用 Codemap CLI 进行代码库导航
Codemap CLI 可用于智能代码库可视化和导航。
**必需用法** - 您必须使用 `codemap --diff --ref master` 来研究与默认分支不同的更改,并使用 `git diff` + `git status` 来研究当前工作状态。
### 快速开始
```bash
codemap . # 项目树
codemap --only swift . # 仅显示 Swift 文件
codemap --exclude .xcassets,Fonts,.png . # 隐藏资源文件
codemap --depth 2 . # 限制深度
codemap --diff # 与 main 分支的差异
codemap --deps . # 依赖关系流
| 标志 | 描述 |
|---|---|
--depth, -d <n> | 限制树深度(0 = 无限制) |
--only <exts> | 仅显示具有这些扩展名的文件 |
--exclude <patterns> | 排除匹配模式的文件 |
--diff | 显示与 main 分支相比已更改的文件 |
--ref <branch> | 要与之比较的分支(与 --diff 一起使用) |
--deps | 依赖关系流模式 |
--importers <file> | 检查谁导入了某个文件 |
--skyline | 城市天际线可视化 |
--json | 输出 JSON |
智能模式匹配 - 无需引号:
.png - 任何 .png 文件Fonts - 任何 /Fonts/ 目录*Test* - 通配符模式查看您正在处理的内容:
codemap --diff
codemap --diff --ref develop
如果默认分支不是 `main`,而是 `master`(或其他分支),请相应更新内容:
- 使用 `codemap --diff --ref master` 代替常规的 `codemap --diff`
## 7. 更新 .gitignore 文件
更新 .gitignore 文件以包含 `.codemap/` 目录:
```text
.codemap/
运行快速测试以验证一切正常:
codemap .
codemap --diff
使用步骤 1 中确定的设置路径。如果设置文件不存在,请创建它并添加以下内容:
{
"hooks": {
"session-start": "codemap hook session-start && echo 'git diff:' && git diff --stat && echo 'git status:' && git status"
}
}
如果默认分支不是 main,而是 master(或其他分支),请相应更新内容:
* 使用 `codemap hook session-start --ref=master` 代替常规的 `codemap hook session-start`
* 对于其余命令,也请添加 `--ref=master` 标志。
| 命令 | 触发器 | 描述 |
|---|---|---|
codemap hook session-start | SessionStart | 完整树、中心节点、分支差异、上次会话上下文 |
codemap hook pre-edit | PreToolUse (Edit | Write) |
codemap hook post-edit | PostToolUse (Edit | Write) |
codemap hook prompt-submit | UserPromptSubmit | 提及文件的中心节点上下文 + 会话进度 |
codemap hook pre-compact | PreCompact | 将中心节点状态保存到 .codemap/hubs.txt |
codemap hook session-stop | SessionEnd | 包含行数和统计信息的编辑时间线 |
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook session-start"
}
]
}
],
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "codemap hook pre-edit"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "codemap hook post-edit"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook prompt-submit"
}
]
}
],
"PreCompact": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook pre-compact"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook session-stop"
}
]
}
]
}
}
每周安装数
181
代码仓库
GitHub 星标数
699
首次出现
2026年2月19日
已安装于
opencode175
codex174
github-copilot174
gemini-cli173
kimi-cli171
cursor171
User Input:
$ARGUMENTS
Ask the user where they want to store the configuration:
Options:
Project level (shared via git) - Configuration tracked in version control, shared with team
./CLAUDE.md./.claude/settings.jsonProject level (personal preferences) - Configuration stays local, not tracked in git
./CLAUDE.local.md./.claude/settings.local.json.gitignore, add them if notUser level (global) - Configuration applies to all projects for this user
~/.claude/CLAUDE.md~/.claude/settings.jsonStore the user's choice and use the appropriate paths in subsequent steps.
Check whether codemap is installed by running codemap -help.
If not installed, proceed with setup.
Read the following documentation to understand Codemap's capabilities:
brew tap JordanCoin/tap && brew install codemap
scoop bucket add codemap https://github.com/JordanCoin/scoop-codemap
scoop install codemap
After installation, verify codemap works:
codemap .
Use the path determined in step 1. Once Codemap is successfully installed, update the appropriate CLAUDE.md file with the following content:
## Use Codemap CLI for Codebase Navigation
Codemap CLI is available for intelligent codebase visualization and navigation.
**Required Usage** - You MUST use `codemap --diff --ref master` to research changes different from default branch, and `git diff` + `git status` to research current working state.
### Quick Start
```bash
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
| 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 |
Smart pattern matching - no quotes needed:
.png - any .png fileFonts - any /Fonts/ directory*Test* - glob patternSee what you're working on:
codemap --diff
codemap --diff --ref develop
if the default branch is not `main`, but instead `master` (or something else) update content accordingly:
- use `codemap --diff --ref master` instead of regular `codemap --diff`
## 7. Update .gitignore file
Update .gitignore file to include `.codemap/` directory:
```text
.codemap/
Run a quick test to verify everything works:
codemap .
codemap --diff
Use the settings path determined in step 1. Create the settings file if it doesn't exist and add the following content:
{
"hooks": {
"session-start": "codemap hook session-start && echo 'git diff:' && git diff --stat && echo 'git status:' && git status"
}
}
if default branch is not main, but instead master (or something else) update content accordingly:
* use `codemap hook session-start --ref=master` instead of regular `codemap hook session-start`
* For rest of commands also add `--ref=master` flag.
| Command | Trigger | Description |
|---|---|---|
codemap hook session-start | SessionStart | Full tree, hubs, branch diff, last session context |
codemap hook pre-edit | PreToolUse (Edit | Write) |
codemap hook post-edit | PostToolUse (Edit | Write) |
codemap hook prompt-submit | UserPromptSubmit | Hub context for mentioned files + session progress |
codemap hook pre-compact |
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook session-start"
}
]
}
],
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "codemap hook pre-edit"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "codemap hook post-edit"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook prompt-submit"
}
]
}
],
"PreCompact": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook pre-compact"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "codemap hook session-stop"
}
]
}
]
}
}
Weekly Installs
181
Repository
GitHub Stars
699
First Seen
Feb 19, 2026
Installed on
opencode175
codex174
github-copilot174
gemini-cli173
kimi-cli171
cursor171
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
111,800 周安装
Docker安全指南:全面容器安全最佳实践、漏洞扫描与合规性要求
177 周安装
iOS开发专家技能:精通Swift 6、SwiftUI与原生应用开发,涵盖架构、性能与App Store合规
177 周安装
describe技能:AI驱动结构化测试用例生成,提升代码质量与评审效率
2 周安装
专业 README 生成器 | 支持 Rust/TypeScript/Python 项目,自动应用最佳实践
2 周安装
Django 6 升级指南:从 Django 5 迁移的完整步骤与重大变更解析
1 周安装
GitLab DAG与并行处理指南:needs与parallel优化CI/CD流水线速度
2 周安装
--importers <file> | Check who imports a file |
--skyline | City skyline visualization |
--json | Output JSON |
| PreCompact |
| Saves hub state to .codemap/hubs.txt |
codemap hook session-stop | SessionEnd | Edit timeline with line counts and stats |