RuntimesProvider CLI

Pi

Run Mopheus agent tasks with pi-coding-agent.

pi-coding-agent is an open-source agent CLI. Mopheus starts Pi with --mode rpc and controls the session, submits prompts, and receives events through RPC messages on stdin/stdout. It always uses --session-id <session-id>. The exact ID is reused for resumed tasks, so Pi recreates a missing session file instead of failing; the session directory is isolated per workspace through PI_CODING_AGENT_SESSION_DIR.

FieldValue
Binarypi
Path overrideMOPHEUS_PI_PATH
Verifypi --version
Minimum version0.67.2
ProtocolRPC
Task skill path.pi/skills/
Filesystem sandboxSupported on Linux

The bundled Mopheus installer extracts Pi's unchanged standalone release under $HOME/.local/pi and links its pi executable from $HOME/.local/bin/pi. If a pi command already exists, the installer preserves it and skips the bundled copy. Manual installation with npm install -g --ignore-scripts @earendil-works/pi-coding-agent remains supported; set MOPHEUS_PI_PATH manually when using a custom command path.

Pi uses two configuration files: ~/.pi/agent/models.json defines custom providers and models, while ~/.pi/agent/settings.json selects the default provider and model. Mopheus does not manage these files or Pi's global auth.json. The Mopheus frontend does not currently pass a model selection to Pi, so Pi uses the default configured in settings.json. This models.json example configures a private OpenAI-compatible endpoint and Zhipu GLM Coding Plan. A Coding Plan key must use the dedicated endpoint https://open.bigmodel.cn/api/coding/paas/v4, not the general API endpoint https://open.bigmodel.cn/api/paas/v4. Supply the API keys through environment variables:

{
  "providers": {
    "private": {
      "baseUrl": "https://llm.example.com/v1",
      "api": "openai-completions",
      "apiKey": "${PRIVATE_LLM_API_KEY}",
      "models": [{ "id": "private-coder" }]
    },
    "glm": {
      "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
      "api": "openai-completions",
      "apiKey": "${GLM_API_KEY}",
      "models": [{ "id": "glm-5.2" }]
    }
  }
}

Export the matching keys in the environment that starts the Mopheus daemon. See Pi's custom-model documentation and Z.AI API documentation.

Set the default model in ~/.pi/agent/settings.json. This example selects GLM; to use the private model, change defaultProvider to private and defaultModel to private-coder:

{
  "defaultProvider": "glm",
  "defaultModel": "glm-5.2"
}

On this page