npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gptignore

v1.2.0

Published

A CLI tool to generate a comprehensive AI-friendly text file, including folder structures and file contents, while respecting a custom .gptignore file for exclusions.

Downloads

5

Readme

GPTIgnore

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!

Features

  • Generate a codebase summary: Create a detailed text file (codebase.txt) containing the file paths and contents of all relevant files in the project, excluding those specified in .gptignore.
  • Initialize a .gptignore file: Generate a starter .gptignore file with common patterns to ignore files and directories.

Installation

To install GPTIgnore globally, use npm:

npm install -g gptignore

Usage

GPTIgnore provides two main commands: generate and init.

Generate with Custom Path and Output File Name

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.

Usage

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.

Examples

  • 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.

Example

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

Init

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.

Future Features and Roadmap

  • [x] Generate codebase file: Automatically create a summary of your project's codebase, ready for upload to an LLM.
  • [ ] Custom environment variables: Allow users to set their own environment variables and configurations.
  • [ ] LLM Integration: Chat directly with advanced models like Gemini from the command line.
  • [ ] Multiple output files: Support for generating multiple files, breaking down the codebase into sub-repositories (e.g., client, server) based on a configuration.
  • [ ] Configurable outputs: Enable users to customize the output structure and contents based on their specific needs.

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!

Links

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository if you have suggestions or improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.