Skip to main content

Natural language to shell commands with AI - Interactive CLI tool

Project description

VibeBash - Offline AI Shell Assistant

VibeBash is a completely offline natural language to shell command translator powered by local AI models through Ollama. No API keys, no internet connection required - everything runs locally on your machine.

๐ŸŒŸ Features

  • ๐Ÿ”’ 100% Offline: All processing happens locally via Ollama
  • ๐Ÿค– AI-Powered: Convert natural language to shell commands
  • ๐Ÿš€ Fast: Local models mean no network latency
  • ๐Ÿ” Private: Your commands never leave your machine
  • ๐ŸŽฏ Accurate: Supports reasoning models like deepcoder
  • โšก Interactive: Review, modify, or skip commands before execution
  • ๐Ÿ“ Smart History: Learn from previous command patterns
  • ๐Ÿ› ๏ธ Command Validation: Checks command availability and provides installation hints

๐ŸŽฏ Supported Models

VibeBash works with any Ollama-compatible model:

  • deepcoder - Reasoning model with think tokens (recommended)
  • llama3.2 - Fast and capable general model
  • codellama - Code-focused model
  • mistral - Efficient and accurate
  • gemma - Google's lightweight model

๐Ÿ“ฆ Installation

Requirements

  1. Python 3.8+
  2. Ollama - Install from ollama.ai

Quick Install with pipx (Recommended)

pipx install vibebash

Install from Source

git clone https://github.com/yourusername/vibebash.git
cd vibebash
pip install -e .

Development Setup

./scripts/setup-dev.sh

๐Ÿš€ Quick Start

  1. Start Ollama:

    ollama serve
    
  2. Pull a model (if you don't have one):

    ollama pull deepcoder    # Reasoning model (recommended)
    # or
    ollama pull llama3.2     # Fast general model
    
  3. Run VibeBash:

    vibebash "list all Python files in this directory"
    
  4. First time setup - VibeBash will ask for:

๐Ÿ’ก Usage Examples

Basic Commands

vibebash "show disk usage"
vibebash "find large files over 100MB"
vibebash "kill process on port 8080"

With Specific Models

vibebash --model-name deepcoder "optimize this Python script"
vibebash --model-name llama3.2 "compress all images in this folder"

Interactive Mode

vibebash
# Then type your request when prompted

View History

vibebash --history

Reconfigure

vibebash --config

๐Ÿ”ง Configuration

VibeBash stores configuration in ~/.vibebash_config.json:

{
  "ollama_base_url": "http://localhost:11434",
  "default_model_name": "deepcoder"
}

Custom Ollama Setup

If running Ollama on a different host or port:

vibebash --config
# Enter custom URL like: http://my-server:11434

๐Ÿงช Testing

Run All Tests

make test-ollama

Quick Core Tests

python3 -m pytest tests/unit/test_models.py tests/unit/test_command_availability.py -v

Test with Your Model

make test-deepcoder  # Test with deepcoder model

๐Ÿ“ Project Structure

vibebash/
โ”œโ”€โ”€ vibebash/           # Main package
โ”‚   โ”œโ”€โ”€ main.py         # Core VibeBash class
โ”‚   โ””โ”€โ”€ __init__.py     # Package initialization
โ”œโ”€โ”€ tests/              # Test suite
โ”‚   โ”œโ”€โ”€ unit/           # Unit tests
โ”‚   โ””โ”€โ”€ integration/    # Integration tests
โ”œโ”€โ”€ scripts/            # Setup and utility scripts
โ”‚   โ”œโ”€โ”€ quick-start.sh  # Quick setup
โ”‚   โ””โ”€โ”€ setup-dev.sh    # Development setup
โ””โ”€โ”€ docs/               # Documentation

๐Ÿ› ๏ธ Development

Setup Development Environment

./scripts/setup-dev.sh

Run Tests

make test           # All tests
make test-unit      # Unit tests only
make coverage       # With coverage report

Code Quality

make lint           # Linting
make format         # Code formatting
make type-check     # Type checking

Build Package

make build

๐Ÿค– Model Recommendations

For Reasoning Tasks (Recommended)

  • deepcoder: Best for complex command generation with step-by-step thinking
  • codellama: Good for code-related tasks

For Speed

  • llama3.2: Fast and lightweight, good balance of speed and accuracy
  • gemma: Very fast, good for simple commands

Memory Usage

  • Small models: llama3.2 (3B), gemma (2B-7B)
  • Large models: deepcoder (14B), codellama (13B+)

๐Ÿ” How It Works

  1. Input: You provide a natural language description
  2. Processing: Local Ollama model converts it to shell commands
  3. Validation: VibeBash checks command availability
  4. Review: You can approve, modify, or skip each command
  5. Execution: Commands run in your local shell
  6. Learning: History helps improve future suggestions

๐Ÿ›ก๏ธ Privacy & Security

  • No Data Transmission: Everything stays on your machine
  • No API Keys: No external services required
  • Command Review: You control what gets executed
  • Safe Defaults: Built-in protections against dangerous commands

๐Ÿ“š Advanced Usage

Custom Prompts

VibeBash includes system context about your environment:

  • Current directory
  • Available commands
  • Operating system
  • Recent command history

Batch Operations

vibebash "create backup of all config files and compress them"
vibebash "find and remove all temporary files older than 7 days"

Error Recovery

When commands fail, VibeBash can suggest alternatives:

vibebash "install package X"
# If package manager not found, suggests alternatives for your OS

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Run tests: make test-ollama
  4. Submit a pull request

๐Ÿ“œ License

MIT License - see LICENSE file.

๐Ÿ”— Links


VibeBash: Because your shell should understand you, not the other way around. ๐ŸŽฏ

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

vibebash-1.0.1.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

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

vibebash-1.0.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file vibebash-1.0.1.tar.gz.

File metadata

  • Download URL: vibebash-1.0.1.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for vibebash-1.0.1.tar.gz
Algorithm Hash digest
SHA256 25a1351b24c603216accfb50f1147df2f2bc01fd07844bbb9178c5d46c7af325
MD5 ad8cd10aa590f591901eb86a3158b33f
BLAKE2b-256 9e7b705ae62e9b6ef308ab2dbf72fdc1320504a1afd89aed119a9a91aff6f04f

See more details on using hashes here.

File details

Details for the file vibebash-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vibebash-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for vibebash-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d19359694540f783266c0d2bc8c598005cd16515883f438090bafc54c6ea3f8
MD5 499a43a15cff4c7755811f53d70c4bed
BLAKE2b-256 96dd6cc6a44431543b1d6aab925773e69201ccfa94b10d32e6e6f07484a695ae

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