Skip to main content

CLI tool to convert a code repository into LLM-friendly markdown

Project description

repo-to-llm

Convert a code repository into a clean, LLM-friendly Markdown report.
Includes a directory tree and source code contents, with filtering for size, binary files, and .gitignore.

Features

  • ✅ CLI interface
  • .gitignore and glob-based exclusions
  • ✅ File size filtering
  • ✅ Language-aware syntax blocks (e.g. python, yaml, etc.)
  • ✅ Directory tree generation (optional)

Installation

pip install repo-to-llm

Usage

repo-to-llm /path/to/repo > output.md

Options

--output OUTPUT           Write to a file instead of stdout
--print                   Print to stdout (default)
--max-bytes 300kb         Max file size to include (default: 500000 bytes)
--exclude-tree            Skip the directory tree section
--exclude-patterns "*.log" "docs/*"   Glob patterns to exclude
--verbose                 Enable debug output

Example

repo-to-llm my-project --exclude-patterns "*.log" "tests/*" --max-bytes 300kb > project.md

Configuration

You can override defaults in ~/.repo_to_llm/config.yml.

max_bytes: 1000000
excluded_patterns:
  - ".git/*"
  - "__pycache__/*"
extension_mapping:
  .ext: my_extension
  .ext2: my_second_extension

Contributing

Contributions are welcome. Please open an issue or PR on GitHub.

License

MIT License. See LICENSE.

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_to_llm-0.1.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

repo_to_llm-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file repo_to_llm-0.1.2.tar.gz.

File metadata

  • Download URL: repo_to_llm-0.1.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for repo_to_llm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 492824d07225bec309514684ebd9308edcdc9f1d4b3b94876bee221cee6a348d
MD5 98d2247361d1d1b2b782daf89a0b5cfc
BLAKE2b-256 2814dd2e2ffd8a72ac5120b9f0620c56f078b7a5c789b05d11accce918d4b585

See more details on using hashes here.

File details

Details for the file repo_to_llm-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: repo_to_llm-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for repo_to_llm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a1b02124646fda4b98293ab4d5808fdaf9f7418a0d2f2abf234835fc54e1c6a3
MD5 cad4da98084d62dd6c3a815d588a1d88
BLAKE2b-256 cf668b122f722c351b0f305461c8da7840c10623b9a08191c721a28209a83d27

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