Setup Codemap Cli

NeoLabHQ/context-engineering-kit/antigravity/skills/setup-codemap-cli

作者 NeoLabHQ23e2428e809d77717f8acc9659c374a3a1fcb93e無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Guide for setup Codemap CLI for intelligent codebase visualization and navigation

AI 產生的概覽

指導安裝與設定 Codemap CLI,用於程式碼庫視覺化與導覽。

功能
引導使用者選擇設定範圍,檢查 Codemap 是否已安裝,並透過 Homebrew 或 Scoop 安裝。接著更新 CLAUDE.md 檔案以加入 Codemap 使用說明,將 .codemap/ 加入 .gitignore,並在 Claude 設定檔中設定工作階段鉤子。最後以測試指令驗證安裝。
適用情境
適用於使用者想在專案或全域範圍設定 Codemap CLI 的情況。適合為程式碼庫導覽與以鉤子為基礎的工作階段脈絡導入 Codemap。
執行需求
需要 Codemap CLI,在 macOS/Linux 上透過 Homebrew 安裝,在 Windows 上透過 Scoop 安裝,並需要網路存取以取得 Codemap 文件。會修改 CLAUDE.md、.gitignore 與 Claude 設定檔。此技能未附帶指令碼。

User Input:

text
$ARGUMENTS

Guide for setup Codemap CLI

1. Determine setup context

Ask the user where they want to store the configuration:

Options:

  1. Project level (shared via git) - Configuration tracked in version control, shared with team

    • CLAUDE.md updates go to: ./CLAUDE.md
    • Hook settings go to: ./.claude/settings.json
  2. Project level (personal preferences) - Configuration stays local, not tracked in git

    • CLAUDE.md updates go to: ./CLAUDE.local.md
    • Hook settings go to: ./.claude/settings.local.json
    • Verify these files are listed in .gitignore, add them if not
  3. User level (global) - Configuration applies to all projects for this user

    • CLAUDE.md updates go to: ~/.claude/CLAUDE.md
    • Hook settings go to: ~/.claude/settings.json

Store the user's choice and use the appropriate paths in subsequent steps.

2. Check if Codemap is already installed

Check whether codemap is installed by running codemap -help.

If not installed, proceed with setup.

3. Load Codemap documentation

Read the following documentation to understand Codemap's capabilities:

4. Guide user through installation

macOS/Linux (Homebrew)

bash
brew tap JordanCoin/tap && brew install codemap

Windows (Scoop)

bash
scoop bucket add codemap https://github.com/JordanCoin/scoop-codemapscoop install codemap

5. Verify installation

After installation, verify codemap works:

bash
codemap .

6. Update CLAUDE.md file

Use the path determined in step 1. Once Codemap is successfully installed, update the appropriate CLAUDE.md file with the following content:

markdown
## 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
```bashcodemap .                    # Project treecodemap --only swift .       # Just Swift filescodemap --exclude .xcassets,Fonts,.png .  # Hide assetscodemap --depth 2 .          # Limit depthcodemap --diff               # What changed vs maincodemap --deps .             # Dependency flow

Options

FlagDescription
--depth, -d <n>Limit tree depth (0 = unlimited)
--only <exts>Only show files with these extensions
--exclude <patterns>Exclude files matching patterns
--diffShow files changed vs main branch
--ref <branch>Branch to compare against (with --diff)
--depsDependency flow mode
--importers <file>Check who imports a file
--skylineCity skyline visualization
--jsonOutput JSON

Smart pattern matching - no quotes needed:

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

Diff Mode

See what you're working on:

bash
codemap --diffcodemap --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/

8. Test Codemap

Run a quick test to verify everything works:

bash
codemap .codemap --diff

9. Add hooks to settings file

  • Use the settings path determined in step 1. Create the settings file if it doesn't exist and add the following content:

    json
    {    "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.
  • Ask user whether he want to add any other hooks and provide list of options with descriptions. Add hooks that he asks for.

Available Hooks

CommandTriggerDescription
codemap hook session-startSessionStartFull tree, hubs, branch diff, last session context
codemap hook pre-editPreToolUse (Edit|Write)Who imports file + what hubs it imports
codemap hook post-editPostToolUse (Edit|Write)Impact of changes (same as pre-edit)
codemap hook prompt-submitUserPromptSubmitHub context for mentioned files + session progress
codemap hook pre-compactPreCompactSaves hub state to .codemap/hubs.txt
codemap hook session-stopSessionEndEdit timeline with line counts and stats

Example of file with full hooks configuration

json
{  "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"          }        ]      }    ]  }}

來源與署名

來源:NeoLabHQ/context-engineering-kit位於antigravity/skills/setup-codemap-cli提交23e2428

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架