Skip to main content

Pack Git Repository into a text file for use in LLM

Project description

Repo-Context-Packager

Pack Git Repository into a text file for use in LLM
Release 0.1

Instruction for Windows Users:

Step 1

Check if Python is installed in the system by the following command:

python --version

or

py --version

If Python is not installed, visit https://www.python.org/ -> Downlaods -> Windows,
and choose the latest Stable Releases to download and install.

Notes: make sure that the installation path of Python is in Windows PATH

Step 1.1

Download requirement.txt from the repository.

Install dependencies by the following commands:

py -m pip install -r requirement.txt

Step 2

Change directory to src/repo_context_packager with the following command:

cd src\repo_context_packager

Step 3

Run the script by the following command:

python pack-repo.py repo-path [-r [DAYS]] [-o] [output-file-name]

or

py pack-repo.py repo-path [-r [DAYS]] [-o] [output-file-name]

Details for arguments and options are listed below:
[-h] [--version] [--output [OUTPUT]] [--include INCLUDE] [--all] [--recent [RECENT]] [--line-number] [--dirs-only] paths [paths ...]

positional arguments description
paths Path to the repository / files in the same repository
options description
-h, --help show this help message and exit
--version, -v show program's version number and exit
--output, -o [OUTPUT] Output filename
--include, -i INCLUDE Extensions to be included, separated by ",", e.g. ".js,.txt"
--all, -a Show all files including hidden files (files that start with ".")
--recent, -r [RECENT] Only include files modified within the last 7 days
--line-number, -l Include line number when displaying file content output
--dirs-only, -d Show only directory structure tree without file contents

Instruction for Mac/Linux Users:

Step 1

Check if Python is installed in the system by the following command:

python3 --version

If Python is not installed, visit https://www.python.org/ -> Downlaods -> macOS,
and choose the latest Stable Releases to download and install.

Alternatively, user can check if brew is available using command brew --version, and use brew to install Python with the following command:

brew install python

Step 1.1

Download requirement.txt from the repository.

Install dependencies by the following commands:

python3 -m pip install -r requirement.txt

Step 2

Change directory to src/repo_context_packager with the following command:

cd src/repo_context_packager

Step 3

Run the script by the following command:

python3 pack-repo.py repo-path [-r [DAYS]] [-o] [output-file-name]

Details for arguments and options are listed below:
[-h] [--version] [--output [OUTPUT]] [--include INCLUDE] [--all] [--recent [RECENT]] [--line-number] [--dirs-only] paths [paths ...]

positional arguments description
paths Path to the repository / files in the same repository
options description
-h, --help show this help message and exit
--version, -v show program's version number and exit
--output, -o [OUTPUT] Output filename
--include, -i INCLUDE Extensions to be included, separated by ",", e.g. ".js,.txt"
--all, -a Show all files including hidden files (files that start with ".")
--recent, -r [RECENT] Only include files modified within the last 7 days
--line-number, -l Include line number when displaying file content output
--dirs-only, -d Show only directory structure tree without file contents

.TOML Configuration File

You can use a .pack-repo.toml file in the same directory of pack-repo.py to set default options for this script. To get started, go to the root directory of this repo, and copy the template file to src/ by the following command:

On Mac:

cp .pack-repo.template.toml src/.pack-repo.toml

On Windows:

copy .pack-repo.template.toml src\.pack-repo.toml

Then, open and edit .pack-repo.toml to set your preferred defaults. IMPORTANT: Command-line arguments will always override any settings from the .pack-repo.toml file.

License:

This project is licensed under BSD 2-Clause License.

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

repo_context_packager-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_context_packager-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file repo_context_packager-1.0.0.tar.gz.

File metadata

  • Download URL: repo_context_packager-1.0.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for repo_context_packager-1.0.0.tar.gz
Algorithm Hash digest
SHA256 afded8215e3fa5cb111fa2b6b3dd473c1d16055a39b71bf4131943ada23acccd
MD5 261cb25319d8622b621d0a13de1cafe5
BLAKE2b-256 6aa9f22e35e436a5d94d0a3e558f8762f34eafc6c190f5cbf46dff4f1fee1592

See more details on using hashes here.

File details

Details for the file repo_context_packager-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for repo_context_packager-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6dc68d99c0db0bf28f34c07014c83c285df87831db8a39ec197d3f45730d5ca
MD5 a62e40b63f6f60bd09842c96e2abaebd
BLAKE2b-256 7973e25dcc3fe75dc6454ed64d3bf03e4ab74e9a475a842bbe93677ae880f242

See more details on using hashes here.

Supported by

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