Shell-AI: Let AI Write Your Shell Commands
Shell-AI, affectionately referred to as shai
, is an innovative command-line interface (CLI) tool designed to simplify your life by using natural language to craft shell commands for you. By leveraging the power of machine-learning models, specifically through the use of LangChain for large language models (LLM) and InquirerPy for user-interactive CLI, shai
allows you to express your intentions in plain language and receive practical command-line suggestions.
Installation
Shell-AI is accessible and straightforward to install. Users can add it to their setup directly from PyPI with a simple pip command:
pip install shell-ai
It's important to note that Linux users need to have Python 3.10 or a later version. Once installed, the tool can be activated through the shai
command in the terminal.
Usage
Utilizing Shell-AI is user-friendly. Simply open your terminal and provide instructions like:
shai run terraform dry run thingy
Shell-AI will work its magic and offer up to three command options, such as:
terraform plan
terraform plan -input=false
terraform plan
Features
Shell-AI brings a multitude of features to the table:
- Natural Language Input: Allows users to describe their needs in an everyday language that
shai
can comprehend. - Command Suggestions: Delivers intuitive, singular command-line solutions tailored to your requests.
- Cross-Platform Compatibility: Whether you're on Linux, macOS, or Windows, Shell-AI integrates seamlessly.
- Azure Compatibility: Shell-AI is equipped to support Azure OpenAI deployments for versatile application.
Configuration
To fine-tune Shell-AI to your preferences, several environment variables can be configured:
OPENAI_API_KEY
: A mandatory variable that should be set with your OpenAI API key, which is accessible via your OpenAI Dashboard.OPENAI_MODEL
: Set by default togpt-3.5-turbo
, but users can opt for alternate OpenAI models.OPENAI_MAX_TOKENS
: No preset limit unless set by the user, controls the maximum number of tokens generated within a session.SHAI_SUGGESTION_COUNT
: Defaults to providing three suggestion alternatives; adjustable according to user needs.OPENAI_API_BASE
: Usually set tohttps://api.openai.com/v1
, but users can also specify other proxies.- Support for Azure settings like
AZURE_DEPLOYMENT_NAME
andAZURE_API_BASE
if using Azure.
Moreover, these configurations can be stored conveniently in a configuration file, making it easier to manage settings and preferences.
Contributing
Shell-AI is continuously evolving and welcomes the ideas and improvements contributed by its user community. Users inclined to enhance the tool are encouraged to fork the repository and submit their enhancements as Pull Requests. Contribution guidelines are available in the project documentation to facilitate community involvement.
License
This novel tool is freely accessible under the MIT License, allowing users to explore and integrate Shell-AI within their digital ecosystems. Details of the license are available within the project's documentation.
Shell-AI is more than just a utility; it embodies the fusion of cutting-edge AI with traditional shell command usability, enhancing productivity and user interaction through versatile language-based inputs.