DEV Community

Sattyam Jain
Sattyam Jain

Posted on

Introducing Shell-AI: Elevate Your Command Line Experience with Natural Language

Have you ever wished for a magical command-line companion that understands your intentions expressed in natural language? Say hello to Shell-AI (shai), a groundbreaking CLI utility designed to bring the power of natural language understanding to your command line tasks. In this post, we'll explore how Shell-AI revolutionizes your workflow by suggesting single-line commands based on your intent.

What is Shell-AI?

Shell-AI (shai) is a command-line tool that harnesses the LangChain for LLM (Language Model) use and builds on the capabilities of InquirerPy for an interactive CLI experience. It's your intelligent companion that transforms your plain English requests into actionable command suggestions.

Installation Made Easy

Getting started with Shell-AI is a breeze. Simply install it from PyPI using the following command:

pip install shell-ai

Once installed, you can summon the power of Shell-AI by invoking the shai command in your terminal.

How to Use Shell-AI

Using Shell-AI is as intuitive as describing what you want to achieve in natural language. For example, imagine you're working with Terraform and want to perform a dry run. Just type:

shai run terraform dry run thingy

Shell-AI will then astound you with three command suggestions that fulfill your request, tailored to your exact intent:

terraform plan
terraform plan -input=false
terraform plan

Features That Will Amaze You

  1. Natural Language Input: Communicate your tasks in everyday language, and let Shell-AI decipher and suggest the right commands.

  2. Command Suggestions: Receive concise single-line command suggestions that align with your input.

  3. Cross-Platform Compatibility: Whether you're on Linux, macOS, or Windows, Shell-AI's intelligence is at your fingertips.

Fine-Tune Your Experience

Shell-AI adapts to your preferences, thanks to customizable environment variables and configuration options.

Environment Variables:

OPENAI_API_KEY: Essential. Set your OpenAI API key, available on your OpenAI Dashboard.
OPENAI_MODEL: Defaults to gpt-3.5-turbo but customizable to other OpenAI models.
SHAI_SUGGESTION_COUNT: Defaults to 3, but you can define the number of suggestions generated.
OPENAI_API_BASE: Defaults to https://api.openai.com/v1, adjustable for proxies or service emulation.
OPENAI_ORGANIZATION: OpenAI Organization ID.
OPENAI_PROXY: OpenAI proxy.

Configuration File:

For Linux/macOS, create config.json under ~/.config/shell-ai/, and for Windows, under %APPDATA%\shell-ai\. Secure it with permissions (chmod/chown on Linux/macOS) and populate it like:

{
"OPENAI_API_KEY": "your_openai_api_key_here",
"OPENAI_MODEL": "gpt-3.5-turbo",
"SHAI_SUGGESTION_COUNT": "3"
}

Embrace the Freedom of MIT License

Shell-AI is proudly open source and licensed under the MIT License. Check out LICENSE for all the details.

Elevate your command-line game today with Shell-AI, your intelligent companion for natural language-driven tasks. Say goodbye to memorizing intricate commands and embrace a new era of seamless interaction. Try Shell-AI now and experience the future of command-line interfaces.

Reference: https://github.com/ricklamers/shell-ai

Top comments (0)