Skip to main content

XandAI - Multi-Provider AI Terminal Assistant with Interactive Code Execution

Project description

XandAI CLI - Multi-Provider AI Terminal Assistant

Tests Build PyPI version License: MIT Python 3.8+

 __  __               _       _
 \ \/ /__ _ _ __   __| | __ _(_)
  \  // _` | '_ \ / _` |/ _` | |
  /  \ (_| | | | | (_| | (_| | |
 /_/\_\__,_|_| |_|\__,_|\__,_|_|

XandAI CLI is a powerful terminal assistant with multi-provider AI support that seamlessly blends AI conversation with local command execution. Supporting Ollama, LM Studio, and more - it provides intelligent code assistance, project planning, and command-line automation all within a beautiful, interactive terminal interface.

📸 See It In Action

XandAI CLI Interface

XandAI seamlessly switches between AI chat and terminal commands - ask questions, get code help, and execute commands all in one interface

⚡ Quick Start

# Install XandAI
pip install xandai-cli

# Start with auto-detection
xandai --auto-detect

# Or specify a provider
xandai --provider ollama
xandai --provider lm_studio --endpoint http://localhost:1234

# Start chatting or running commands
xandai> python --version
xandai> How do I optimize this Flask route?
xandai> /task create a REST API with authentication

🔗 Multi-Provider Support

XandAI now supports multiple LLM providers with automatic detection:

Supported Providers

  • 🦙 Ollama - Self-hosted models with extensive model library
  • 🏠 LM Studio - Local GUI-based model management
  • 🔮 More Coming Soon - OpenAI, Anthropic, and others

Provider Commands

/provider          # Check current provider status
/providers         # List all available providers
/switch ollama     # Switch to Ollama
/switch lm_studio  # Switch to LM Studio
/detect            # Auto-detect best provider
/server <url>      # Set custom endpoint
/models            # List and select models

🎯 What Makes XandAI Special

🧠 Smart Command Recognition

XandAI automatically detects whether you're asking an AI question or running a terminal command:

xandai> ls -la                    # Executes terminal command
xandai> git status               # Executes git command  
xandai> How do I use git rebase?  # Asks AI for help
xandai> python app.py            # Runs your Python script

💬 Intelligent Conversations

  • Context-Aware: Remembers your conversation and project context
  • Code Analysis: Understands your codebase and provides relevant suggestions
  • Real-time Help: Get explanations while you work

🛠️ Project Planning

Use /task mode for structured project planning:

xandai> /task create a Flask API with JWT authentication

# XandAI responds with:
# 1. Create project structure
# 2. Set up Flask app with blueprints  
# 3. Implement JWT authentication
# 4. Create user registration/login endpoints
# [Complete implementation details follow]

🎨 Beautiful Interface

  • Syntax Highlighting: Code blocks with proper language detection
  • Smart Autocomplete: Context-aware command and file suggestions
  • Rich Formatting: Clean, readable output with colors and structure
  • Command History: Navigate through previous commands and conversations

🔧 Installation & Setup

# Install from PyPI
pip install xandai-cli

# Make sure Ollama is running (install from https://ollama.ai)
ollama serve

# Start XandAI with custom options
xandai --model llama3.2 --endpoint http://localhost:11434

💡 Real-World Examples

Daily Development Workflow

# Navigate and explore your project
xandai> cd my-project && ls -la
xandai> git status
xandai> cat app.py

# Get AI help while coding
xandai> This Flask route is slow, how can I optimize it?
[AI analyzes your code and suggests specific improvements]

# Continue working with AI suggestions
xandai> git add . && git commit -m "Optimize Flask routes"

Project Planning & Learning

# Plan complex projects
xandai> /task create a microservices architecture with Docker
[Detailed project structure with implementation steps]

# Learn new concepts
xandai> Explain async/await vs Promises in JavaScript with examples
[Comprehensive explanation with code samples]

# Get implementation help
xandai> Show me how to implement JWT authentication in Express.js
[Complete implementation with best practices]

🧠 How XandAI Works

XandAI intelligently combines AI conversation with terminal command execution:

  • Smart Detection: Automatically recognizes if your input is a command or question
  • Context Memory: Remembers your conversation, current directory, and project state
  • Ollama Integration: Uses local Ollama models for privacy and performance
  • Rich Interface: Beautiful terminal UI with syntax highlighting and autocompletion

🔧 Advanced Features

Command Integration

Any terminal command works seamlessly:

xandai> python --version && pip list | grep flask
xandai> find . -name "*.py" | grep -v __pycache__
xandai> docker ps && docker images

Intelligent Autocompletion

XandAI provides smart suggestions based on context:

  • File commands (cat, vim) → Shows only files
  • Directory commands (cd, mkdir) → Shows only directories
  • Mixed commands (ls, cp) → Shows both files and directories
  • Slash commands/task, /help, /clear, /status

Project Awareness

  • Tracks file changes to avoid duplicates
  • Maintains coding patterns and framework conventions
  • Provides context-aware suggestions based on your project type
  • Remembers previous conversations for better assistance

🎨 Task Planning Example

When you use /task mode, XandAI creates detailed project structures:

xandai> /task create a Flask API with JWT authentication

# XandAI responds with complete project structure:
Flask API Project:
├── app.py              # Main Flask application
├── models/user.py      # User model with authentication
├── routes/auth.py      # Login/register endpoints  
├── config.py           # App configuration
└── requirements.txt    # Dependencies

# Plus complete implementation for each file with:
# - All necessary functions and classes
# - Proper error handling  
# - Security best practices
# - Ready-to-run code

🛠️ Available Commands

Slash Commands:

  • /task <description> - Generate structured project plans
  • /help - Show available commands
  • /clear - Clear conversation history
  • /status - Show system status
  • /history - View conversation history

Any Terminal Command:

# Development commands
xandai> python app.py
xandai> npm start  
xandai> docker-compose up

# File operations
xandai> ls -la && cat package.json
xandai> git status && git log --oneline

# System commands  
xandai> ps aux | grep python
xandai> df -h && free -m

🤝 Contributing

We welcome contributions! XandAI is built with Python 3.8+ and uses modern development practices.

# Get started
git clone https://github.com/XandAI-project/Xandai-CLI.git
cd Xandai-CLI
pip install -e .

# Run XandAI locally
xandai

📦 PyPI Package: xandai-cli on PyPI
Found a bug? Create an issue
Have a feature idea? Start a discussion


Made with ❤️ by the XandAI team • Built for developers who love powerful, intelligent tools

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

xandai_cli-2.1.4.tar.gz (226.2 kB view details)

Uploaded Source

Built Distribution

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

xandai_cli-2.1.4-py3-none-any.whl (127.2 kB view details)

Uploaded Python 3

File details

Details for the file xandai_cli-2.1.4.tar.gz.

File metadata

  • Download URL: xandai_cli-2.1.4.tar.gz
  • Upload date:
  • Size: 226.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xandai_cli-2.1.4.tar.gz
Algorithm Hash digest
SHA256 689b85d85a12829f5efe9c281789717174b54f271a5eaf1053b1ce8638814be7
MD5 b9180106117104d65d0e14841a3ea797
BLAKE2b-256 97c65c8f976918ba9c2b631fd57f3a123b004be7331aadceba3dab8218039210

See more details on using hashes here.

Provenance

The following attestation bundles were made for xandai_cli-2.1.4.tar.gz:

Publisher: workflow.yml on XandAI-project/Xandai-CLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xandai_cli-2.1.4-py3-none-any.whl.

File metadata

  • Download URL: xandai_cli-2.1.4-py3-none-any.whl
  • Upload date:
  • Size: 127.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xandai_cli-2.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6804f56b94fc661b58096bb5835e200cccbbfee44bd743105f65e031799733c4
MD5 70a0389f52b100f1a0fd788698b4f59e
BLAKE2b-256 76ef3a4906939a2217ae37c3419214cad3a732f8765a3c52ff43e64d418c82dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for xandai_cli-2.1.4-py3-none-any.whl:

Publisher: workflow.yml on XandAI-project/Xandai-CLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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