Skip to main content

A Linux terminal interface with natural language processing capabilities

Project description

🐧 LinAIx

AI-Powered Linux Command Assistant

Python License Platform AI

Improve your Linux experience with natural language commands powered by Google Gemini AI

FeaturesLinux Distribution SupportInstallationQuick StartUsageConfigurationContributing

LinAIx Demo Video

Recording showing Linaix generating different linux command based on user natural language input

---

🎯 What is LinAIx?

LinAIx is a command-line tool bridging the gap between human language and Linux system shell command. Instead of memorizing complex shell commands, simply describe what you want to do in plain English, and LinAIx will generate and execute the appropriate Linux commands for you.

🌟 Why LinAIx?

  • 🚀 Productivity Boost: No more Googling commands or reading man pages
  • 🛡️ Safety First: Built-in protection against destructive operations
  • 🧠 AI-Powered: Leverages Google Gemini for intelligent command generation
  • 📚 Learning Tool: Understand what commands do with detailed explanations
  • ⚡ Interactive Mode: Full AI-powered terminal experience

✨ Features

🤖 Natural Language Processing

Turn everyday language into precise Linux commands:

"Show me all Python files in the current directory"
# Generates: ls *.py

"Create a backup of my documents folder"
# Generates: cp -r ~/Documents ~/Documents_backup_$(date +%Y%m%d)

🖥️ Interactive AI Terminal

Launch a full-featured AI-powered terminal session:

linaix --interactive
  • Smart Context Awareness: Understands your current directory and system state
  • Real-time Command Generation: Instantly converts your requests to commands
  • Error Recovery: Automatically suggests fixes when commands fail
  • Natural Exit: Simply type exit or quit to close

📚 Command History & Learning

  • Persistent History: All your commands are saved for future reference
  • Command Reuse: Replay previous commands with --reuse <index>
  • Learning Insights: Understand what each command does with --verbose

🏷️ Smart Aliases

Create custom shortcuts for your most common tasks:

# Create an alias
linaix --add-alias listpy "list all python files"

# Use the alias
linaix listpy

🛡️ Safety Features

  • Destructive Command Warnings: Confirmation prompts for dangerous operations
  • Safe Command Generation: AI prioritizes non-destructive solutions
  • Error Handling: Graceful handling of command failures with alternative suggestions

⚙️ Flexible Configuration

  • Interactive Setup: Easy setup with --setup command
  • JSON Configuration: Easy-to-edit settings file at ~/.linaix/config.json
  • Environment Variables: Support for GOOGLE_API_KEY environment variable
  • Model Selection: Choose your preferred Gemini model during setup
  • Custom Aliases: Persistent alias management

🐧 Linux Distribution Support

LinAIx automatically detects your Linux distribution and generates command based on your specific system.

Supported Linux Distributions

Ubuntu
Ubuntu
Debian
Debian
Fedora
Fedora
Arch Linux
Arch Linux
CentOS
CentOS
Red Hat
Red Hat
openSUSE
openSUSE
Linux Mint
Linux Mint

LinAIx works with all major Linux distributions and automatically adapts to your system

🚀 Installation

Prerequisites

  • Python 3.8+
  • Linux Distribution (Ubuntu, Debian, Fedora, Arch Linux, CentOS, Red Hat, openSUSE, Linux Mint, etc.)
  • Google Gemini API Key (Get one here)

Install LinAIx

LinAIx using pip:

pip install linaix

After installation, you can run LinAIx directly:

linaix --help

Configure Your API Key

Option A: Interactive Setup (Recommended)

linaix --setup

This will guide you through setting up your API key and choosing your preferred Gemini model interactively.

Option B: Environment Variable

export GOOGLE_API_KEY='your-api-key-here'

Option C: Manual Configuration

# The config file will be created automatically at ~/.linaix/config.json
# You can edit it manually if needed
nano ~/.linaix/config.json

Available Models:

  • gemini-1.5-flash (fast, good for most tasks) - Default
  • gemini-1.5-pro (more capable, slower)
  • gemini-pro (legacy model)

🎮 Quick Start

1. Generate Your First Command

linaix "list all files in the current directory"

LinAIx automatically detects your Linux distribution and optimizes commands for your system

2. Launch Interactive Mode

linaix --interactive

3. Create Your First Alias

linaix --add-alias cleanup "remove all temporary files"

📖 Usage Guide

Interactive Mode 🖥️

Run LinAIx in interactive mode for a natural language terminal experience:

linaix --interactive

This will run the LinAIx natural language terminal directly in your current terminal window.

Interactive Mode Features:

  • 🎯 Natural Language Input: Type what you want to do in plain English
  • 🔄 Real-time Execution: Commands are generated and executed immediately
  • 📊 Visual Feedback: Clear success/error indicators
  • 🧠 Context Awareness: AI understands your current directory and system state
  • 🔧 Error Recovery: Automatic suggestions when commands fail
  • 🖥️ Current Terminal: Runs in your current terminal session (no new windows)

Example Interactive Session:

user@host:/home/user $ create a new project folder called myapp
Generated Command: mkdir -p myapp
✓ Success

user@host:/home/user $ list all files in the project
Generated Command: ls -la myapp/
✓ Success

user@host:/home/user $ install git if it's not already installed
Generated Command: sudo apt update && sudo apt install -y git
✓ Success

One-off Commands

Generate commands for specific tasks:

# Basic command generation
linaix "find all PDF files in the current directory"

# With explanation
linaix --verbose "create a backup of my documents"

# Complex tasks
linaix "install the latest version of Node.js and npm"

Alias Management 🏷️

Create and manage custom shortcuts:

# Add an alias
linaix --add-alias listpy "list all python files"
linaix --add-alias cleanup "remove all .tmp files"

# Use aliases
linaix listpy
linaix cleanup

# List all aliases
linaix --list-aliases

# Remove an alias
linaix --remove-alias cleanup

Command History 📚

Access and reuse previous commands:

# View command history
linaix --history

# Reuse a specific command
linaix --reuse 2

⚙️ Configuration

Configuration File Location

~/.linaix/config.json

The configuration file is automatically created on first run with sensible defaults. You can modify it manually or use the interactive setup command.

Configuration Options

{
  "api_key": "your-gemini-api-key",
  "model": "gemini-1.5-flash",
  "auto_run_safe": false,
  "aliases": {
    "listpy": "list all python files",
    "cleanup": "remove temporary files"
  }
}

Setup Commands

# Interactive setup (recommended)
linaix --setup

# Set API key directly
linaix --set-api-key "your-api-key-here"

Environment Variables

export GOOGLE_API_KEY="your-api-key-here"

🖼️ Screenshots

Interactive Mode Demo

LinAIx Interactive Mode

Screenshot showing the AI-powered terminal interface with natural language input and command generation


🔧 Troubleshooting

Common Issues

"No Google API key found"

# Use the interactive setup (recommended)
linaix --setup

# Or set your API key via environment variable
export GOOGLE_API_KEY="your-api-key-here"

# Or set API key directly
linaix --set-api-key "your-api-key-here"

"Permission denied"

# Try reinstalling the package
pip install --force-reinstall linaix

# Or check if the command is in your PATH
which linaix

🤝 Contributing

We welcome contributions! Here's how you can help:

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Test thoroughly
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Development Setup

git clone https://github.com/AdirAli/linaix.git
cd linaix
pip install -e .

Note: For development and contributing, you can install from source using the above commands. For regular usage, use pip install linaix.

Code Style

  • Follow PEP 8 guidelines
  • Add type hints where appropriate
  • Include docstrings for new functions
  • Write tests for new features

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Made wit for the Linux community

GitHub stars GitHub forks GitHub issues

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

linaix-0.1.1.tar.gz (12.1 MB view details)

Uploaded Source

Built Distribution

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

linaix-0.1.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: linaix-0.1.1.tar.gz
  • Upload date:
  • Size: 12.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for linaix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 32d3f5837145d2e733b6e1bcd2f80e7c7b746397724a060006e76014bc7e9f25
MD5 439f436385c903fd7a8be197cbfc0e7b
BLAKE2b-256 213e8596d255ee7e5fcb15e1f24ff31f87718e2189127641db28eda96b68aca1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: linaix-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for linaix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 744547e093195c4679055de2885c44ece888dde2870089e95f502836af5577a9
MD5 539dd45f94175a22255318c494a32643
BLAKE2b-256 e42d82c6f622f646a4cab46057f1811506c821c2b971b64184b00dadadd80aa9

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