Git Product home page Git Product logo

npm-copilot's Introduction

npm/yarn/pnpm Copilot

npm/yarn/pnpm copilot is a command-line tool that uses OpenAI's GPT-3 language model to provide suggestions for fixing errors in your code.

๐ŸŒŸ Frameworks:

  • Next.js
  • React
  • Angular
  • Vue.js

๐Ÿ“– How to use:

The CLI tool detects the project type and package manager being used in the current directory. It then runs the appropriate development server command (e.g., npm run dev, yarn run dev, pnpm run dev) and listens for logs generated by the running application. When an error is encountered, the CLI tool provides suggestions for error fixes in real-time.

๐Ÿ› ๏ธ Installation

To install the npm-copilot package, run the following command:

npm install -g npm-copilot

Disclaimer: The CLI tool will begin monitoring the logs generated by the Next.js application and provide suggestions for error fixes in real-time.

โš™๏ธ Configuration

In order to use this package, you need to set your OpenAI API key as an environment variable. You can do this by adding the following line to your .env file, or by setting it directly in your terminal:

For Unix-based systems:

export OPENAI_API_KEY=your_api_key_here

For Windows systems:

set OPENAI_API_KEY=your_api_key_here

Replace your_api_key_here with your actual OpenAI API key.

๐Ÿ–ฅ๏ธ Usage

To use npm-copilot, navigate to the directory containing your Next.js project and run the following command:

npm-copilot

The CLI tool will begin monitoring the logs generated by the Next.js application and provide suggestions for error fixes in real-time.

๐Ÿ“œ License

This package is licensed under the MIT License.

npm-copilot's People

Contributors

eduardconstantin avatar ergomake[bot] avatar rocktimsaikia avatar whoiskatrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

npm-copilot's Issues

Identifier 'getProjectType' has already been declared

I tried running this using the instructions in the README but ended up with this error:

npm i -g npm-copilot

npm-copilot
file:///Users/sun/.nvm/versions/node/v16.19.1/lib/node_modules/npm-copilot/error-listener.js:54
function getProjectType() {
^

SyntaxError: Identifier 'getProjectType' has already been declared
    at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
    at async link (node:internal/modules/esm/module_job:67:21)

I'm running on macOS Ventura and Node v16.19.1

Happy to provide more info to help debug this.

My goal was to check if this also works with other frameworks like vue/nuxt. They also start with npm run dev.
I didn't see any Next.js specific code in the source of this project, but the readme mentions Next.js quite heavily.
I tested with a fresh NextJS install and a Vue project both gave me the same error mentioned above.

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.