Coder Social home page Coder Social logo

autopilot's Introduction

Autopilot Logo

Autopilot - Using GPT to Work on Entire Codebases

Autopilot is an AI tool that utilizes GPT to read a codebase, create context, and solve tasks that you request.

Autopilot Demo

Features

CreateSummaries script:

  • ๐Ÿ“š Reads all relevant files in the project (you can choose what file extensions you want)
  • ๐Ÿง  Creates a summary (using GPT AI API) representing a mental model for each file, allowing the app to work on larger codebases that wouldn't fit GPT's context window
  • ๐Ÿ’พ Saves the summary next to each file with a .ai.txt extension for later use
  • ๐Ÿ‘€ A watcher continuously updates files that have been modified

๐Ÿ–ฅ๏ธ UI script:

  • ๐Ÿงฉ Takes into account the TASK and retrieves all the summary files (.ai.txt)
  • ๐Ÿค– Uses GPT AI API to identify relevant files for the task based on the summaries
  • ๐Ÿ“ Retrieves the source code of each relevant file and sends it to GPT to obtain the necessary context
  • ๐Ÿ’พ Temporarily saves the output of each file
  • ๐Ÿ”ง Sends the saved output to GPT and requests the required changes to complete the TASK
  • ๐Ÿ“‹ Creates a .md file containing the suggestions to accomplish the TASK, along with the source code that can be used

๐Ÿ› ๏ธ Installation

  1. Clone the repository: git clone https://github.com/fjrdomingues/autopilot.git inside of an existing project where you want to use autopilot
  2. Do cd autopilot to install dependencies: npm install
  3. cd .. to go back to the root of the project
  4. Set up an OpenAI API key and update the .env file with the key: OPENAI_API_KEY=<your-api-key>
  5. Update const ignoreList = ['node_modules', 'autopilot', 'coverage', 'public', '__tests__'] and const fileExtensionsToProcess = ['.js', '.tsx', '.ts', '.jsx'] in the file createSummaryOfFiles.js to match the files extension that you want AI to analyze.
  6. Run node ./autopilot/createSummaryOfFiles.js ./ --all to create a summary of all files (it will also start a watcher at the end for file changes)
  7. Run node ./autopilot/ui.js to input a task and get the AI to give you a solution

Usage

To use the code summarization tool, follow these steps:

  1. Navigate to the ui.js file and run it: node ui.js
  2. Follow the prompts to provide the necessary input, including the task to complete and the relevant files
  3. The summarization tool will process the selected files and provide suggestions for the given task
  4. Solutions will be saved in a suggestions folder inside the project directory. You can view them with a .md viewer tool.

Components

  • createSummaryOfFiles.js: Manages the code summarization process for JavaScript and TypeScript files
  • gpt.js: Implements the interaction with the OpenAI API to generate responses based on provided prompts
  • ui.js: Handles the user interface (UI) interaction and utilizes the GPT-based summaries to complete tasks

๐Ÿค Contributing

We welcome contributions! Please submit pull requests to the repository, and ensure your changes align with the project's goals and guidelines. Together, we can make Autopilot an even more powerful and efficient tool for developers!

autopilot's People

Contributors

fjrdomingues avatar

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.