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.

5 Providers CLI Agent Bridge 20+ Tools Zero-Trust
jules_dev@ESTUDIO: ~/mentask.py

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.

Gemini SDKOpenAI APIOllama Local

๐Ÿค– 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.

agent: prefixModel DiscoveryJSONL Parsing

๐Ÿง  Cognitive Context

Advanced token management with proactive context snapping (compaction), priority-based sliding window, and automatic summarization when approaching limits.

Context SnapSliding WindowToken Opt

๐Ÿ”Œ MCP Native

First-class Model Context Protocol support. Connect to community servers, databases, and external APIs with zero-config tool discovery via stdio transport.

JSON-RPC 2.0Stdio TransportAsyncExitStack

๐Ÿ›ก๏ธ Trust Architecture

Hierarchical security with directory trust levels, OS keyring encryption, command sanitization, and path traversal guards. Manual mode for full control.

Keyring EncWhitelistSandbox

๐Ÿ“ฆ RAG & Memory

SQLite-backed persistent RAG with automatic workspace indexing, cosine similarity search, and long-term memory manager for cross-session knowledge.

SQLite CacheTF-IDFPersistent

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
/helpList all available commands and their descriptions.Stable
/model <id>Hot-swap LLM provider. Use agent:codex for CLI agents.v0.32.0
/model configureHealth 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
/contextAdjust workspace context focus and token limits.v0.32.0
/themeSwitch between 10 built-in color schemes.v0.32.0
/colorschemePreview and select color schemes.v0.32.0
/exportExport current session to file.v0.32.0
/gitGit operations โ€” commit, diff, status.v0.32.0
/diffShow file changes and diffs.v0.32.0
/retryRetry the last failed request.v0.32.0
/configView and edit configuration settings.v0.32.0
/historyList or export session history files.Stable
/statsSession summary โ€” messages, tools, files edited.Stable
/usageReal-time token consumption and USD cost.Stable
/undoRollback 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.

Factory PatternAsync StreamingHot-Swap

CLI Agent Bridge

CLIProvider translates history to text prompts, runs external binaries, and parses JSONL output. Supports Codex, OpenCode, Copilot, Devin, Pi.

JSONL ParsingModel DiscoveryNon-Interactive

Security Layer

Three-tier trust: untrusted โ†’ session โ†’ permanent. Command sanitization blocks shell injection, path traversal, and dangerous patterns.

Keyring EncRegex GuardOS Sandbox

Roadmap

Version Milestone Key Changes
v0.29.0Multi-Agent CLI BridgeExternal CLI integration (codex, opencode), dynamic model discovery, git commit tool.
v0.30.0RAG & Developer DocsSQLite-backed RAG, CONTRIBUTING.md, git-cliff changelog generation.
v0.31.0Provider RefactorChatAgent decomposition, command registry, retry strategy, i18n auto-detection.
v0.32.0Security HardeningSandbox validation, subprocess safety, dead code removal, 6 new dev commands.
v0.32.1Thinking Model FixEmpty response handling for thinking models (gemma4), error event handling.
v0.32.2CLI Agent Bridgeagent: 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: to agent: 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 --model flag.
  • 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.

Full Changelog on GitHub โ†’