A Terminal User Interface (TUI) AI Assistant that provides intelligent responses and code execution capabilities.
src/
├── __init__.py
├── agent.py # Main agent controller
├── code_executor.py # Python code execution handling
├── services/
│ └── llm_service.py # LLM service integration
├── ui/
│ └── layout_manager.py # TUI layout management
└── prompts/
└── system.prompt # System prompts for AI behavior
- 🎨 Rich TUI interface powered by the Rich library
- 💬 AI-powered responses with streaming capability
- 🚀 Secure Python code execution
- 📝 Markdown rendering support
- ⚡ Real-time status updates
- 🛡️ Resource-managed execution environment
- Clone the repository:
git clone https://github.com/josebenitezg/agentui.git
cd tui-ai-agent
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install required dependencies:
pip install -r requirements.txt
- Create a
.env
file with your configuration:
ANTHROPIC_API_KEY=your_api_key_here
To start the TUI AI Agent:
python -m src.agent
The UI component uses Rich library for:
- Console output formatting
- Dynamic layout management
- Panel rendering
- Markdown and syntax highlighting
Core controller that manages:
- User interactions
- AI response processing
- Code execution coordination
- Layout updates
Handles Python code execution with:
- Memory usage limits
- Timeout protection
- Input/Output capture
- Error handling
Manages AI communication with:
- Message streaming
- Tool integration
- System prompt handling
- Response formatting
- Python 3.8+
- Virtual environment
- Anthropic API key
The project emphasizes:
- Code validation
- Input/output testing
- Edge case handling
- Performance optimization
- Proactive bug detection
- Fork the repository
- Create your 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
[Add your license information here]