v0.32.2 CLI AGENT BRIDGE
The Universal
AI Coding Agent
Level 4 Autonomy in your terminal. Multi-provider LLM support, 20+ built-in tools, external CLI agent bridge (Codex, OpenCode, Copilot, Devin), MCP integration, and autonomous RAG โ all in one binary.
Core Capabilities
Production-grade autonomous agent with multi-provider LLM support and extensible tool ecosystem.
๐ Multi-Provider Engine
5 LLM providers via models.dev hub โ Google Gemini, OpenAI, DeepSeek, Anthropic, Groq, Mistral, and 10+ OpenAI-compatible endpoints. Hot-swap with /model.
๐ค CLI Agent Bridge
Delegate tasks to external CLI agents โ Codex, OpenCode, GitHub Copilot, Devin, Pi. The agent bridges history and tools into a text prompt, runs the binary, and parses the output.
๐ง Cognitive Context
Advanced token management with proactive context snapping (compaction), priority-based sliding window, and automatic summarization when approaching limits.
๐ MCP Native
First-class Model Context Protocol support. Connect to community servers, databases, and external APIs with zero-config tool discovery via stdio transport.
๐ก๏ธ Trust Architecture
Hierarchical security with directory trust levels, OS keyring encryption, command sanitization, and path traversal guards. Manual mode for full control.
๐ฆ RAG & Memory
SQLite-backed persistent RAG with automatic workspace indexing, cosine similarity search, and long-term memory manager for cross-session knowledge.
Installation
Python 3.10+ required. Install the latest stable build from PyPI:
# Using pip
$ pip install mentask
# Or from source
$ git clone https://github.com/pitahayaDevSoft/mentask.py
$ cd mentask.py && pip install -e .
# Run directly with a provider
$ mentask --provider gemini
$ mentask --provider openai --model gpt-4o
$ mentask --local # Ollama
$ mentask --cli codex # CLI Agent Bridge
CLI Agent Bridge: Use agent:codex, agent:opencode, agent:copilot, agent:devin, or agent:pi to delegate tasks to external CLI agents.
Interface & Workflow
Designed for the terminal. mentask provides a high-performance, color-coded TUI with real-time streaming.
โจ Thinking Process
Subtle vertical lines indicate the agent's internal reasoning loop before any tool execution occurs.
โจ @mentask โ I will check pyproject.toml... โ EXECUTING: read_file(...)
๐ก๏ธ Security Confirmation
In manual mode, all mutations require explicit permission with a detailed diff preview.
๐ก SECURITY CHECK mentask wants to edit_file... Allow execution? (y/n):
Command Reference
| Command | Description | Status |
|---|---|---|
/help | List all available commands and their descriptions. | Stable |
/model <id> | Hot-swap LLM provider. Use agent:codex for CLI agents. | v0.32.0 |
/model configure | Health check all available models and verify reachability. | v0.32.0 |
/mode [auto|manual] | Toggle automatic or manual tool execution confirmation. | Stable |
/trust <path> | Authorize a directory for recursive file operations. | Stable |
/auth <key> | Set API key for a provider (stored in system keyring). | Stable |
/context | Adjust workspace context focus and token limits. | v0.32.0 |
/theme | Switch between 10 built-in color schemes. | v0.32.0 |
/colorscheme | Preview and select color schemes. | v0.32.0 |
/export | Export current session to file. | v0.32.0 |
/git | Git operations โ commit, diff, status. | v0.32.0 |
/diff | Show file changes and diffs. | v0.32.0 |
/retry | Retry the last failed request. | v0.32.0 |
/config | View and edit configuration settings. | v0.32.0 |
/history | List or export session history files. | Stable |
/stats | Session summary โ messages, tools, files edited. | Stable |
/usage | Real-time token consumption and USD cost. | Stable |
/undo | Rollback the last file mutation. | Stable |
Technical Architecture
Modular architecture across four decoupled layers with strong provider abstraction.
โโ COGNITIVE LAYER โ โโ AgentOrchestrator โ โโ SessionManager (persistent memory, rollback) โ โโ ContextCompressor (proactive compaction) โ โโ TaskClassifier (heuristic routing) โ โโ PROVIDER LAYER (5 Engines) โ โโ GeminiProvider (Google GenAI SDK) โ โโ OpenAIProvider (OpenAI API) โ โโ OllamaProvider (local inference) โ โโ GemmaProvider (Gemma formatting) โ โโ CLIProvider (agent bridge) โ โโ TOOL ECOSYSTEM (20+ Tools) โ โโ Core: read_file, edit_file, execute_bash, grep_search โ โโ Web: web_search, web_fetch โ โโ Memory: working_memory, memory, rag_query โ โโ MCP: community servers via stdio โ โโ SECURITY LAYER โ โโ TrustManager (directory whitelist) โ โโ SecurityAnalyzer (command sanitization) โ โโ SubprocessSafety (whitelisted commands) โ โโ INFRASTRUCTURE โโ RAG Manager (SQLite + TF-IDF) โโ History Manager (JSON session files) โโ Config Manager (keyring + settings.json)
Provider Abstraction
BaseProvider โ concrete implementations. Factory auto-detects from model ID, prefix, or installed CLI binary. Hot-swappable at runtime.
CLI Agent Bridge
CLIProvider translates history to text prompts, runs external binaries, and parses JSONL output. Supports Codex, OpenCode, Copilot, Devin, Pi.
Security Layer
Three-tier trust: untrusted โ session โ permanent. Command sanitization blocks shell injection, path traversal, and dangerous patterns.
Roadmap
| Version | Milestone | Key Changes |
|---|---|---|
v0.29.0 | Multi-Agent CLI Bridge | External CLI integration (codex, opencode), dynamic model discovery, git commit tool. |
v0.30.0 | RAG & Developer Docs | SQLite-backed RAG, CONTRIBUTING.md, git-cliff changelog generation. |
v0.31.0 | Provider Refactor | ChatAgent decomposition, command registry, retry strategy, i18n auto-detection. |
v0.32.0 | Security Hardening | Sandbox validation, subprocess safety, dead code removal, 6 new dev commands. |
v0.32.1 | Thinking Model Fix | Empty response handling for thinking models (gemma4), error event handling. |
v0.32.2 | CLI Agent Bridge | agent: prefix, 5 CLI agents (codex/opencode/copilot/devin/pi), status bar model display. |
Changelog
v0.32.2 โ CLI Agent Bridge
2026-07-12
- Changed: CLI prefix renamed from
cli:toagent:across all modules. - Changed: Removed gemini-cli, claude, aider from supported CLI agents. Added pi, copilot (GitHub Copilot CLI), and devin.
- Changed: Status bar now shows the underlying CLI agent model (e.g.,
opencode / o3-pro). - Fixed: CLI argument order โ subcommand now correctly precedes
--modelflag. - Fixed: Prompt header now includes ENGINE and MODEL lines so external agents know their identity.
v0.32.1 โ Thinking Model Fix
2026-07-12
- Fixed: Empty response handling for thinking-only models (e.g., gemma4) โ thinking content now emitted as text.
- Fixed: Guarded
chunk["choices"][0]access to prevent IndexError on empty chunks. - Fixed: Orchestrator error events now handled gracefully in
stream_response().
v0.32.0 โ Security Hardening
2026-07-12
- Added: Sandbox command validation against dangerous shell patterns (command substitution, /etc redirects, mkfs, dd).
- Added: 6 new dev commands โ
/export,/git,/diff,/context,/retry,/config. - Added: Truncation detection for
finish_reason: "length"with visual warning. - Changed: Routed 12+ direct subprocess calls through
subprocess_safety.py. - Changed: Provider prompt panel now wraps text in selectable Panel for better UX.