Skip to main content

An AI-powered shell assistant using Google Gemini API

Project description

Tavix

Your AI-powered shell assistant and coding companion

Python License PyPI

Tavix is a powerful command-line interface (CLI) tool that leverages Google's Gemini AI to transform your terminal experience. Whether you're a developer, system administrator, or tech enthusiast, Tavix helps you generate, understand, and fix commands and code with natural language.

Table of Contents

Quick Start Guide

Step 1: Prerequisites

Before installing Tavix, ensure you have:

  • Python 3.8 or higher installed on your system
  • A Google Gemini API key (we'll help you get this in Step 3)

Step 2: Installation

Choose your preferred installation method:

Option A: Easy Installation (Recommended)

pip install tavix

Option B: Platform-Specific Installation

For Linux Users:

# Option 1: Global install with sudo
sudo pip install tavix

# Option 2: For Ubuntu 22.04+ (if Option 1 fails)
sudo pip install tavix --break-system-packages

For macOS Users:

# Using virtual environment (recommended)
python3 -m venv tavix-venv
source tavix-venv/bin/activate
pip install tavix

Option C: Development Installation

# Clone the repository
git clone https://github.com/Atharvadethe/Tavix.git
cd Tavix

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Step 3: Get Your Gemini API Key

  1. Visit Google AI Studio: https://aistudio.google.com/app/apikey
  2. Sign in with your Google account
  3. Create a new API key by clicking the "Create API Key" button
  4. Copy the API key - you'll need it in the next step

Step 4: Configure Tavix

Run the interactive setup to configure your API key:

tavix setup
# or
tx setup

The setup wizard will guide you through:

  • Setting up your Gemini API key securely
  • Choosing the best configuration method for your system
  • Testing the connection to ensure everything works

Alternative Manual Setup:

# Windows (PowerShell)
$env:GEMINI_API_KEY="your_api_key_here"

# Windows (CMD)
set GEMINI_API_KEY=your_api_key_here

# Linux/macOS
export GEMINI_API_KEY=your_api_key_here

Note: These commands set the API key only for the current terminal session. If you open a new terminal, you will need to set the variable again. To make it permanent, add the appropriate line to your shell profile or environment settings.

Step 5: Restart Your Terminal

IMPORTANT: RESTART YOUR TERMINAL AFTER SETUP This ensures the environment variables are properly loaded.

Note: You can use the alias tx for all Tavix commands. For example, tx generate ... is equivalent to tavix generate ....

Step 6: Test Your Installation

Verify everything is working:

# Check Tavix status
tavix status

# Try a simple command
tavix generate "List all Python files"

Features

Core Capabilities

  • Generate shell commands and code snippets from natural language descriptions
  • Explain complex shell commands line by line
  • Fix broken or incorrect shell commands
  • Explain code snippets in any programming language
  • Ask anything - general knowledge, concepts, and explanations

Advanced Features

  • Multi-language Support: Bash, Python, JavaScript, Java, C++, SQL, and more
  • Rich Output: Beautiful, formatted responses with syntax highlighting
  • Clipboard Integration: Copy results directly to clipboard
  • File Export: Save generated code to files
  • Smart Explanations: Get detailed explanations with examples

Usage Guide

Basic Commands

# Generate a shell command
tavix generate "List all Python files in the current directory" --lang bash --explain
# or
tx generate "List all Python files in the current directory" --lang bash --explain

# Explain a complex command
tavix explain "find . -name '*.py' -exec grep -l 'import' {} \;"
# or
tx explain "find . -name '*.py' -exec grep -l 'import' {} \;"

# Fix a broken command
tavix fix "ls -l | grpe py"
# or
tx fix "ls -l | grpe py"

# Explain code
tavix explain-code "for i in range(10): print(i**2)"
# or
tx explain-code "for i in range(10): print(i**2)"

# Ask anything
tavix ask "How do neural networks work?"
# or
tx ask "How do neural networks work?"

Advanced Usage

# Generate and save to file
tavix generate "Create a web scraper" --lang python --save scraper.py --copy

# Generate with explanation
tavix generate "Backup all .py files with timestamp" --lang bash --explain

# Ask about current events
tavix ask "What are the latest developments in AI technology?"

Command Reference

generate - Generate Commands and Code

Generate shell commands or code snippets from natural language descriptions.

tavix generate "your task description" [OPTIONS]

Options:

  • --lang <language> - Specify programming language (bash, python, cpp, java, etc.)
  • --explain - Add detailed explanation
  • --save <filename> - Save result to file
  • --copy - Copy result to clipboard

Examples:

tavix generate "Create a backup script" --lang bash --explain
tavix generate "Web scraper using requests" --lang python --save scraper.py

explain - Explain Shell Commands

Get line-by-line explanations of shell commands.

tavix explain "your shell command"

Examples:

tavix explain "ls -la | grep py | wc -l"
tavix explain "find . -name '*.py' -exec grep -l 'import' {} \;"

fix - Fix Broken Commands

Fix and explain broken or incorrect shell commands.

tavix fix "broken shell command"

Examples:

tavix fix "ls -l | grpe py"
tavix fix "docker run -p 8000 myapp"

explain-code - Explain Code Snippets

Get detailed explanations of code in any programming language.

tavix explain-code "your code snippet"

Examples:

tavix explain-code "def factorial(n): return 1 if n <= 1 else n * factorial(n-1)"
tavix explain-code "async def fetch_data(): return await requests.get(url)"

ask - Ask Anything

Get answers and explanations on any topic.

tavix ask "your question or topic"

Examples:

tavix ask "How do quantum computers work?"
tavix ask "What are the benefits of renewable energy?"
tavix ask "Explain the history of artificial intelligence"

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

tavix-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tavix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 32626fe9124aae1590035bcadc2836be4d585b053731c66ca61dceb495a11cdf
MD5 df3db9b6079a996a2ae59b4abca12400
BLAKE2b-256 e8e64187b28eaddf8821cabc4072364f734550280cb3e6325d488f1a4b83ece7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tavix-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.1.0 CPython/3.11.9

File hashes

Hashes for tavix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 760633de1d58ce7fbb50f14dbccbed9d09907e24cad339e912913e7962694cef
MD5 da7c134144f30ce06a64d030a6340a3f
BLAKE2b-256 5ec6aeea0d77bf9aff652b6e408ae02b63d7d47b51e52e0c2490c2f1dc3197f8

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