Name | gptify JSON |
Version |
0.5.0
JSON |
| download |
home_page | https://github.com/ogre-run/gptify |
Summary | Convert code repos into an LLM prompt-friendly format. Forked from https://github.com/zackees/gptrepo |
upload_time | 2024-12-20 04:58:23 |
maintainer | None |
docs_url | None |
author | Wilder Lopes |
requires_python | >=3.9 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# gptify
`gptify` is a command-line tool that transforms a Git repository into a single text file or multiple text chunks suitable for use with Large Language Models (LLMs) like ChatGPT. It preserves the file structure and content, enabling LLMs to understand and process the codebase for tasks such as code review, documentation generation, and answering questions about the code. This project is a fork of [gptrepo](https://github.com/zackess/gptrepo) with added features.
## Relevance
This tool addresses the challenge of effectively using LLMs with codebases. By converting a repository into a digestible format, `gptify` allows developers to leverage the power of LLMs for various development tasks. It simplifies the process of feeding code context into LLMs, avoiding size limitations and formatting issues.
## Installation
The easiest way to install `gptify` is using `pip`:
```bash
pip install gptify
```
Alternatively, you can install it using `pipx`:
```bash
poetry build && pipx install dist/*.whl
```
You can also uninstall older versions using the provided install script:
```bash
./install.sh
```
## Usage
1. **Navigate to the root directory** of your Git repository.
2. **Run the `gptify` command**:
```bash
gptify
```
This will generate a file named `gptify_output.txt` in the current directory containing the formatted repository content. You can then copy and paste the contents of this file into a ChatGPT session.
### Options
* `--output <filename>`: Specifies the name of the output file (default: `gptify_output.txt`).
* `--clipboard`: Copies the output directly to the clipboard instead of creating an output file.
* `--openfile`: Opens the output file after creation using the default system application.
* `--preamble <filepath>`: Prepends a custom preamble to the output file. This is useful for providing instructions or context to the LLM.
* `--chunk`: Enables chunking of the output into smaller files, useful for handling large repositories that exceed LLM context limits. Used with `--max_tokens` and `--overlap`.
* `--max_tokens`: Sets the maximum number of tokens per chunk when using the `--chunk` option (default: 900000). Requires the `tiktoken` library.
* `--overlap`: Sets the number of overlapping tokens between chunks when using the `--chunk` option (default: 400). Helps maintain context across chunks. Requires the `tiktoken` library.
* `--output_dir`: Specifies the output directory for chunks when using `--chunk` (default: `gptify_output_chunks`).
## Example with custom output file and preamble:
```bash
gptify --output my_repo.txt --preamble instructions.txt
```
This command will generate `my_repo.txt` with the processed repository data, prepended with the content of `instructions.txt`.
## Example with chunking:
```bash
gptify --chunk --max_tokens 4000 --overlap 200
```
This will create multiple files in the `gptify_output_chunks` directory, each containing a chunk of the repository data, with a maximum of 4000 tokens and an overlap of 200 tokens.
## Contributing
Contributions are welcome.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/ogre-run/gptify",
"name": "gptify",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Wilder Lopes",
"author_email": "wilder@ogre.run",
"download_url": "https://files.pythonhosted.org/packages/da/28/430ceda1bb4b9c5604a4dc75bf0bee1c176b140b158c9e9b31d72cde08a8/gptify-0.5.0.tar.gz",
"platform": null,
"description": "# gptify\n\n`gptify` is a command-line tool that transforms a Git repository into a single text file or multiple text chunks suitable for use with Large Language Models (LLMs) like ChatGPT. It preserves the file structure and content, enabling LLMs to understand and process the codebase for tasks such as code review, documentation generation, and answering questions about the code. This project is a fork of [gptrepo](https://github.com/zackess/gptrepo) with added features.\n\n## Relevance\n\nThis tool addresses the challenge of effectively using LLMs with codebases. By converting a repository into a digestible format, `gptify` allows developers to leverage the power of LLMs for various development tasks. It simplifies the process of feeding code context into LLMs, avoiding size limitations and formatting issues.\n\n## Installation\n\nThe easiest way to install `gptify` is using `pip`:\n\n```bash\npip install gptify\n```\n\nAlternatively, you can install it using `pipx`:\n\n```bash\npoetry build && pipx install dist/*.whl\n```\n\nYou can also uninstall older versions using the provided install script:\n\n```bash\n./install.sh\n```\n\n## Usage\n\n1. **Navigate to the root directory** of your Git repository.\n2. **Run the `gptify` command**:\n\n```bash\ngptify\n```\n\nThis will generate a file named `gptify_output.txt` in the current directory containing the formatted repository content. You can then copy and paste the contents of this file into a ChatGPT session.\n\n\n### Options\n\n* `--output <filename>`: Specifies the name of the output file (default: `gptify_output.txt`).\n* `--clipboard`: Copies the output directly to the clipboard instead of creating an output file.\n* `--openfile`: Opens the output file after creation using the default system application.\n* `--preamble <filepath>`: Prepends a custom preamble to the output file. This is useful for providing instructions or context to the LLM.\n* `--chunk`: Enables chunking of the output into smaller files, useful for handling large repositories that exceed LLM context limits. Used with `--max_tokens` and `--overlap`.\n* `--max_tokens`: Sets the maximum number of tokens per chunk when using the `--chunk` option (default: 900000). Requires the `tiktoken` library.\n* `--overlap`: Sets the number of overlapping tokens between chunks when using the `--chunk` option (default: 400). Helps maintain context across chunks. Requires the `tiktoken` library.\n* `--output_dir`: Specifies the output directory for chunks when using `--chunk` (default: `gptify_output_chunks`).\n\n\n## Example with custom output file and preamble:\n\n```bash\ngptify --output my_repo.txt --preamble instructions.txt\n```\n\nThis command will generate `my_repo.txt` with the processed repository data, prepended with the content of `instructions.txt`.\n\n## Example with chunking:\n\n```bash\ngptify --chunk --max_tokens 4000 --overlap 200\n```\nThis will create multiple files in the `gptify_output_chunks` directory, each containing a chunk of the repository data, with a maximum of 4000 tokens and an overlap of 200 tokens.\n\n## Contributing\n\nContributions are welcome.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Convert code repos into an LLM prompt-friendly format. Forked from https://github.com/zackees/gptrepo",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/ogre-run/gptify"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "11e6918a6fc075c508093a17ad957acc2b05af56bb87eb5909260883a8f8f882",
"md5": "e2aaf35b499fa29c09bcb861aa2a5373",
"sha256": "920f9073ba9282e5e033309299062a5910335e69e75d9d3847a119db80a911d5"
},
"downloads": -1,
"filename": "gptify-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e2aaf35b499fa29c09bcb861aa2a5373",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6348,
"upload_time": "2024-12-20T04:58:21",
"upload_time_iso_8601": "2024-12-20T04:58:21.207249Z",
"url": "https://files.pythonhosted.org/packages/11/e6/918a6fc075c508093a17ad957acc2b05af56bb87eb5909260883a8f8f882/gptify-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "da28430ceda1bb4b9c5604a4dc75bf0bee1c176b140b158c9e9b31d72cde08a8",
"md5": "f1549252136f776522732b2190023eb9",
"sha256": "aad37927b05d1d0e550001ec6c4cb4e78944cbf4f3c86e2bee81697f4d0b2844"
},
"downloads": -1,
"filename": "gptify-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "f1549252136f776522732b2190023eb9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 5123,
"upload_time": "2024-12-20T04:58:23",
"upload_time_iso_8601": "2024-12-20T04:58:23.255681Z",
"url": "https://files.pythonhosted.org/packages/da/28/430ceda1bb4b9c5604a4dc75bf0bee1c176b140b158c9e9b31d72cde08a8/gptify-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 04:58:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ogre-run",
"github_project": "gptify",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gptify"
}