Getting started

Run on macOS

Install the Intel or Apple Silicon release with brew install matt-riley/tools/panda. Check the installed version with panda --version.

From this checkout, install the terminal binary with a Rust toolchain that supports edition 2024 and standard-library file locks.

cargo install --locked --path crates/cli
cd /path/to/repository
panda

For DeepSeek or OpenRouter, set DEEPSEEK_API_KEY or OPENROUTER_API_KEY in the launching shell. Panda defaults to DeepSeek. Select a provider and model with :model openrouter openai/gpt-4.1-mini. To retain a configured key for future sessions, use :login deepseek or :login openrouter.

Panda supports native Anthropic Messages, OpenAI Responses and Gemini alongside Codex subscriptions. Use a virtual model to route individual requests to the configured physical providers. Provider and routing guide

Register OpenAI-compatible endpoints in $PANDA_HOME/models.json (the default state directory is ~/.panda). Each model sets its context window, output ceiling and accepted inputs. Prices are US dollars per million tokens. Omitting a price leaves the corresponding cost unknown. For example:

{
  "providers": {
    "local": {
      "baseUrl": "http://127.0.0.1:8080/v1",
      "models": [{
        "id": "vision",
        "name": "Local Vision",
        "input": ["text", "image"],
        "contextWindow": 32768,
        "maxTokens": 4096,
        "cost": {"input": 1, "output": 3, "cacheRead": 0.1, "cacheWrite": 1.2}
      }]
    }
  }
}

Set apiKey to an uppercase environment variable name for authenticated endpoints. Run panda --list-models to inspect the catalogue. Use panda --models 'local/*,other/fast:high' or :scope PATTERNS to limit the model picker and cycling. Press Ctrl-P or enter :cycle prev to cycle. Check :auth for credential status. :logout PROVIDER removes the saved key and disables that provider until its next login.

Panda resumes each branch with its own provider, model and thinking level. Pi JSONL exports retain the model that answered each turn, including one-shot overrides. :usage lists requests, retries and summaries with their reported or catalogue-derived costs. It reports unpriced requests separately.

Set "request": {"maxRetries": 2, "timeoutMs": 60000} in Panda's settings.json to limit retries and each provider attempt. The project settings file can replace the request policy. Defaults are three retries and no Panda deadline. Use :settings reload to apply edits. In models.json, a Responses endpoint accepts "transport": "sse" (default), "websocket", or "auto". Auto falls back to SSE if the upgrade is unsupported, before sending a generation request.

Use :warm to submit the current prompt prefix once. The command leaves the transcript alone, ignores any returned tool calls, and records the provider's usage under warm. Cache admission depends on the provider. In the loopback pricing fixture a warm request cost $0.000300 for 100 input and 10 output tokens. Panda only warms on request.

For ChatGPT Codex, enter :login, choose OpenAI Codex, then choose Open browser or Use device code. After signing in, enter :model to search the models from configured providers. Type to filter, move with ↑ or ↓, press Enter to select, or Esc to cancel. GPT selections use your Codex subscription. Use :login openai to start Codex sign-in directly. The Rust binary handles authorization, token refresh, streaming and tool calls. Panda reads existing subscription credentials from the same private SQLite database.

Offline session transfer on Linux

Install the CLI from this checkout with cargo install --locked --path crates/cli. From the destination workspace, run panda --import-session session.jsonl. Use the returned session ID with panda --export-session ID exported.jsonl. Both commands accept --session-dir DIR for a separate private session store. Interactive coding sessions currently require the macOS host.