Version: 0.1.0 | Python: 3.14+ | License: MIT
A cutting-edge terminal-based AI assistant powered by the OpenAI Agents SDK, featuring a cyberpunk neon boot sequence, a rich Textual TUI, and an AI agent routed through OpenRouter for free-tier LLM access. Designed as an MCP (Model Context Protocol) compute node to handle up to 50% of server-side AI inference.
- OpenRouter Integration โ Routes requests through OpenRouter for multi-model flexibility
- Free-Tier Model โ Uses
arcee-ai/trinity-large-thinking:freefor cost-free experimentation - Conversation Memory โ Maintains a history of all exchanges with the AI
- History Tutor Persona โ Pre-configured agent optimized for concise, clear historical answers
- Async Architecture โ Non-blocking AI calls keep the UI responsive
- Rich TUI Chat Interface โ Full-featured terminal app with scrollable chat log
- Real-Time Clock Header โ Live clock display in the top bar
- Stylized Borders โ Cyan-bordered chat panel, green-bordered input field
- Keyboard-Friendly โ Footer with keybindings, rapid input submission
- Loading States โ Visual feedback while the AI processes responses
- Error Handling โ Graceful error messages displayed inline
- ASCII Logo โ Custom "ANAS CLI Dev" ASCII art with large-format rendering
- Typewriter Text Effect โ Animated title typing itself character by character
- Neon Color Cycling โ Multi-color cycling animation (cyan โ blue โ magenta)
- Visual Boot Sound โ Simulated audio-visual boot sequence
- Loading Progress โ 4-stage animated progress bar:
- โก Powering AI Core
- ๐ง Syncing Neural Network
- ๐ฆ Loading Modules
- ๐ฅ๏ธ Starting Interface
- SYSTEM READY Screen โ Confirmation panel before entering the chat
- Bleeding-Edge Stack โ Python 3.14 + openai-agents v0.0.7 + Textual v8.2.6
uv-Powered โ Blazing-fast Rust-based package management- Clean Separation of Concerns โ Modular architecture with distinct layers (launcher, UI, AI logic, animation)
- Cross-Platform โ Windows and Unix support with automatic terminal detection
.envConfiguration โ Secure API key management via environment variables- Conversation REPL Mode โ Standalone CLI loop for debugging and testing
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ run.py โ
โ (Entry Point) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ final_animation.py โ โโโ Neon splash screen โ
โ โ (Presentation) โ (rich/Panel animations) โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโผโโโโโโโโโโโโ โ
โ โ cli.py โ โโโ Textual TUI โ
โ โ (UI / Interaction) โ (Header, Input, RichLog) โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โ โ async calls โ
โ โโโโโโโโโโโโผโโโโโโโโโโโโ โ
โ โ chatbot.py โ โโโ OpenAI Agents SDK โ
โ โ (AI / Business Logic)โ (Agent, Runner, OpenRouter) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ main.py โ โโโ Scratchpad / test file โ
โ โ (Development) โ (gitignored) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Data Flow: User Input โ TUI โ AI Agent โ OpenRouter API โ
โ โ Response โ TUI Display โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Module | Role | Key Technologies |
|---|---|---|
run.py |
Application launcher & orchestrator | os.system |
final_animation.py |
Boot sequence & visual effects | rich (Panel, Progress, Live) |
cli.py |
Terminal UI & user interaction | textual (App, Header, Input, RichLog) |
chatbot.py |
AI agent logic & API integration | agents (Agent, Runner, OpenAIChatCompletionsModel) |
main.py |
Development scratchpad (gitignored) | agents, asyncio |
| Category | Technology | Version |
|---|---|---|
| Language | Python | >=3.14 |
| AI Framework | OpenAI Agents SDK | 0.0.7 |
| OpenAI Client | openai | 2.37.0 |
| Terminal UI | Textual | 8.2.6 |
| Terminal Formatting | Rich | 15.0.0 |
| ASCII Banners | pyfiglet | 1.0.4 |
| Env Management | python-dotenv | 1.2.2 |
| Cross-platform Colors | colorama | 0.4.6 |
| Data Validation | pydantic | 2.13.4 |
| Async HTTP | httpx | 0.28.1 |
| Package Manager | uv | 0.11.7 |
| MCP SDK | mcp | 1.27.0 |
| HTTP Client | requests | 2.34.2 |
- Python 3.14+ (CPython)
uvpackage manager (install guide)- An OpenRouter API key (get one free)
# 1. Clone the repository
git clone https://github.com/yourusername/mcp.git
cd mcp
# 2. Create virtual environment & install dependencies
uv venv
uv sync
# 3. Configure your API keys
echo "OPENROUTER_API_KEY=sk-or-v1-your-key-here" > .envNote: The
.envfile is automatically excluded from version control via.gitignore.
The application supports two methods of API key management:
- Environment variable (recommended): Set
OPENAI_API_KEYin your.envfile - Direct assignment: The chatbot module has a placeholder that can be replaced with your key
Keys are loaded via python-dotenv and passed to the OpenRouter client for routing to the free-tier model.
uv run python run.pyThis will:
- Clear the terminal screen
- Play the neon boot animation sequence
- Launch the Textual TUI chat interface
# Edit chatbot.py to uncomment the bottom line:
# import asyncio
# asyncio.run(main())
uv run python chatbot.pyuv run python main.pyWhen you run python run.py, the application enters a carefully orchestrated startup sequence:
- Screen Initialization โ Terminal clears automatically (supports both Windows
clsand Unixclear) - Boot Sequence โ The neon animation plays:
- ASCII logo renders in bright cyan
- Visual "boot sound" pulses 5 times
- Title cycles through neon colors (6 cycles)
- Typewriter effect types the title
- System Loading โ 4-stage progress bar simulates module initialization
- Chat Interface โ Textual TUI appears, ready for input
- Type your message in the input field (green border)
- Press Enter to send
- Your message appears in the chat panel (cyan border)
- The AI responds with a concise history-focused answer
- Error messages are displayed inline if the API call fails
The "History Tutor" agent in chatbot.py is configured with:
- Model:
arcee-ai/trinity-large-thinking:free(OpenRouter free tier) - Instructions: Clear, concise historical answers
- Conversation Context: Full history stored and available for context
- Async Runner: Non-blocking execution via
Runner.run()
MCP/
โโโ run.py # Application entry point
โโโ chatbot.py # AI agent logic (OpenAI Agents SDK)
โโโ cli.py # Textual TUI chat interface
โโโ final_animation.py # Neon boot animation sequence
โโโ main.py # Development scratchpad (gitignored)
โโโ pyproject.toml # Project definition & dependencies
โโโ uv.lock # Lock file for reproducible builds
โโโ .env # API keys (gitignored)
โโโ .gitignore # Git exclusion rules
โโโ .python-version # Python version: 3.14
โโโ README.md # This file
โโโ .venv/ # Virtual environment (gitignored)
โโโ __pycache__/ # Python bytecode cache (gitignored)
โโโ .git/ # Git repository
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
Yes | API key for OpenAI/OpenRouter |
OPENROUTER_API_KEY |
Yes | OpenRouter-specific API key |
| Setting | Current Value | Description |
|---|---|---|
| Model | arcee-ai/trinity-large-thinking:free |
OpenRouter model ID |
| Base URL | https://openrouter.ai/api/v1 |
OpenRouter API endpoint |
| Agent Name | "History Tutor" | Agent identity |
| Instructions | Short history answers | System prompt |
| Tracing | Disabled | Telemetry setting |
| Setting | Current Value | Description |
|---|---|---|
| Screen Background | Black | Terminal background color |
| Chat Border | Cyan (round) |
Chat panel border style |
| Input Border | Green (round) |
Input field border style |
| Header Clock | Enabled | Live clock display |
- Async-first: All I/O operations use
asyncio/await - Minimal dependencies: Only 6 core runtime deps in
pyproject.toml - Clean separation: UI logic never mixes with AI/business logic
- Error resilience: Try/except guards around all external calls
Tests are not yet implemented. The main.py file serves as a manual test harness for agent calls. Future test coverage will use pytest with asyncio support.
# Install in development mode
uv pip install -e .# Run the application
uv run python run.py
# Update dependencies
uv sync
# Add a new dependency
uv add package-name- Conversation Context Passing โ Feed full history into agent calls for true memory
- MCP Server Integration โ Implement MCP server for distributed compute (50% offload)
- Multiple AI Personas โ Switchable agent configurations (coding, science, general)
- Session Persistence โ Save and load conversation history
- Markdown Rendering โ Rich formatting of AI responses in the TUI
- Command Palette โ Slash commands for extended functionality
- Streaming Responses โ Real-time token-by-token AI output
- Test Suite โ Unit tests for chatbot logic, integration tests for TUI
- Docker Support โ Containerized deployment
- Configurable Models โ Runtime model switching via UI
-
[project.scripts]entry point inpyproject.toml
-
Bleeding-Edge Technology โ Built on Python 3.14 (the latest CPython release) and the brand-new
openai-agentsSDK v0.0.7, placing it at the forefront of Python AI development. -
MCP-Ready Architecture โ Named and designed around the Model Context Protocol, with the
mcpPython SDK already installed and a clear vision for distributed AI compute. -
Cost-Free AI โ Leverages OpenRouter's free-tier models for zero-cost experimentation, making AI accessible without a paid subscription.
-
Terminal-Native Experience โ Chooses a rich TUI over a web interface, demonstrating that terminal applications can deliver modern, visually appealing experiences.
-
Cyberpunk Aesthetic โ The neon boot animation, color-cycling logos, and ASCII art create a distinctive, memorable brand identity.
-
Clean Modular Design โ Four focused modules with clear responsibilities make the codebase approachable and easy to extend.
-
Async Excellence โ Non-blocking architecture ensures the UI never freezes during API calls โ a common pain point in terminal applications.
-
Developer-Friendly โ Minimal dependencies,
uvfor lightning-fast package management, and a straightforward setup process.
Contributions are welcome! This is an early-stage project with lots of room for growth. Feel free to:
- Open issues for bugs or feature suggestions
- Submit PRs for improvements
- Experiment with different AI models and configurations
This project is open source. See the LICENSE file for details.
Built with โค๏ธ using Python 3.14 ยท OpenAI Agents SDK ยท Textual ยท Rich
ANAS CLI Dev โ MCP AI Terminal