AI Shell: A CLI that converts natural language to shell commands
AI Shell is an open source CLI inspired by GitHub Copilot X CLI that allows users to convert natural language into shell commands. With the help of OpenAI, users can use the CLI to engage in a conversation with the AI and receive helpful responses in a natural, conversational manner. To get started, users need to install the package using npm, retrieve their API key from OpenAI and set it up. Once set up, users can use the AI Shell in different modes, such as chat mode, silent mode, and can even customize OpenAI API endpoints, set preferred languages and view and set config options using an interactive UI.
Users can install the package by running the following command:
npm install -g @builder.io/ai-shell
To set the API key, users need to run the following command:
ai config set OPENAI_KEY=<your token>
The AI Shell supports different modes:
- Chat mode: users can engage in a conversation with the AI and receive helpful responses in a natural, conversational manner.
- Silent mode: users can disable and skip the explanation section by using the flag -s or --silent.
Users can also customize OpenAI API endpoints, set preferred languages and view and set config options using an interactive UI. The default language is English, but users can switch to their preferred language using the corresponding language keys.
Users can upgrade to the latest version by running the following command:
npm update -g @builder.io/ai-shell
The project is open to contributions, and users can contribute by fixing a bug or implementing a feature in Issues.
Special characters like ? or * can be wrapped in quotes to avoid issues.
Some users may encounter a 429 error from OpenAI, which is due to incorrect billing setup or excessive quota usage. Users can activate billing at https://billing.openai.com/signup and make sure to add a payment method if not under an active grant from OpenAI.
AI Shell was created for users who are not bash wizards and are looking for an easier way to convert natural language to shell commands.
AI Shell gives credit to GitHub Copilot for their amazing tools and the idea for this and to Hassan and his work on aicommits which inspired the workflow and some parts of the code and flows.
Users can join the Builder.io discord and chat with others in the #ai-shell room.
Entities: Node.js, OpenAI, CLI, npm, API, GitHub Copilot, Hassan, bash wizards