7.7.1 plugin ecosystem · gateway · multi-model · chat history →

A terminal AI agent
with plugins.

Terminal-first. Multi-model. Approvals-first.
MahanAI gives you a chat interface, agentic tool use, a local gateway server, and a plugin ecosystem—with custom themes, conversation branching, and searchable chat history.

$ pip install mahanai
$ mahanai
60+
Slash commands
7+
Provider backends
∞
Plugins & themes
0
Unapproved tool calls
~/code/mahanai — mahanai
zsh
================================================================
================================================================
Max 2.0  |  Claude Haiku 4.5  |  /api-key to save key (persists)
Replies stream live (MAHANAI_STREAM=0 to wait for full text)
/help /exit /quit
================================================================
You: run npm install react
Shell Command
npm install react
A Allow W Always Allow (npm) D Deny
→ npm install react
added 4 packages in 2.1s
MahanAI: done. exit 0.
MahanAI: anything else?
§ 01 · features

Built for people
who live in the terminal.

Every surface is shaped by the shell: monospace rhythm, bracketed keys, ASCII rules, and a gradient banner that tweens while you wait.

Chat loop, streaming, tool-runtime — all in your shell.

mahanai launches a full-width chat loop with a gradient ASCII banner, a status line with your model / effort / plan / theme, and an approval-first tool runtime that refuses to touch your machine without a key press.

Claude Claude Haiku 4.5 · Default claude-haiku-4-5
Claude Claude Sonnet 4.6, Opus /mode claude
Codex GPT-5 · OpenAI Codex /codex-login
NVIDIA NIM Llama 3.3 70B /api-key-nvidia
Ollama Any local model /add-ollama
Custom OpenAI-compatible API /custom <url>

Plugin store.

Install community .mmd plugins with /store install, publish your own with /store upload. GitHub-backed.

Conversation branching.

/branch save snapshots state, /branch load restores. Explore multiple paths without losing work.

Searchable chat history.

Find saved sessions by keyword with /history search <query>. Pull up old chats fast instead of scrolling forever.

Interact mode.

/interact lets MahanAI control your computer with screenshots, mouse, and keyboard. Remove anytime with /interact remove.

Desktop notifications.

Get pinged when a long generation finishes. Focus elsewhere, stay in the loop.

Shell history awareness.

/shell-history inject adds recent bash/zsh history to context. Code suggestions know your workflow.

Cost tracking.

/cost shows session token usage and estimated spend across all backends.

Keys stay local.

Keys save to ~/.config/mahanai/config.json (or %APPDATA%\MahanAI\ on Windows). Env-var overrides via MAHANAI_API_KEY. Nothing leaves your box unless you told it to.

Streaming, end-to-end.

SSE preserved across the gateway in every direction — OpenAI→Anthropic, Anthropic→OpenAI, or transparent proxy. Set MAHANAI_STREAM=0 to wait for the full response.

§ 02b · plugins & themes

Extend & customize
without limits.

Write your own .mmd plugins to add slash commands, delegate to Claude Code or the shell, and publish to the store. Custom .mai themes with gradients, color aliases, and display overrides.

Plugin store

/store browse to find plugins. /store install author/namespace.plugin to add one. /store upload path/to/plugin.mmd publishes yours publicly.

Custom themes

Write a .mai file with gradients, color aliases, and display name overrides. /theme-load mytheme.mai to apply. Includes four built-in themes.

Project config

Place a .mahanairc in your project root to auto-load context files, plugins, and enable dev kit extras scoped to that workspace.

Conversation branching

/branch save milestone snapshots state. /branch load to restore. Explore multiple refactor paths or reasoning chains without losing work.

§ 03 · gateway

One endpoint.
Every provider.

mahanai --server --port 8080 --type openai — a local HTTP gateway that routes every request to the right backend based on the model field. Format conversion happens transparently.

Clients

Cursor
Continue.dev
Claude Code
LM Studio
curl / raw HTTP
MahanAI Gateway

localhost · routes by model

POST/v1/chat/completions
POST/v1/messages
GET/v1/models

Backends

Anthropic · claude-*
NVIDIA NIM · llama-3.3
OpenAI · gpt-5.*
Ollama · any local model
Custom · any /v1
§ 04 · approvals

It asks before
it acts.

MahanAI's tool runtime stops at every shell, git, gh, and file op. You press one key. Always-Allow saves a rule; destructive commands can't be saved at all.

Shell Command
rm -rf ./dist  [DESTRUCTIVE]
[A] Allow [W] Always Allow disabled [D] Deny
>
Write / Create File
~/project/src/main.py
[A] Allow [W] Always Allow (Write / Create File) [D] Deny
>
Git Command
git push origin main
[A] Allow [W] n/a for git [D] Deny
>
GitHub Command
gh pr create --title "..."
[A] Allow [W] n/a for gh [D] Deny
>
§ 05 · reference

Every command
is a slash away.

Slash-prefixed, lowercase, kebab-case when multi-word. POSIX flags for launch options. No menus, no mice.

/models Interactive model selector. ↑↓ to navigate, Enter to confirm, Esc to cancel.
/mode <name> Quick-switch to a model. /mode claude or /mode default.
/effort <level> Set reasoning effort: low, medium, high, or very-high.
/plan on · /plan off Toggle plan mode. Outlines approach before every response.
/auto on · /auto off Toggle autonomous mode (skip approval prompts).
/branch save <name> Snapshot conversation state for later restore.
/branch load <name> Restore a saved conversation branch.
/history search <query> Search saved chat sessions by keyword.
/store browse Browse the GitHub-backed plugin store.
/store install <name> Install a plugin. Format: author/namespace.plugin.name.
/plugin-load <path> Load a local .mmd plugin file.
/themes <name> Switch theme: midnight, light, midnight-cb, light-cb.
/theme-load <path> Load a custom .mai theme file.
/cost Show session token usage and estimated spend.
/memory add <text> Save a persistent memory note.
/shell-history inject Add recent bash/zsh history to context.
/interact · /interact remove Enable or disable computer control with screenshots, mouse, and keyboard.
/approvals · /approvals clear List or wipe all Always Allow rules.
/codex-login · /codex-logout Sign in to OpenAI via browser OAuth (PKCE). Tokens refresh silently.
/api-key [key] Save server API key. Omit to enter via hidden prompt. /api-key clear removes it.
/api-key-nvidia <key> Save NVIDIA NIM API key specifically.
/add-ollama <name> <host> <port> Add an Ollama instance. Default: localhost 11434.
/custom <url> [model] [key] Point at any OpenAI-compatible server — Ollama, LM Studio, vLLM, OpenRouter.
/cmd Fuzzy-search all 60+ commands.
/init Generate a MAHANAI.md workspace context file.
/help · /exit · /quit The usual.
§ 06 · install

Two lines. That's it.

MahanAI ships on PyPI. An onboarding wizard runs on first launch to help you pick a model and set up API keys.

$ pip install mahanai
$ mahanai

Guided bootstrap

Run ./scripts/get-started.sh (Linux/macOS) or .\scripts\get-started.ps1 (Windows) to auto-install Python via uv, then MahanAI.

Onboarding wizard

Pick a model, set API keys, choose theme on first run.

Server mode

mahanai --server --port 8080 · OpenAI-compatible gateway.

Full docs

Complete reference · commands, config, plugins

Stop clicking.
Start shipping.

ten seconds from pip install to a streaming chat loop with every model you own, a local gateway for Cursor/Continue/Claude Code, plugins, custom themes, and approvals on every tool call.