codemapper
Codemapper
Code analysis tool (cm) for exploring structure, symbols, dependencies, and call graphs.
All commands support --format ai for concise, AI-friendly output.
Code Statistics
cm stats . --format ai # Current directory
cm stats ./src --format ai # Specific directory
Code Map
cm map . --level 2 --format ai # Basic overview
cm map . --level 3 --format ai # Detailed structure
cm map . --level 2 --exports-only --format ai # Public API only
cm map ./src --level 2 --format ai # Specific directory
Detail levels:
- Level 1: Files and directories only
- Level 2: Files with exported symbols
- Level 3: Files with all symbols and details
Query Symbols
cm query authenticate . --format ai # Fuzzy search
cm query User . --exact --format ai # Exact match
cm query validate . --show-body --format ai # Show implementation
cm query process . --exports-only --format ai # Public only
Call Graph Analysis
# Find callers of a function
cm callers processData . --format ai
cm callers UserService.get . --format ai
# Find callees (what a function calls)
cm callees processData . --format ai
cm callees UserService . --format ai
# Trace call path
cm call-path functionToFind . --format ai
cm call-path functionToFind --reverse --format ai
Dependency Analysis
cm deps . --format ai # List all dependencies
cm deps . --circular --format ai # Detect circular deps
cm deps . --unused --format ai # Find unused deps
cm deps . --unused-symbols --format ai # Find unused symbols
Finding Tests
cm tests functionName . --format ai # Find tests for function
cm untested . --format ai # Find untested code
Common Workflows
Code Exploration
cm map . --level 2 --format ai # Get overview
cm query User . --format ai # Find symbols
cm deps . --format ai # Understand deps
Refactoring Preparation
cm tests functionToRefactor . --format ai # Check test coverage
cm callers functionToRefactor . --format ai # Find callers to update
cm callees functionToRefactor . --format ai # Find callees
cm deps . --circular --format ai # Check for cycles
Tips
- Use
--format aifor concise output - Use
--level 2for overview,--level 3for details - Use
--exports-onlyto see public API - Use
--show-bodyto see implementation details - Use
--exactfor precise matching
More from knoopx/pi
podman
Manages containers, builds images, configures pods and networks with Podman. Use when running containers, creating Containerfiles, grouping services in pods, or managing container resources.
122jujutsu
Manages version control with Jujutsu (jj), including rebasing, conflict resolution, and Git interop. Use when tracking changes, navigating history, squashing/splitting commits, or pushing to Git remotes.
117nix-flakes
Creates reproducible builds, manages flake inputs, defines devShells, and builds packages with flake.nix. Use when initializing Nix projects, locking dependencies, or running nix build/develop commands.
54scraping
Fetches web pages, parses HTML with CSS selectors, calls REST APIs, and scrapes dynamic content. Use when extracting data from websites, querying JSON APIs, or automating browser interactions.
48jscpd
Finds duplicate code blocks and analyzes duplication metrics across files. Use when identifying copy-pasted code, measuring technical debt, or preparing for refactoring.
45yt-dlp
Downloads videos from YouTube and other sites using yt-dlp. Use when downloading videos, extracting metadata, or batch downloading multiple files.
42