Skip to main content

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

repotofile-cli-0.2.2.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

repotofile_cli-0.2.2-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page