No project description provided
Project description
Shell-AI: Your Intelligent Command-Line Companion
Shell-AI (shai
) is a CLI utility that brings the power of natural language understanding to your command line. Simply input what you want to do in natural language, and shai
will suggest single-line commands that achieve your intent. Under the hood, Shell-AI leverages the LangChain for LLM use and builds on the excellent InquirerPy for the interactive CLI.
Installation
You can install Shell-AI directly from PyPI using pip:
pip install shell-ai
After installation, you can invoke the utility using the shai
command.
Usage
To use Shell-AI, open your terminal and type:
shai run terraform dry run thingy
Shell-AI will then suggest 3 commands to fulfill your request:
terraform plan
terraform plan -input=false
terraform plan
Features
- Natural Language Input: Describe what you want to do in plain English (or other supported languages).
- Command Suggestions: Get single-line command suggestions that accomplish what you asked for.
- Cross-Platform: Works on Linux, macOS, and Windows.
- Azure Compatibility: Shell-AI now supports Azure OpenAI deployments.
Configuration
Environment Variables
OPENAI_API_KEY
: Required. Set this environment variable to your OpenAI API key. You can find it on your OpenAI Dashboard.
Optional Variables
OPENAI_MODEL
: Defaults togpt-3.5-turbo
. You can set it to another OpenAI model if desired.SHAI_SUGGESTION_COUNT
: Defaults to 3. You can set it to specify the number of suggestions to generate.OPENAI_API_BASE
: Defaults tohttps://api.openai.com/v1
. You can set it to specify the proxy or service emulator.OPENAI_ORGANIZATION
: OpenAI Organization IDOPENAI_PROXY
: OpenAI proxyOPENAI_API_TYPE
: Set to "azure" if you are using Azure deployments.AZURE_DEPLOYMENT_NAME
: Your Azure deployment name (required if using Azure).AZURE_API_BASE
: Your Azure API base (required if using Azure).
Configuration File
Alternatively, you can store these variables in a JSON configuration file:
- For Linux/macOS: Create a file called
config.json
under~/.config/shell-ai/
and secure it withchmod 600 ~/.config/shell-ai/config.json
. - For Windows: Create a file called
config.json
under%APPDATA%\shell-ai\
Example config.json
:
{
"OPENAI_API_KEY": "your_openai_api_key_here",
"OPENAI_MODEL": "gpt-3.5-turbo",
"SHAI_SUGGESTION_COUNT": "3"
}
The application will read from this file if it exists, overriding any existing environment variables.
Run the application after setting these configurations.
Contributing
This implementation can be made much smarter! Contribute your ideas as Pull Requests and make AI Shell better for everyone.
Contributions are welcome! Please read the CONTRIBUTING.md for guidelines.
License
Shell-AI is licensed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file shell-ai-0.3.13.tar.gz
.
File metadata
- Download URL: shell-ai-0.3.13.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63217e6909f7baf201175575bd23b41bd4d532d2375cd302346f4b1fd5de5671 |
|
MD5 | e6fb639df33f1f09b80c8126cde09947 |
|
BLAKE2b-256 | 201429c8796630a1d0a21692f8c4cae1ba4e89b392c8c29a1a43f9fb5d83d63c |
File details
Details for the file shell_ai-0.3.13-py3-none-any.whl
.
File metadata
- Download URL: shell_ai-0.3.13-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf5ee6976b3ba247b919f31a901936cfaedfdade5d2e4a2bb05d04177c6df739 |
|
MD5 | dfebf368bda4a02a28646d47920a858c |
|
BLAKE2b-256 | d37fbc4147a46721b39affcf9ce5c1708c422c9d544001d75411baabcd233727 |