Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ To get started with `gpt-repository-loader`, follow these steps:

5. The tool will generate an output.txt file containing the text representation of the repository. You can now use this file as input for AI language models or other text-based processing tasks.

### Optional: Install via pipx

You can also install and run the tool via pipx:

```bash
pipx install git+https://github.com/mpoon/gpt-repository-loader.git
```

Once installed, run it with:

```bash
gpt-repository-loader /path/to/git/repository [-p /path/to/preamble.txt] [-o /path/to/output_file.txt]
```

## Running Tests

To run the tests for `gpt-repository-loader`, follow these steps:
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def process_repository(repo_path, ignore_list, output_file):
output_file.write(f"{relative_file_path}\n")
output_file.write(f"{contents}\n")

if __name__ == "__main__":
def main():
if len(sys.argv) < 2:
print("Usage: python git_to_text.py /path/to/git/repository [-p /path/to/preamble.txt] [-o /path/to/output_file.txt]")
print("Usage: python gpt_repository_loader.py /path/to/git/repository [-p /path/to/preamble.txt] [-o /path/to/output_file.txt]")
sys.exit(1)

repo_path = sys.argv[1]
Expand Down Expand Up @@ -71,4 +71,6 @@ def process_repository(repo_path, ignore_list, output_file):
with open(output_file_path, 'a') as output_file:
output_file.write("--END--")
print(f"Repository contents written to {output_file_path}.")


if __name__ == "__main__":
main()
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "gpt-repository-loader"
version = "0.1.0"
description = "Tool to convert a Git repository into a plain-text format readable by AI models"
dependencies = []
requires-python = ">=3.7"

[project.scripts]
gpt-repository-loader = "gpt_repository_loader.gpt_repository_loader:main"

[tool.setuptools]
packages = ["gpt_repository_loader"]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion test_gpt_repository_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import tempfile
import shutil
from gpt_repository_loader import process_repository, get_ignore_list
from gpt_repository_loader.gpt_repository_loader import process_repository, get_ignore_list


class TestGPTRepositoryLoader(unittest.TestCase):
Expand Down