Skip to main content

AI-powered natural language terminal assistant

Project description

Shelby

Python 3.10+ License: MIT

Shelby is a safety-first, AI-powered natural language terminal assistant. It translates plain English requests into executable shell commands, providing detailed explanations and risk assessments before anything runs.


Demo

Shelby Demo


Getting Started (Step-by-Step)

1. Installation

The easiest way to install Shelby is via pip:

pip install shelby-ai

If you are a developer and want to install it from source:

git clone https://github.com/sk16er/shelby.git
cd shelby
pip install -e .

2. Configuration

Before your first use, you need to configure an AI provider. Shelby supports OpenAI, Anthropic, Google Gemini, and local models via Ollama.

Run the setup wizard:

shelby --setup

Follow the prompts to select your provider and enter your API key. Keys are stored securely in your system's keyring.

3. Your First Command

Try asking Shelby to do something simple:

shelby "list all files in the current directory"

Shelby will generate the command, explain it, and ask for your confirmation.


Usage Modes

Inline Query

Run a single command directly:

shelby "recursively find all .log files and delete them"

Interactive REPL

Type shelby without arguments to enter a persistent session. The REPL remembers the output of previous commands, allowing for follow-up requests:

shelby > list the largest files here
...
shelby > now move the top 3 to /tmp

Pipe Mode

Shelby can process input from other commands:

echo "list docker containers" | shelby

Safety System

Shelby classifies every command into one of three risk tiers to prevent accidental damage:

Tier Behavior Examples
SAFE Press Enter to execute ls, grep, cat, git status
CAUTION Type y to confirm cp, mv, chmod, pip install
DANGER Retype the command name to confirm rm -rf, dd, DROP TABLE

Safety Flags:

  • --dry-run: Display the command and explanation without executing it.
  • --safe: Block all DANGER tier commands entirely.
  • --yes: Skip all confirmation prompts (use with caution).

Advanced Features

  • Explain: Break down any existing command without running it.
    shelby explain "tar -xzvf archive.tar.gz"
    
  • Fix: Analyze a failed command and suggest a correction.
    shelby fix
    
  • History: Perform semantic search over your past Shelby commands.
    shelby history "how did I list those docker images?"
    

License

MIT License. See LICENSE for details.

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

shelby_ai-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

shelby_ai-0.1.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file shelby_ai-0.1.1.tar.gz.

File metadata

  • Download URL: shelby_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for shelby_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8772950f8e945a752438b4b61fe5ef8ba04fb3b0041294ecfe1d86de84fa7884
MD5 9179f2b5645e2d3bdb958c6002aa224d
BLAKE2b-256 5cd09823fc1bec976d3b8b1c8d9ade7d24c4e2ff27ebb73c278e5659c72c5eeb

See more details on using hashes here.

File details

Details for the file shelby_ai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shelby_ai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for shelby_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f453c6f47d86dd5946b3147d1e2f1f23cdd465b0eee82f5e362de2ce03a2d168
MD5 eafc295da1e1e0446c768a65fa83ce89
BLAKE2b-256 be62d2efa51954b6db9670a42dd430c65201fd069ea57bc33cbe0a687e9eae76

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