Giter VIP home page Giter VIP logo

coderat's Introduction

coderat

Generate code changes in your local code by talking to AI (using openai Assistant API).

coderat exposes various LSP (language server protocol) tools to the AI. It does so via Neovim, so, at the very least, it requires an installation of Neovim with LSP configured.

Install

ctags is also required.

npm i -g coderat

You need OPENAI_API_KEY enviroment variable set. At the moment, you must have access to gpt-4-turbo-preview model. This is not guaranteed even for a pro users. Buy more credits (10$ will do) if that's the case.

Usage

From a project you're working on start a new chat session with a start command:

coderat start $(git ls-files)

This creates a new chat thread, and pops open a browser window with the assistant playground. The process will keep running, listening to "tool function" calls from the assistant. If you shut it down (or it crashes), you can resume it with:

coderat resume

Back to the chat window. Explain what changes you want. The assistant may then use various tools, provided by coderat, to navigate your code, apply changes to your local files, and validate the results.

It's recommended to start with a clean diff, so that the changes made by AI are clearly visible.

Tools are implemented as tool functions. Full list of function can be found here.

At the moment chat page isn't automatically updated with the results of function calls. You need to refresh it every time it calls a function.

Running tests function

coderat needs to know how to run tests on your project. To configure this drop .coderat.config.json file in the project root. For example, this one is for a node project that uses mocha:

{
  "testCommand": "npm run test",
  "nearestTestOption": "--fgrep"
}

coderat's People

Contributors

artemave avatar

Stargazers

Josh Chisholm avatar  avatar Alec Rust avatar

Watchers

 avatar Alec Rust avatar  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.