A CLI tool to clone and process GitHub repositories.
Project description
repotofile-cli
repotofile-cli
is a very light weight command-line tool that allows users to download a GitHub repository and generate a text file containing the repository's code, excluding files specified in .gitignore
. It's particularly useful for code analysis, backups and uploading to large language models like chatGPT.
Features
- Clone any public GitHub repository.
- Optionally exclude configuration files, replacing their content with a placeholder.
- Generate a single text or markdown file with the entire codebase, neatly separated by files.
- Easy to install and use with a simple command.
- Ignore config files and directories by default
- Add custom files and directories to ignore
Installation
To install repotofile-cli
, ensure you have Python installed on your system, then run:
pip install repotofile-cli
Usage
After installation, you can use the repotofile
command or its shorthand rtf
:
repotofile <repository-url> [options]
or
rtf <repository-url> [options]
Options
-b
,--branch
: Specify a branch or tag to download. Defaults to the default branch of the repository.-o
,--output
: Custom output file name or path. Defaults to 'repository_contents.txt'.--no-config
: Replace the content of configuration files with a placeholder comment.
Examples
Cloning a repository and generating the default output file:
repotofile https://github.com/user/repo
Cloning a specific branch:
repotofile https://github.com/user/repo -b feature-branch
Generating a custom output file:
repotofile https://github.com/user/repo -o ~/Documents/repo_snapshot.txt
Ignoring custom files and directories:
repotofile https://github.com/user/repo --ignore-files "*.log,*.txt" --ignore-dirs "build,docs"
Contributing
Contributions to repotofile-cli
are welcome! Please read our contributing guidelines (link to guidelines) to get started.
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Maurits Bos - maurits.bos@gmail.com Project Link: https://github.com/mbbrainz/repotofile-cli
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
Built Distribution
Hashes for repotofile_cli-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c89a6b9ecef7126131e6a858355a4372426733c6a2cec9c6d8aa5e70a1674b7 |
|
MD5 | 1c381cdb59b903c07acaa3c8ea418f34 |
|
BLAKE2b-256 | dcde55fd692e4db0faa8357dd4c9ee9882142bc44527baa5b8d67e0d0c1f76f6 |