Universal AI CLI - One terminal interface for all major AI providers
AI Hub is a powerful command-line interface that provides unified access to multiple AI providers including Grok, Claude, OpenAI, and Gemini. Inspired by Claude Code, it offers a seamless chat experience with intelligent model switching and beautiful terminal UI.
- ๐ค Multi-Provider Support: Grok (XAI), Claude (Anthropic), OpenAI (GPT-4/3.5), Gemini (Google)
- ๐ฌ Interactive Chat Mode: Claude Code-like interface with streaming responses
- ๐ฏ Smart Defaults: Automatic model selection based on your preferences
- โ๏ธ Easy Setup: Guided first-time configuration wizard
- ๐ง Slash Commands: Full set of
/help,/config,/export,/clear, etc. - ๐จ Beautiful UI: Colored output, progress indicators, and clean formatting
- ๐ฑ Cross-Platform: Works on Linux, macOS, and Windows
- ๐ Secure: API keys stored locally in encrypted format
# Clone the repository
git clone https://github.com/yourusername/ai-hub.git
cd ai-hub
# Install dependencies
pip install -r requirements.txt
# Install AI Hub
pip install -e .Simply run hub and follow the guided setup:
hubThis will walk you through:
- ๐ฅ Provider Selection - Choose which AI services to configure
- ๐ API Key Setup - Securely enter your API keys
- ๐ฏ Model Selection - Pick your default AI model
- ๐ Ready to Chat - Start conversing immediately!
hub # Start chat with default model
hub -m claude # Use Claude specifically
hub -m gpt-4 # Use GPT-4
hub -m gemini # Use Geminihub "Explain quantum computing"
hub -m claude "Write a Python function to sort a list"
hub -m gpt-4 "What's the weather like?"hub --setup # Reconfigure settings
hub --help # Show all optionsWhile in chat mode, use these commands:
| Command | Description |
|---|---|
/help |
Show all available commands |
/clear |
Clear conversation history |
/config |
View current configuration |
/setup |
Reconfigure API keys |
/model |
Show current model info |
/export |
Export conversation to file |
/history |
Show conversation history |
/system [prompt] |
Set system prompt |
/compact |
Compress conversation with AI summary |
/cost |
Show session usage stats |
/doctor |
Check AI Hub health |
/exit |
Exit the chat |
AI Hub stores configuration in ~/.ai-hub/config.yaml:
# API Keys
grok_api_key: "your-grok-key"
claude_api_key: "your-claude-key"
openai_api_key: "your-openai-key"
gemini_api_key: "your-gemini-key"
# Settings
default_model: "grok"
max_tokens: 8192
temperature: 0.7
system_prompt: "You are a helpful AI assistant."You can also set API keys via environment variables:
export GROK_API_KEY="your-grok-key"
export ANTHROPIC_API_KEY="your-claude-key"
export OPENAI_API_KEY="your-openai-key"
export GEMINI_API_KEY="your-gemini-key"| Provider | Models | Description |
|---|---|---|
| Grok (XAI) | grok-beta |
Latest and fastest model from X.AI |
| Claude (Anthropic) | claude-3-5-sonnet |
Best for reasoning and analysis |
| OpenAI | gpt-4, gpt-4o, gpt-3.5-turbo |
Most popular and versatile |
| Gemini (Google) | gemini-pro |
Great for multimodal tasks |
- Python 3.8+
- API keys for desired providers:
- Grok (XAI) -
GROK_API_KEY - Claude (Anthropic) -
ANTHROPIC_API_KEY - OpenAI -
OPENAI_API_KEY - Gemini (Google) -
GEMINI_API_KEY
- Grok (XAI) -
ai-hub/
โโโ hub/ # Main package
โ โโโ cli.py # CLI interface and argument parsing
โ โโโ config.py # Configuration management
โ โโโ interactive.py # Interactive chat session
โ โโโ clients/ # AI provider clients
โ โ โโโ base.py # Base client interface
โ โ โโโ grok.py # Grok/XAI client
โ โ โโโ claude.py # Claude/Anthropic client
โ โ โโโ openai_client.py # OpenAI client
โ โ โโโ gemini.py # Gemini/Google client
โ โโโ utils/ # Utilities
โ โโโ formatting.py # Text formatting and colors
โ โโโ terminal.py # Terminal utilities
โโโ setup.py # Package setup
โโโ requirements.txt # Dependencies
โโโ README.md # This file
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Plugin System - Custom AI provider plugins
- Conversation Management - Save/load chat sessions
- Template System - Reusable prompt templates
- Voice Interface - Speech-to-text and text-to-speech
- Multi-Modal Support - Image and file uploads
- Team Features - Shared configurations and sessions
- Web Interface - Optional browser-based UI
- Model Comparison - Side-by-side responses
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Claude Code - Anthropic's excellent CLI interface
- Built with love for the AI community
- Thanks to all AI providers for their amazing APIs
Made with โค๏ธ by the AI Hub Team
โญ Star us on GitHub โข ๐ฆ Follow on Twitter โข ๐ Read the Docs