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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file repotofile-cli-0.2.2.tar.gz.

File metadata

  • Download URL: repotofile-cli-0.2.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for repotofile-cli-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ae10901b4652e5cbb3cdc78c0eedbb3353b54a04ec9acd88d4454ad3db267df5
MD5 7ae3ad5c2714c8693ff0d4257d508ef4
BLAKE2b-256 3430ce31d161b971dd10ae8bf5a0aac196f958a086ccbdeeb3944df4d1820b9f

See more details on using hashes here.

File details

Details for the file repotofile_cli-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for repotofile_cli-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 605e4552775e6bc6afecb7606af9740a8d7c723e5dc87c50c260c571f3de68a5
MD5 e5b6961ce8cb0c42b855ab6227bba08a
BLAKE2b-256 75cd7482441b740e85e33d42b483f61f3f0d2c7c53d1b284599727448fc96847

See more details on using hashes here.

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