Coder Social home page Coder Social logo

stevenlafl / gptloader Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 73 KB

Ingest an entire codebase into ChatGPT to ask questions about it

License: Apache License 2.0

Dockerfile 2.62% Shell 0.27% JavaScript 0.61% TypeScript 96.51%
chatgpt code ingest

gptloader's Introduction

GPTLoader

GPTLoader is a Node.js console application designed to aggregate content from non-binary files within a specified directory. It intelligently excludes files and folders based on patterns defined in .gitignore, .dockerignore, and a custom .gptignore file. The output is a markdown document listing the paths and contents of all included files, primarily serving as a context window for an AI agent.

Overview

GPTLoader utilizes Node.js for backend logic, incorporating well-known packages such as Winston for logging, Handlebars for markdown document generation, and Ignore for managing exclusion patterns. It's structured to scan the current working directory, apply exclusion patterns, and process all relevant non-binary files. The architecture includes components such as a File Reader, Exclusion Handler, Template Processor, and Logger to efficiently manage the application's operations.

example-flood

Features

  • Automatic Directory Scanning: Operates on the current working directory without the need for user input.
  • Intelligent Exclusion: Utilizes .gitignore, .dockerignore, and .gptignore files to exclude files and directories.
  • Markdown Output Generation: Creates a markdown document containing the paths and contents of included files.
  • Real-Time Logging: Offers progress logs and error tracking in real-time.
  • Conversation History: Maintains the current conversation in memory even as changes to files during a conversation are reloaded.

Getting started

Requirements

  • Node.js installed on the computer.
  • Basic understanding of terminal or command prompt usage.

Quickstart

Docker

docker run -it --name gptloader --rm -e LOG_LEVEL=info -e OPENAI_API_KEY="your_api_key" -v "$(pwd):/app" stevenlafl/gptloader

You can turn this into a command by altering .bashrc:

gptloader() {
  docker run -it --name gptloader --rm -e LOG_LEVEL=info -e OPENAI_API_KEY="your_api_key" -v "$(pwd):/app" stevenlafl/gptloader;
}

NPM

  1. Clone the repository to your local machine.
  2. Navigate to the project directory in your terminal.
  3. Install the required dependencies by running npm install.
  4. Copy .env.example to .env and replace relevant variables.
  5. Start the application with npm start.

License

Copyright Steven Linn (c) 2024.

gptloader's People

Contributors

stevenlafl avatar

Stargazers

Kevin Huff avatar

Watchers

 avatar

gptloader's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.