A Linux terminal interface with natural language processing capabilities
Project description
LinAIx
AI-Powered Linux Command Assistant
Improve your Linux experience with natural language commands powered by Google Gemini AI
Features • Linux Distribution Support • Installation • Quick Start • Usage • Configuration • Contributing
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
exitorquitto 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
--setupcommand - JSON Configuration: Easy-to-edit settings file at
~/.linaix/config.json - Environment Variables: Support for
GOOGLE_API_KEYenvironment 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 |
Debian |
Fedora |
Arch Linux |
|
CentOS |
Red Hat |
openSUSE |
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) - Defaultgemini-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
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
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linaix-0.1.3.tar.gz.
File metadata
- Download URL: linaix-0.1.3.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbc6ecafa001cb43ce01f3a8186bc2933f64d2c2eb5906449afb86bb3b18604b
|
|
| MD5 |
504230cc6d1f4d8d050204f110970d3e
|
|
| BLAKE2b-256 |
93b566c88fe11ec147e85c63b3fb6dec0588bff5cb44a8d4e9f090d57ca4053a
|
File details
Details for the file linaix-0.1.3-py3-none-any.whl.
File metadata
- Download URL: linaix-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0d4749647fb25d8fa568e315f3e1bf4cb184ee9b450ce3b08a64b4bbea191cd
|
|
| MD5 |
590636767550059c456ab6ab69c9e127
|
|
| BLAKE2b-256 |
a2ecae6f77f90967bac1c715274f6f61da2a19e1d5658ee866550fe06436f4c2
|