shell-prompt is a command-line tool that translates natural language instructions into executable shell commands using an LLM. It supports multiple LLM providers (like OpenAI, Anthropic, Google Gemini, etc.) and adapts to the user's operating system.
- USER INPUT:
shell-prompt "list all files in my Desktop directory"- OUTPUT:
Command to run:
dir "%UserProfile%\Desktop"
Execute this command? [y/N]: y
Running command: dir "%UserProfile%\Desktop"
*Command output here*- Converts natural language into shell commands
- Supports execution and preview mode
- Compatible with Windows, Linux, and macOS
- Extensible to multiple LLM providers via
langchain - Lightweight and configurable
You can install it from your local build or via PyPI.
pip install shell-prompt[google-genai]- openai
- anthropic
- google-genai
- groq
- cohere
- langchain-nvidia-ai-endpoints
- fireworks
- mistralai
- together
- langchain-xai
- langchain-perplexity
Once installed, you should first configure the tool. Available options are:
| Option | Description |
|---|---|
-h, --help |
Show the help message and exit |
--version |
Show the program's version number and exit |
--config |
Show the current configuration |
--set-provider PROVIDER_NAME |
Set the LLM provider |
--set-model MODEL_NAME |
Set the specific model to use |
--set-api-key API_KEY |
Set the API key for the currently selected provider |
--preview, --no-preview |
Enable or disable preview mode (avoid instant execution - enabled by deafult) |
Example:
shell-prompt --set-provider google-genai --set-model "gemini-2.0-flash" --set-api-key APIKEY --no-previewPrint out the configuration:
shell-prompt --configRun the tool:
shell-prompt "show current time, but only the seconds"Running command: powershell Get-Date -Format ss
39