Skip to main content

muonroi-cli Overview

muonroi-cli is a TypeScript/Bun CLI that replaces single-model AI assistants with a multi-provider orchestration layer. It routes each prompt through a six-stage intelligence pipeline, runs adversarial multi-model debates for high-stakes decisions, and persists behavioral memory across sessions.

Prerequisites

Installation

bun add -g muonroi-cli

Via curl

curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/main/install.sh | bash

Quick Start

muonroi-cli                                      # interactive TUI
muonroi-cli "fix the flaky test in auth.test.ts" # with starting prompt
muonroi-cli --prompt "run tests" --format json # headless / CI mode
muonroi-cli models # list models with pricing
muonroi-cli doctor # health check

First Run

On first launch, muonroi-cli checks for ~/.muonroi-cli/user-settings.json. If the file is missing or no API key is configured, the CLI prompts for a key and writes the config. Once credentials are set, the interactive TUI starts automatically.

Run muonroi-cli doctor at any time to verify provider connectivity and configuration.

Supported Providers

ProviderModelsKey
AnthropicClaude Opus 4.7 / Sonnet 4.6 / Haiku 4.5MUONROI_API_KEY
OpenAIGPT-4o, GPT-4o-mini, o3, o4-miniOPENAI_API_KEY
GoogleGemini 2.5 Pro / FlashGOOGLE_API_KEY
DeepSeekDeepSeek V4 Flash / ProDEEPSEEK_API_KEY
xAIGrok 3, Grok 3 MiniXAI_API_KEY
SiliconFlowQwen, GLM, InternLMSILICONFLOW_API_KEY
OllamaAny local modelKeyless — http://localhost:11434

Multi-Provider Setup

Role-based routing and council debates require at least two providers. Place the following in ~/.muonroi-cli/user-settings.json:

{
"apiKey": "sk-ant-your-key",
"providers": {
"anthropic": { "apiKey": "sk-ant-..." },
"deepseek": { "apiKey": "sk-..." }
},
"roleModels": {
"leader": "claude-sonnet-4-6",
"implement": "deepseek-v4-flash",
"verify": "claude-sonnet-4-6",
"research": "deepseek-v4-flash"
}
}

roleModels maps each agent role to a specific model. The router uses these assignments when running the Prompt Intelligence Layer pipeline. See CLI Settings Reference for the full schema.

Architecture

Request Pipeline

Every prompt passes through the following stages:

User prompt
→ Redactor
→ PIL (Prompt Intelligence Layer)
→ Router
→ Provider
→ Vision Proxy
→ Tool Loop
→ Sub-agent cap
→ Vision Bridge
→ Output guardrails
→ Auto-compact
→ Session storage

Core Subsystems

SubsystemDescription
Multi-Model CouncilAdversarial multi-model debate for high-stakes decisions
Prompt Intelligence Layer (PIL)Six-layer pipeline routing each prompt to the optimal model
Experience Engine (EE)Persistent behavioral memory across sessions

Source Layout

PathPurpose
src/orchestrator/Agent loop, auto-compact, council runner
src/council/Multi-model debate engine
src/pil/Prompt Intelligence Layer
src/router/Role-based and tier-based routing
src/providers/Multi-provider factory
src/ee/Experience Engine client and hooks
src/tools/Built-in tools (bash, file, grep, LSP, schedule)

Development

git clone https://github.com/muonroi/muonroi-cli.git
cd muonroi-cli && bun install

bun run dev # run from source
bun run typecheck # type check
bun run test # vitest
bun run lint # biome check
bun run build:binary # standalone binary

Generate the demo GIF (requires vhs):

vhs docs/demo.tape