Skip to main content

A command-line tool that converts natural language instructions into shell commands and executes them.

Project description

🐚 shell-prompt

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.

Usage example:

  • 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*

🚀 Features

  • 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

📦 Installation

You can install it from your local build or via PyPI.

Installation should be done with a specific LLM provider, such as:

pip install shell-prompt[google-genai]

List of supported providers:

  • openai
  • anthropic
  • google-genai
  • groq
  • cohere
  • langchain-nvidia-ai-endpoints
  • fireworks
  • mistralai
  • together
  • langchain-xai
  • langchain-perplexity

🛠 Usage

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-preview

Print out the configuration:

shell-prompt --config

Run the tool:

shell-prompt "show current time, but only the seconds"
Running command: powershell Get-Date -Format ss
39

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shell_prompt-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shell_prompt-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file shell_prompt-0.1.0.tar.gz.

File metadata

  • Download URL: shell_prompt-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shell_prompt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 658c7376c9e0977712be9c7b3805cc1175d2ce4a9389c4809cb79bc02def32ba
MD5 2b07436acd33fb837cfcf98c2b27b0c3
BLAKE2b-256 44a78c381dbc676ff18aad44f982b1309f54b35e4710cb88adc0fb7dd448faf8

See more details on using hashes here.

File details

Details for the file shell_prompt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shell_prompt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shell_prompt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5802e0b6c765aa95c2be918592a595a4ceb6babcd5e67b7a5ba6d2b1c0d8363
MD5 3a4f6a139a6a261d75dbebed41a3adb0
BLAKE2b-256 e391dced4bfc03109654169f21b7f8309a96a6fdb7972b8561336ebc4c839979

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page