Giter VIP home page Giter VIP logo

clai's Introduction

npm version npm version npm version

ClAi ๐Ÿš€

A CLI tool to process input command into shell script and execute it. Every prompt is translated to a command using GPT-3 and executed.

Installation

Run these commands to get started:

npm install -g @mysticfragilist/clai

You then need to configure ClAi using your OpenAI API Key. To do so create an account on OpenAI API website and create a new secret key. Then copy your organization ID from this page.

clai -c

Usage

To use ClAi simply call it as such:

clai "create ten files named 1.txt to 10.txt"
clai "navigate to My Documents and list all files starting with 'a'" -s bash
clai "check my public ip" -f

It will parse the prompt into a command and execute it.

arguments description
-c or --config Configure your API key and organization ID for OpenAI.
<PROMPT> Text prompt to translate the command.
-s or --shell Choose a shell to execute the command against (it needs to exist in the system). If none, is provided default to the current one.
-f or --force Force to parse the text using OpenAI (bypass cache)
-h or --help To see the usage guide of ClAi.

Examples

Roadmap

  • Parse prompt throught cli and send it to your OpenAI account.
  • Support multiple shell format (cmd, bash, fish, zsh, powershell)
  • Allow omitting shell argument and default to current shell.
  • Allow using bash script instead of child_process to process call (allow for loop and other interesting command for example).
  • Continuously redirect output and input to and from the process.
  • Allow user to choose which solution if multiple commands can be use.
  • Keep an history of commands to allow caching certain commands to reexecute the same way.
  • Find some logic to discard cache based on timestamp and number of time it's read.
  • Add testing solution for unit and e2e to make sure everything is right on track.
  • Make a shell (or a zsh plugin) to support handling wrongly entered command.

Distribution

The image used as a logo was generated through Dalle-2. This project is licenced under MIT.

Contribution

To contribute, you can create an issue on this repository or making a pull request you can follow these guidelines.

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.