Tired of struggling to send your code to an LLM? GPTIgnore makes it simple! Whether you’re looking to upload your entire codebase or specific sections to a language model, we’ve got you covered. Our tool generates a clean, organized representation of your codebase, so you can easily share it with any LLM. Say goodbye to the hassle of manually preparing files!
codebase.txt
) containing the file paths and contents of all relevant files in the project, excluding those specified in .gptignore
..gptignore
file: Generate a starter .gptignore
file with common patterns to ignore files and directories.To install GPTIgnore globally, use npm:
npm install -g gptignore
GPTIgnore provides two main commands: generate
and init
.
The generate
command can now take optional arguments to specify a custom input path and output file name. This allows you to generate a summary for a specific directory within your project and customize the name of the output file.
gptignore generate [path] [outputFileName]
path
: (Optional) The directory to process. Defaults to the current working directory if not specified.outputFileName
: (Optional) The name of the output file. Defaults to codebase.txt
if not specified.Generate for Current Directory:
gptignore generate
This will generate codebase.txt
in the gpt
directory from the current working directory.
Generate for a Specific Directory:
gptignore generate ./src
This will generate codebase.txt
from the src
directory, summarizing only the contents of that directory.
Generate with Specific Output File Name:
gptignore generate ./src custom-output.txt
This will generate custom-output.txt
in the gpt
directory, containing data from the src
directory.
By utilizing these options, you can easily focus on specific parts of your project and organize your output files as needed.
Running the above command will produce a codebase.txt
file with the following structure:
The following text is a Git repository with code. The structure of the text are sections that begin with ----, followed by a single line containing the file path and file name, followed by a variable amount of lines containing the file contents. The text representing the Git repository ends when the symbols --END-- are encountered. Any further text beyond --END-- are meant to be interpreted as instructions using the aforementioned Git repository as context.
----
src/index.js
console.log('Hello, world!');
----
README.md
# My Project
This is a README file.
--END--
The init
command initializes a .gptignore
file in the project directory with a set of default patterns to ignore. If a .gptignore
file already exists, the command will not overwrite it.
gptignore init
The default .gptignore
file used can be found here.
client
, server
) based on a configuration.We’re constantly working on new features to make GPTIgnore the best tool for interacting with LLMs and managing your codebase. Stay tuned for more exciting updates!
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository if you have suggestions or improvements.
This project is licensed under the MIT License. See the LICENSE file for details.