Skip to main content

Generate a comprehensive summary and visualization of a repository structure, enhanced with AI-powered descriptions and developer considerations.

Project description

๐Ÿ—บ๏ธ repo-map

PyPI version Python versions PyPI license PyPI downloads

An intelligent repository mapper that uses AI to create comprehensive, visual summaries of your codebase.


repo-map is an advanced tool for generating comprehensive, AI-enhanced summaries of software repositories. It provides developers with valuable insights into project structures, file purposes, and potential considerations across various programming languages. Using efficient caching, repo-map only processes files that have changed since the last run, making it ideal for continuous use in evolving projects. This tool not only aids in understanding and documenting codebases but can also assist LLM agents in writing accurate and functional code within your existing project structure.

๐ŸŒŸ Key Features

  • ๐Ÿ“Š Detailed Repository Summaries: Generates a tree-like visualization of your repository structure.
  • ๐Ÿง  AI-Powered Enhancements: Get AI-generated descriptions, developer considerations, and more.
  • ๐ŸŒ Multi-Language Support: Analyzes code structure across Python, Java, JavaScript, TypeScript, and more.
  • ๐Ÿš€ Efficient Caching: Uses SQLite to only process files that have changed since the last run.
  • ๐Ÿ“ Markdown Output: Generates a clean Markdown file for easy sharing and documentation.
  • ๐Ÿ”’ Gitignore Respect: Respects your root .gitignore file and includes a robust set of default ignore patterns.
  • โšก Async Processing: Utilizes asynchronous processing for improved performance.

๐Ÿ› ๏ธ Installation

  1. Clone the repository:

    git clone https://github.com/cyanheads/repo-map.git
    cd repo-map
    
  2. Install dependencies using Poetry:

    poetry install
    

๐Ÿš€ Usage

To generate a repository map, run the following command from the project root:

poetry run repo-map <repository_path> [options]

Replace <repository_path> with the path to the repository you want to analyze.

Options

  • -y, --yes: Automatically accept the disclaimer and proceed without prompting.
  • --model MODEL: Specify the OpenRouter LLM model to use (default: anthropic/claude-sonnet-4.6).
  • --concurrency INT: Set the number of concurrent API calls (default: 3).

Examples

# Basic usage
repo-map /path/to/your/repo

# Use a specific model
repo-map /path/to/your/repo --model "anthropic/claude-sonnet-4.6"

# Auto-accept disclaimer
repo-map /path/to/your/repo -y

๐Ÿ Example: Snake Game Repository Map

Here's an example of a repo-map generated for an advanced Snake game implemented in Python:

/ (SSSnakeGame)
โ”œโ”€โ”€ main.py (Python)
โ”‚   โ”œโ”€โ”€ Description: Entry point for the Snake game; initializes Pygame and runs the main event loop.
โ”‚   โ”œโ”€โ”€ Developer Consideration: The game loop is tightly bound to Pygame's event system; significant changes require Pygame familiarity.
โ”‚   โ”œโ”€โ”€ Maintenance Flag: Stable
โ”‚   โ”œโ”€โ”€ Architectural Role: Entrypoint
โ”‚   โ”œโ”€โ”€ Refactoring Suggestions: Isolate game state from rendering to improve testability and reduce complexity.
โ”‚   โ”œโ”€โ”€ Critical Dependencies:
โ”‚   โ””โ”€โ”€   - pygame: Game loop, input handling, and rendering.
โ”œโ”€โ”€ config.py (Python)
โ”‚   โ”œโ”€โ”€ Description: Centralizes static configuration (screen dimensions, colors, snake speed).
โ”‚   โ”œโ”€โ”€ Developer Consideration: Changing screen dimensions may require adjustments to food spawning to keep it in bounds.
โ”‚   โ”œโ”€โ”€ Maintenance Flag: Volatile
โ”‚   โ””โ”€โ”€ Architectural Role: Configuration
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”‚   โ”œโ”€โ”€ snake_head.png (Image)
โ”‚   โ”‚   โ””โ”€โ”€ food.png (Image)
โ”‚   โ””โ”€โ”€ sounds/
โ”‚       โ”œโ”€โ”€ eat.wav (Audio)
โ”‚       โ””โ”€โ”€ game_over.mp3 (Audio)
โ”œโ”€โ”€ requirements.txt (Text)
โ”‚   โ””โ”€โ”€ Description: Lists Python package dependencies required to run the project, such as `pygame`.
โ””โ”€โ”€ README.md (Markdown)
    โ””โ”€โ”€ Description: Project overview including setup instructions, gameplay details, and contribution guidelines.
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

๐Ÿ” Configuration

Before using repo-map, you need to set up your OpenRouter API key. Set the following environment variable:

export OPENROUTER_API_KEY=your_api_key_here

Replace your_api_key_here with your actual OpenRouter API key.

๐Ÿงฉ How It Works

  1. Walks through the repository directory structure.
  2. Analyzes file contents and extracts key information (imports, functions, classes).
  3. Utilizes an LLM (via OpenRouter) to generate descriptions and developer considerations.
  4. Caches results in SQLite for efficient processing of unchanged files.
  5. Generates a comprehensive tree-like structure of the repository.
  6. Saves the output as a Markdown file for easy viewing and sharing.

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

๏ธ License

This project is licensed under the Apache 2.0 License. See the LICENSE file in the root directory of this project for the full license text.

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

repo_map-0.8.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

repo_map-0.8.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file repo_map-0.8.0.tar.gz.

File metadata

  • Download URL: repo_map-0.8.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.10 Darwin/25.1.0

File hashes

Hashes for repo_map-0.8.0.tar.gz
Algorithm Hash digest
SHA256 dba43759aa63ab6bb67638b9216ed831bba5c79f29cc1c9025afc61151aad572
MD5 d39c64656ac3106d760438450de45f5e
BLAKE2b-256 dbb179acd178b77944764c32d29e149bd4ce85b583ddc32b1ddb4a35b99272b5

See more details on using hashes here.

File details

Details for the file repo_map-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: repo_map-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.10 Darwin/25.1.0

File hashes

Hashes for repo_map-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd0f27f60206d3329ef9bde25806d03d3ab33dabcc094d129da877af96b5da0b
MD5 8e3afd5e4583ea3c768bd473506c078a
BLAKE2b-256 e065b19c9cf6401e504e3a7c443c6ef9fe4f3f72ac7fa7a921275b2f25e24286

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