Skip to main content

A collection of tools to flatten and process code repositories

Project description

Coderoller

Coderoller banner

Build Status Supports Python versions 3.10+

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), specific directories (build, dist, node_modules, __pycache__), specific files (lockfiles, hidden files, other flattened files, etc.), and any paths specified in .gitignore.
  • Supports flattening directly from Git URLs even if the repository is not cloned locally.

Installation

Coderoller requires Python 3.10 or later.

Using pipx

You can install Coderoller globally using pipx:

pipx install coderoller

Usage

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

coderoller-flatten-repo /path/to/reponame

To flatten a source repository directly from a Git URL, use the coderoller-flatten-repo script with the repository URL:

coderoller-flatten-repo https://github.com/username/reponame.git

Both commands 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.4.3.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

coderoller-0.4.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for coderoller-0.4.3.tar.gz
Algorithm Hash digest
SHA256 99cbc534fbdfafda3175c6f7fcce405b33060042a4f78a448f002b39373c7a61
MD5 9705d8d577cf5fe45a80205f97635bb5
BLAKE2b-256 6911a9ad044fe28bf62a3f69f450d1fb19854a712a255444b6736b50cdaf1652

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for coderoller-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7764ed06a183635a267ad706c7629107f9bc3faa6b69f504d172d7ce9c040351
MD5 605d833c04e9b02574dcc7edff3f5388
BLAKE2b-256 cfeadad2b13f07dd0c423dd1813a43f1f8fa7f44761cbc8cdc5d9d0b6998d0ae

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