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