Skip to content

Scutoidzz/iBox

Repository files navigation

iBox - Agentic AI Terminal UI

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.

Features

  • 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

How to start

Prerequisites

  • Python 3.8 or higher
  • Mistral AI API key (get one here) Or there is a hard-coded one

Installation

  1. Clone the repository:
git clone https://github.com/Scutoidzz/iBox
cd iBox
  1. Install dependencies:
pip install -r requirements.txt
  1. 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

  1. Run the application:
python ibox.py

Usage

Keyboard Shortcuts

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

Commands

  • /deep <prompt> - Uses Deep Think mode, which:
    1. Consults 5 different Mistral models in parallel
    2. Returns responses from each model
    3. Synthesizes them into a unified answer using the largest model

Available Tools

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

Project Structure

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

Architecture

Core Components

  1. ibox.py - The main application using Textual framework

    • ChatMessage - Widget for displaying chat messages
    • SendingBar - Visual indicator for processing
    • TUIApp - Main application class handling chat logic
  2. tool_handler.py - Tool execution system

    • Loads tools from tools.json
    • Executes tools synchronously
    • Handles tool result formatting
  3. tools.json - Tool schema definitions

    • OpenAI function calling format compatible
    • Describes each tool's parameters and requirements

Configuration

Changing Models

The application supports multiple Mistral models:

  • mistral-small-latest - Faster, suitable for simple tasks
  • mistral-large-latest - More capable, better reasoning
  • codestral-latest - Specialized for code generation
  • pixtral-large - Vision model for image analysis

Switch models in-app with ctrl+m and ctrl+n, or modify the MODEL variable in code.

Dependencies

  • mistralai - Mistral AI Python SDK
  • textual - Python TUI framework
  • rich - Rich terminal formatting and markdown support

Contributing

Contributions are welcome! Areas for improvement:

  • Additional tool implementations
  • UI/UX enhancements
  • Performance optimizations
  • Test coverage

License

MIT License - See LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published