A tool to generate comprehensive Markdown artifacts of directory structures and file contents
Project description
CodeMapper
Converts codebases into single-file Markdown documents for language model context and code analysis.
What It Does
CodeMapper scans a directory or GitHub repository and generates a comprehensive Markdown file containing:
- Complete directory tree structure
- All file contents with syntax highlighting
- Git metadata (branch, commit, remote)
Files are filtered intelligently - binary files, lock files, cache directories, and files over 300k characters are excluded.
Installation
uv tool install codemapper
Basic Usage
# Generate codemap from local directory
codemapper /path/to/project
# Generate codemap from GitHub repository
codemapper https://github.com/user/repo
# Generate documentation map (README + docs/ only)
codemapper --docs /path/to/project
Output
By default, CodeMapper creates .codemaps/ in your current directory:
project.codemap.md- Full codebase mapproject.docmap.md- Documentation-only map (with --docs flag)
Options
--docs Generate documentation map instead of code map
--docs-dir DIR Specify custom documentation directory
--exclude DIR Exclude directory (can be used multiple times)
--output-dir DIR Custom output directory (overrides config)
--include-ignored Include files normally ignored by .gitignore
--version Show version
--help Show help
Configuration
Optional Configuration
Copy codemapper.example.toml to ~/.codemapper/codemapper.toml for optional configuration:
# Centralized collection: All codemaps go to one directory
output_dir = "~/.codemapper"
# OR custom prefix: Change directory name in current location
# prefix_style = "dot" # .codemaps/ (default)
# prefix_style = "underscore" # _codemaps/
# prefix_style = "dash" # -codemaps/
Precedence: CLI --output-dir > Config output_dir > Config prefix_style > Default (.codemaps/ in current directory)
Without config: Creates .codemaps/ where you run the command (project-level management)
With output_dir set: All codemaps go to one centralized location (system-level management)
What Gets Excluded
Always excluded:
.git/,.venv/,.conda/,node_modules/- Cache directories:
.ruff_cache/,.pytest_cache/,__pycache__/, etc. - System files:
.DS_Store,Thumbs.db - Lock files:
uv.lock,package-lock.json,yarn.lock, etc. - Archive files:
.zip,.tar,.gz, etc. - Binary files: images, videos, executables, etc.
- Files over 300k characters (too large for AI context)
Respects .gitignore unless --include-ignored flag is used.
Requirements
Python 3.12 or newer
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codemapper-4.8.1.tar.gz.
File metadata
- Download URL: codemapper-4.8.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5cc161bea21bf4080f230c4ce5a65db97ad9b7b78564536af8526a38a468dea
|
|
| MD5 |
d2ca9d7ddee8bf926b66a3303aa0a0f7
|
|
| BLAKE2b-256 |
1f8f6911a7a832f49a35d2c3732338e1b9f53f097cb8cb89e5d3a4803dff7488
|
File details
Details for the file codemapper-4.8.1-py3-none-any.whl.
File metadata
- Download URL: codemapper-4.8.1-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d930f9ce1938f7b9ea0ad9487740539dfcb3d9a2131546d3715f7a39fa82f94
|
|
| MD5 |
f212e4a359ce6618ba9a5a16961988e3
|
|
| BLAKE2b-256 |
043b51551037908cd68e65c4302861dcbe5d4c7923593cc801e453160e4632e0
|