Skip to main content

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 map
  • project.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codemapper-4.8.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codemapper-4.8.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file codemapper-4.8.0.tar.gz.

File metadata

  • Download URL: codemapper-4.8.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.23

File hashes

Hashes for codemapper-4.8.0.tar.gz
Algorithm Hash digest
SHA256 34bf12b44d0f1db5950e95f9d64b7e9392a8d95e7550c1b56ae35529a117a9eb
MD5 54503ff150e8585297ded8b5b17db050
BLAKE2b-256 9440d966f06f5cd4b3c6540c2f6973f6d32e89f65e32fc0b76d629e9042f6afc

See more details on using hashes here.

File details

Details for the file codemapper-4.8.0-py3-none-any.whl.

File metadata

  • Download URL: codemapper-4.8.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.23

File hashes

Hashes for codemapper-4.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0eb17465fc2951b5b565c5c820851917e5bd1a3ca1aa9e34bbbbbc89591e465
MD5 2ee727723ed64fccc6d22a607eb0159a
BLAKE2b-256 c23440cb061281b2ef6c567d8294331fef12a5d7a40e9a8b20be7a4cd0dd57b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page