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 or an existing file directory 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]
or
repotofile <directory> [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-name].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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 605e4552775e6bc6afecb7606af9740a8d7c723e5dc87c50c260c571f3de68a5 |
|
MD5 | e5b6961ce8cb0c42b855ab6227bba08a |
|
BLAKE2b-256 | 75cd7482441b740e85e33d42b483f61f3f0d2c7c53d1b284599727448fc96847 |