Skip to main content

A collection of tools to flatten and process code repositories

Project description

Coderoller

Coderoller is a Python utility that flattens a source code repository into a single markdown file. This tool collects all relevant source and configuration files, including Python, JavaScript, TypeScript, HTML, CSS, JSON, and more, and compiles them into a markdown document. The flattened file provides an organized overview of the repository's contents, making it easy to use in conjunction with LLMs. Simply copy the contents of the flattened file and paste it into your LLM chat context. The flattened form is also great for API-based uses of LLMs in automated workflows.

Features

  • Flattens source code repositories into a single markdown file.
  • Supports multiple file types including .py, .js, .jsx, .ts, .tsx, .swift, .go, .java, .c, .cpp, .h, .hpp, .cs, .lua, .rb, .php, .pl, .html, .css, .json, .toml, .md, .yaml, .yml, .conf, .ini, and .sh.
  • Automatically includes README files if present, placing it at the start of the flattened file.
  • Excludes hidden files and directories (those starting with a dot).

Installation

Coderoller requires Python 3.12 or later and PDM for package management.

  1. Clone the repository:

    git clone https://github.com/yourusername/coderoller.git
    cd coderoller
    
  2. Install dependencies using PDM:

    pdm install
    

Usage

To flatten a source repository, use the coderoller-flatten-repo script.

pdm run coderoller-flatten-repo /path/to/root/folder

This command will create a markdown file named reponame.flat.md in the current working directory, containing the flattened contents of the repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

coderoller-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

coderoller-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file coderoller-0.1.0.tar.gz.

File metadata

  • Download URL: coderoller-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for coderoller-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f5c0a0ac14fadd71665690879d002a50b70fbb574876543f2977bbfbfb9104d
MD5 2c46d0a1d8daeb84271aa0a1088d199b
BLAKE2b-256 9dec61eb34e1fe2319de63708967f66c17734cbc73dcdc46d6dc2ea983ca0bba

See more details on using hashes here.

File details

Details for the file coderoller-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: coderoller-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for coderoller-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f8bf6cb442fcd106a2872adba7eb46eb1e67d74c06f4defe2562d75d2111fbf
MD5 1e620c0d76dc4ce4f9467a0165cc94e2
BLAKE2b-256 586a79057f73c182ec91d1267267bbbb6bcd95555e289934cff29a31829634d2

See more details on using hashes here.

Supported by

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