Skip to main content

Welcome to repo2pdf

repo2pdf is an innovative CLI tool designed to seamlessly transform GitHub repositories into well-formatted, visually engaging, and easy-to-navigate PDF files. By automating the process of cloning repositories and parsing code files, repo2pdf serves a variety of use-cases including teaching, code reviews, offline referencing, archiving, AI training, and document embedding. The tool bridges the gap between the dynamic world of coding and the static, universally accessible format of PDFs, catering to a multitude of user needs and creative applications.

Key features

Syntax highlighting

Beautiful code highlighting powered by highlight.js with support for 100+ languages

Flexible input

Convert GitHub repositories or local directories to PDF with a single command

Rich customization

Add line numbers, page numbers, remove comments, and control formatting options

Multiple output modes

Generate a single PDF for the entire repository or one PDF per file

Use cases

Code reviews

Print repositories for offline review and annotation

Education

Share codebases with students in a portable format

Documentation

Archive snapshots of your codebase at specific points in time

AI training

Prepare code documents for training language models

Portfolio

Create professional PDF presentations of your projects

Compliance

Generate auditable records of source code

Community

repo2pdf is open source and welcomes contributions from developers around the world. Whether you’re reporting bugs, suggesting features, or contributing code, your input helps make repo2pdf better for everyone.
repo2pdf requires Node.js 18 or higher and git (for remote repositories)