CLI Assistant with Ollama Integration and Context-Aware Interactions
Project description
XandAI CLI - Intelligent Terminal Assistant
XandAI CLI is a powerful terminal assistant that seamlessly blends AI conversation with local command execution. Built with Ollama integration, it provides intelligent code assistance, project planning, and command-line automation - all within a beautiful, interactive terminal interface.
📸 See It In Action
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 the CLI
xandai
# That's it! Start chatting or running commands
xandai> python --version
xandai> How do I optimize this Flask route?
xandai> /task create a REST API with authentication
🎯 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
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
Release history Release notifications | RSS feed
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 xandai_cli-2.1.0.tar.gz.
File metadata
- Download URL: xandai_cli-2.1.0.tar.gz
- Upload date:
- Size: 197.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7f12f894d8fd704a36c440c8762896fa1117ccd39843cf5ca75619f8360b2aa
|
|
| MD5 |
47f6d216bf63c78150ce983fd2009b29
|
|
| BLAKE2b-256 |
cf60846bf6c0c94098f7ec2cc0fe0a434b1eb7234ace28c4182321e58a0ddf20
|
Provenance
The following attestation bundles were made for xandai_cli-2.1.0.tar.gz:
Publisher:
workflow.yml on XandAI-project/Xandai-CLI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xandai_cli-2.1.0.tar.gz -
Subject digest:
b7f12f894d8fd704a36c440c8762896fa1117ccd39843cf5ca75619f8360b2aa - Sigstore transparency entry: 474500764
- Sigstore integration time:
-
Permalink:
XandAI-project/Xandai-CLI@4b63f0215b72ba6c2049ddb580d9b7451402c525 -
Branch / Tag:
refs/tags/v2.1.2 - Owner: https://github.com/XandAI-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@4b63f0215b72ba6c2049ddb580d9b7451402c525 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xandai_cli-2.1.0-py3-none-any.whl.
File metadata
- Download URL: xandai_cli-2.1.0-py3-none-any.whl
- Upload date:
- Size: 89.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c10744185db7a4384e42ad96d869fa3db32f97c39e958eba414131174137265
|
|
| MD5 |
f918777d4f35237bac3f32cd03465961
|
|
| BLAKE2b-256 |
65fa9188a4af5fa80c2edfe047b4fd2d419d63455756085b2746c7474988ed9c
|
Provenance
The following attestation bundles were made for xandai_cli-2.1.0-py3-none-any.whl:
Publisher:
workflow.yml on XandAI-project/Xandai-CLI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xandai_cli-2.1.0-py3-none-any.whl -
Subject digest:
3c10744185db7a4384e42ad96d869fa3db32f97c39e958eba414131174137265 - Sigstore transparency entry: 474500769
- Sigstore integration time:
-
Permalink:
XandAI-project/Xandai-CLI@4b63f0215b72ba6c2049ddb580d9b7451402c525 -
Branch / Tag:
refs/tags/v2.1.2 - Owner: https://github.com/XandAI-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@4b63f0215b72ba6c2049ddb580d9b7451402c525 -
Trigger Event:
push
-
Statement type: