A CLI that converts natural language to shell commands.
Inspired by Github Copilot X CLI, but open source for everyone.
The minimum supported version of Node.js is v14
-
Install ai shell:
npm install -g @builder.io/ai-shell
-
Retrieve your API key from OpenAI
Note: If you haven't already, you'll have to create an account and set up billing.
-
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.
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
└
Check the installed version with:
ai-shell --version
If it's not the latest version, run:
npm update -g @builder.io/ai-shell
I am not a bash wizard, and am dying for access to the copilot CLI, and got impatient.
- 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
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.