Git Product home page Git Product logo

ai-shell's Introduction

AI Shell

A CLI that converts natural language to shell commands.

Gif Demo

Inspired by Github Copilot X CLI, but open source for everyone.

Setup

The minimum supported version of Node.js is v14

  1. Install ai shell:

    npm install -g @builder.io/ai-shell
  2. Retrieve your API key from OpenAI

    Note: If you haven't already, you'll have to create an account and set up billing.

  3. Set the key so ai-shell can use it:

    ai-shell config set OPENAI_KEY=<your token>

    This will create a .ai-shell file in your home directory.

Usage

ai <prompt>

For example:

ai list all log files

Then you will get an output like this, where you can choose to run the suggested command, revise the command via a prompt, or cancel:

◇  Your script:
│
│  find . -name "*.log"
│
◇  Explanation:
│
│  1. Searches for all files with the extension ".log" in the current directory and any subdirectories.
│
◆  Run this script?
│  ● ✅ Yes (Lets go!)
│  ○ 📝 Revise
│  ○ ❌ Cancel
└

Upgrading

Check the installed version with:

ai-shell --version

If it's not the latest version, run:

npm update -g @builder.io/ai-shell

Motivation

I am not a bash wizard, and am dying for access to the copilot CLI, and got impatient.

TODO

  • Support more shells and operating systems (e.g. windows)

Credit

  • Thanks to Github Copilot for their amazing tools and the idea for this
  • Thanks to Hassan and his work on aicommits which inspired the workflow and some parts of the code and flows

Contributing

If you want to help fix a bug or implement a feature in Issues (tip: look out for the help wanted label), checkout the Contribution Guide to learn how to setup the project.

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.