Skip to content
RU

Pi

Pi is a minimalist open-source terminal agent (TUI) by Earendil. Instead of built-in sub-agents and plan modes it offers extensibility: skills, TypeScript extensions, custom prompt templates. It connects to Mixen as an OpenAI-compatible provider via models.json.

Terminal window
curl -fsSL https://pi.dev/install.sh | sh

or via a package manager:

Terminal window
npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Create ~/.pi/agent/models.json (Windows: %USERPROFILE%\.pi\agent\models.json) — this is Pi’s agent directory, where auth.json and settings.json live too:

{
"providers": {
"mixen": {
"baseUrl": "https://api.mixen.ai/v1",
"api": "openai-completions",
"apiKey": "$MIXEN_API_KEY",
"models": [
{ "id": "openai/gpt-6.1-sol" },
{ "id": "google/gemini-3.8-flash" },
{ "id": "z-ai/glm-5.3" }
]
}
}
}

Key points:

  • api: "openai-completions" — the wire protocol style; Mixen is OpenAI Chat Completions compatible.
  • apiKey supports environment interpolation ($MIXEN_API_KEY, ${MIXEN_API_KEY}), a literal value, or a command with a leading !. Commands run at request time and are not cached.
  • The models list — which ids from the catalog to expose in Pi; add your own.

The environment variable with an mxn-… key from the dashboard:

Terminal window
export MIXEN_API_KEY="mxn-your-key" # add to ~/.bashrc or ~/.zshrc to persist
Terminal window
pi
  • /model — search and select a model; it also re-reads models.json after edits.
  • Ctrl+S on a model — make it the default for new sessions.
  • Ctrl+P — cycle through favorite models.
  • pi -p "query" — print mode for a single command, handy in scripts.

Until Pi can resolve the key, models from models.json stay hidden in /model — make sure the variable is set in the current terminal session.

  • AGENTS.md in the project root — instructions for that repository.
  • ~/.pi/agent/SYSTEM.md — fully replaces the system prompt; APPEND_SYSTEM.md — appends to it.
  • Skills — your own CLI tools with a README in ~/.pi/agent/skills/; there is no built-in MCP — tools come from skills or extensions.
Model ID
GPT-6.1 Sol openai/gpt-6.1-sol
Claude Sonnet 5.5 anthropic/claude-sonnet-5.5
GLM 5.3 z-ai/glm-5.3
DeepSeek V4 Pro deepseek/deepseek-v4-pro
Kimi K3 moonshotai/kimi-k3

The up-to-date list is in the catalog.

  • Mixen models missing from /model — Pi could not read the key: MIXEN_API_KEY is unset in this session; set it and reopen /model.
  • models.json edits not picked up — /model re-reads the file; there is no separate reload command.
  • 401 from the API — the key is revoked or mistyped; check it with curl https://api.mixen.ai/v1/models -H "Authorization: Bearer $MIXEN_API_KEY".