Code Monkey home page Code Monkey logo

backseat-driver's Introduction

Backseat Driver

The Hackable VS Code AI Assistant.

What is this?

Backseat Driver is a ChatGPT API client for VS Code, similar in concept to the chat part of the GitHub CoPilot extension, but much, much simpler.

It best supports Clojure and ClojureScript coding, but can assist with anything code crafting related. Besdies. And it's a Joyride script, so you can hack in support for your language of choice.

WIP: Or even just a proof of concept for now. But it works!

backseat-driver-demo.mp4

To use it you will need:

  • VS Code
  • The Joyride extension
  • The Calva extension (Backseat Driver depends on some Calva API:s)
  • The npm command line tool (probably you want to have Nodejs installed, even if Nodejs is not a direct dependency for the script)
  • An OpenAI API key available in your environment as OPENAI_API_KEY

Install

Backseat Driver is meant to be a global (User) Joyride script, so that it is available in all your projects. But you can try it out as a local (Workspace) script:

  1. Open this project in VS Code
  2. Install Nodejs dependencies:
    npm i
  3. Reload the VS Code window (from the Command Palette: Developer: Reload Window)
  4. Create a keyboard shortcut to run the Backseat Driver assistant. This registers ctrl+alt/option+, as the shortcut:
     {
         "key": "ctrl+alt+,",
         "command": "joyride.runCode",
         "args": "(backseat-driver.app/please-advice!)",
     },

TBD: Instructions for how to use Backseat Driver as a global/user script.

Usage

Backseat Driver does not automatically edit your code, or even insert suggestions. At least for now it is more similar to having the ChatGPT chat in VS Code, which is aware of your code context. You ask Backseat Driver for assistance, and it will answer based on your question + the code you are editing.

Your conversation with Backseat Driver will be printed in the Backseat Driver output channel. (More fancy UI is being planned).

To ask Backseat Driver for advice, press ctrl+alt/option+,. You should expect it to work like in the demo video above.

The Backseat Driver Menu

In the status bar you will have a button titled Backseat Driver which opens up the Backseat Driver menu. It lets you:

  • Ask the AI for assistance
  • Start a new chat session
  • Show the output channel

Tips

In the demo above I have placed the Backseat output channel in the Secondary Sidebar. (Search for it in the Command Palette if you're not in the know).

To show the channel at will you can bind a keyboard shortcut, like so:

    {
        "key": "ctrl+alt+a ctrl+alt+a",
        "command": "joyride.runCode",
        "args": "(backseat.ui/show-channel!)",
    },

NB: Since it's Joyride you can script yourself a menu or a statusbar button for things like this too.

Happy Backseat assisted coding!

Issues welcome.

Since this is a Joyride script, it is meant that you adapt it to your needs. If you add things that you think are generally useful, please don't hesitate to tell me about it in an issue, and we can discuss about if it should be a pull request on this repo.

See typos? Please PR.

See bugs? Please Issue (and please PR too!)

License

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

backseat-driver's People

Contributors

dzepat avatar pez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dzepat vefjun

backseat-driver's Issues

Install not working

Hello.
I followed the instructions to install, downloaded your project, open in VS code and created the shortcut.
When using the shortcut, I get a an error:

Could not resolve symbol: backseat

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.