GitHub Repository to Single File is a TypeScript CLI that efficiently merges all text-like files from a GitHub repository into one clean document. Perfect for LLMs and RAG, this tool streams progress and manages output files conveniently, allowing models to leverage full repository contexts seamlessly.
Efficiently consolidate a GitHub repository into a single, clean document with the github-repo-to-single-file TypeScript CLI tool. This utility fetches and merges all text-like files from a GitHub repository, outputting the results as either a .txt or .pdf file. Designed for seamless integration with Language Models (LLMs) and Retrieval-Augmented Generation (RAG) tasks, the tool allows for easy ingestion of an entire codebase as a single artifact, ensuring that models can seamlessly use the context from the repository.
out/ directory, simplifying access to the final product.Fetch a repository:
npm run fetch -- https://github.com/owner/repository
Generate a PDF instead of text:
npm run fetch -- --pdf https://github.com/owner/repository
Specify a branch for fetching:
npm run fetch -- --branch release https://github.com/owner/repository
main.ts: Entry point for the CLI.src/: Contains modular implementations, including the GitHub client and exporter logic.out/: Directory for generated output files.__tests__/: Jest test suites to validate core helpers and functionalities.*By leveraging this tool, developers can quickly gather context from their repositories, facilitating enhanced model training and comprehension through the consolidation of repository data into a single file format.
No comments yet.
Sign in to be the first to comment.