1.0.4 • Published 1 year ago

@mysticfragilist/clai v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ClAi :rocket:

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.

argumentsdescription
-c or --configConfigure your API key and organization ID for OpenAI.
<PROMPT>Text prompt to translate the command.
-s or --shellChoose 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 --forceForce to parse the text using OpenAI (bypass cache)
-h or --helpTo 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.

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.6.0

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago