An interactive terminal user interface (TUI) for interaction with Mistral AI models, featuring autonomous tool execution, real-time streaming responses, and multi-model consultation capabilities.
- Interactive Chat Interface - Modern terminal UI built with Textual framework
- Agentic Tool Execution - AI autonomously executes tools to accomplish tasks:
- File creation and editing
- Command execution
- Directory management
- Web searching
- Code generation (via Codestral)
- Image analysis (via Pixtral)
- Real-time Streaming - Watch AI responses appear in real-time as they're generated
- Deep Think Mode - Consult multiple models simultaneously and synthesize responses
- Model Switching - Easily switch between Mistral Small and Large models
- Keyboard Shortcuts - Efficient keyboard-driven workflow
- Tool Extensibility - Easy to add new tools via JSON configuration
- Python 3.8 or higher
- Mistral AI API key (get one here) Or there is a hard-coded one
- Clone the repository:
git clone https://github.com/Scutoidzz/iBox
cd iBox- Install dependencies:
pip install -r requirements.txt- Set your API key:
# Windows PowerShell
$env:MISTRAL_API_KEY="your-api-key-here"
# macOS/Linux
export MISTRAL_API_KEY="your-api-key-here"or use the hard-coded default
- Run the application:
python ibox.py| Shortcut | Action |
|---|---|
q |
Quit the application |
d |
Toggle dark mode |
ctrl+l |
Clear chat history |
ctrl+m |
Switch to Mistral Small model |
ctrl+n |
Switch to Mistral Large model |
ctrl+j |
Select a working directory |
/deep <prompt>- Uses Deep Think mode, which:- Consults 5 different Mistral models in parallel
- Returns responses from each model
- Synthesizes them into a unified answer using the largest model
The AI can use the following tools to accomplish tasks:
| Tool | Description |
|---|---|
create_file |
Create new files with content |
read_file |
Read and display file contents |
edit_file |
Modify existing file contents |
delete_file |
Remove files |
run_command |
Execute shell/terminal commands |
create_directory |
Create new directories |
delete_directory |
Remove directories |
list_files |
List directory contents |
list_directories |
List subdirectories |
download_file |
Download files from URLs |
analyze_image |
Analyze images using vision model |
code |
Generate code using Codestral |
web_search |
Search the web for information |
read_github_repo |
Fetch content from GitHub repositories |
iBox/
├── ibox.py # Main TUI application
├── tool_handler.py # Tool execution engine
├── tools.json # Tool definitions and schemas
├── code.py # Code generation module
├── image_analyze.py # Image analysis module
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
├── README.md # This file
└── tests/
└── test_tool_handler.py # Tool handler tests
-
ibox.py - The main application using Textual framework
ChatMessage- Widget for displaying chat messagesSendingBar- Visual indicator for processingTUIApp- Main application class handling chat logic
-
tool_handler.py - Tool execution system
- Loads tools from
tools.json - Executes tools synchronously
- Handles tool result formatting
- Loads tools from
-
tools.json - Tool schema definitions
- OpenAI function calling format compatible
- Describes each tool's parameters and requirements
The application supports multiple Mistral models:
mistral-small-latest- Faster, suitable for simple tasksmistral-large-latest- More capable, better reasoningcodestral-latest- Specialized for code generationpixtral-large- Vision model for image analysis
Switch models in-app with ctrl+m and ctrl+n, or modify the MODEL variable in code.
- mistralai - Mistral AI Python SDK
- textual - Python TUI framework
- rich - Rich terminal formatting and markdown support
Contributions are welcome! Areas for improvement:
- Additional tool implementations
- UI/UX enhancements
- Performance optimizations
- Test coverage
MIT License - See LICENSE file for details