Perfect for AI Prompts. CodeMapper is a python script that creates a comprehensive Markdown document representing the structure and contents of any given code base
CodeMapper is a powerful Python tool designed to generate comprehensive Markdown (pdf, xml, and json outputs are on the way) representations of codebases. It bridges the gap between human developers and AI systems by providing a clear, structured view of project architectures and their complete contents. Whether you're working with local directories or GitHub repositories, CodeMapper creates a single, navigable document that encapsulates the full structure and content of a project.
This tool is invaluable for rapid codebase comprehension, whether you're a developer onboarding to a new project or an AI system analyzing code structure.
For audio explanations of this project, see:
.gitignore
rules.gitignore
pathspec
library (for handling .gitignore
rules)chardet
library (for file encoding detection)Install CodeMapper directly from PyPI using pip:
pip install codemapper
Clone this repository:
git clone https://github.com/shaneholloman/codemapper.git
Navigate to the cloned directory and install the required dependencies:
cd codemapper
pip install -r requirements.txt
Run CodeMapper from the command line, providing the path to the directory or GitHub repository URL you want to analyze:
codemapper <path_to_directory_or_github_url> [--include-ignored]
<path_to_directory_or_github_url>
: The path to the directory or GitHub repository URL to analyze (required)--include-ignored
: Include files that are normally ignored by .gitignore
(optional)CodeMapper generates a Markdown file named <directory_name>_codemap.md
in the '_codemaps' directory. This file contains:
Example usage and output:
codemapper https://github.com/shaneholloman/ansible-role-apache
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
pathspec
and chardet
libraries for enhancing CodeMapper's functionality.For a detailed version history, please refer to the changelog.md.
If you find CodeMapper useful, don't forget to star this repository!