Models

CLI providers

CLI models

Summarize can use installed CLIs (Claude, Codex, Gemini, Cursor Agent, OpenClaw, OpenCode, GitHub Copilot, Antigravity, pi, Devin, Grok) as local model backends.

#Model ids

  • cli/claude/<model> (e.g. cli/claude/sonnet)
  • cli/codex/<model> (e.g. cli/codex/gpt-5.5)
  • cli/gemini/<model> (e.g. cli/gemini/flash)
  • cli/agent/<model> (e.g. cli/agent/auto)
  • cli/openclaw/<model> (e.g. cli/openclaw/main)
  • openclaw/<model> (alias for the same OpenClaw CLI path)
  • cli/opencode/<model> (e.g. cli/opencode/openai/gpt-5.4)
  • cli/opencode (use the OpenCode runtime default model)
  • cli/copilot/<model> (e.g. cli/copilot/gpt-5.2)
  • cli/copilot (use the Copilot CLI runtime default model)
  • cli/agy (use the Antigravity CLI active session model)
  • cli/pi/<model> (e.g. cli/pi/sonnet)
  • cli/pi (use pi's configured default model)
  • cli/devin/<model> (e.g. cli/devin/swe-2-max)
  • cli/devin (use the Devin CLI configured default model)
  • cli/grok/<model> (e.g. cli/grok/grok-4.6)
  • cli/grok (use the Grok CLI default model)

Use --cli [provider] (case-insensitive) for the provider default, or --model cli/<provider>/<model> to pin a model. Bare cli/codex defaults to GPT-5.5; set cli.codex.model to override it. Antigravity does not support per-call model selection in print mode, so use cli/agy without a model suffix. pi supports cli/pi/<model> or a configured cli.pi.model. devin supports cli/devin/<model> or a configured cli.devin.model; run devin models list to see the available model families. If --cli is provided without a provider, auto selection is used with CLI enabled.

Codex GPT Fast:

  • --model codex-fast maps to cli/codex/gpt-fast.
  • OpenAI fast mode is not a CLI model. Use --model openai/gpt-5.5 --fast --thinking medium; see docs/openai.md.

#Auto mode

Auto mode can prepend CLI attempts in two ways:

  • cli.enabled set in config:
  • Auto always uses this list order.
  • Also acts as an allowlist for explicit --cli / --model cli/....
  • Auto CLI fallback (cli.autoFallback, default enabled):
  • Applies only to implicit auto (when no model is set via flag/env/config).
  • Default behavior: only when no API key is configured.
  • Default order: claude, gemini, codex, agent, openclaw, opencode, copilot.
  • Antigravity, pi, devin, and Grok are opt-in unless added to cli.autoFallback.order.
  • Remembers + prioritizes the last successful CLI provider (~/.summarize/cli-state.json).

Gemini CLI performance: summarize sets GEMINI_CLI_NO_RELAUNCH=true for Gemini CLI runs to avoid a costly self-relaunch (can be overridden by setting it yourself).

Set explicit CLI allowlist:

{
  "cli": { "enabled": ["gemini"] }
}

Configure auto CLI fallback:

{
  "cli": {
    "autoFallback": {
      "enabled": true,
      "onlyWhenNoApiKeys": true,
      "order": ["claude", "gemini", "codex", "agent", "openclaw", "opencode", "copilot"]
    }
  }
}

Disable auto CLI fallback:

{
  "cli": { "autoFallback": { "enabled": false } }
}

Note: --model auto (explicit) does not trigger auto CLI fallback unless cli.enabled is set.

#CLI discovery

Binary lookup:

  • CLAUDE_PATH, CODEX_PATH, GEMINI_PATH (optional overrides)
  • AGENT_PATH (optional override)
  • OPENCLAW_PATH (optional override)
  • OPENCODE_PATH (optional override)
  • COPILOT_PATH (optional override)
  • AGY_PATH (optional override)
  • PI_PATH (optional override)
  • DEVIN_PATH (optional override)
  • GROK_PATH (optional override)
  • Otherwise uses PATH

Run summarize status to list enabled CLI providers whose executable is currently available. summarize status --verbose also prints the resolved executable path and configured CLI model. Missing or disabled providers are omitted.

#Attachments (images/files)

Asset extraction and summary preparation share text-size validation and Markdown conversion in src/run/flows/asset/content.ts. Summary preparation retains provider-specific native attachment selection and returns either an attachment prompt or inline text; extraction applies its character budget after conversion.

When a CLI attempt is used for an image or non-text file, Summarize switches to a path-based prompt and enables the required tool flags:

  • Claude: --tools Read --dangerously-skip-permissions
  • Gemini: --yolo and --include-directories <dir>
  • Codex: codex exec --output-last-message ... and -i <image> for images
  • Agent: uses built-in file tools in agent --print mode (no extra flags)
  • OpenCode: opencode run --format json ... --file <path> when a file/image path is required
  • Copilot: copilot -p <prompt>; passes --model <model> when one is configured
  • Antigravity: agy --print; does not auto-approve tools for attachment prompts
  • pi: pi --print --mode json; passes --system-prompt, sends prompt over stdin, and uses --no-tools for isolated summaries
  • devin: devin --print --prompt-file <file>; keeps the caller cwd and real Devin config for attachments, preserves workspace trust checks, and uses --permission-mode auto so read-only tools are auto-approved
  • Grok: grok --prompt-file <file> --output-format json --always-approve for path-based prompts

Remote image and binary-file URLs are limited to native providers and CLI backends that can consume the staged attachment without broad tool approval. Local file inputs keep the existing path-based CLI behavior because they are operator-selected files rather than untrusted remote content.

#Config

{
  "cli": {
    "enabled": [
      "claude",
      "gemini",
      "codex",
      "agent",
      "openclaw",
      "opencode",
      "copilot",
      "agy",
      "pi",
      "devin",
      "grok"
    ],
    "autoFallback": {
      "enabled": true,
      "onlyWhenNoApiKeys": true,
      "order": ["claude", "gemini", "codex", "agent", "openclaw", "opencode", "copilot"]
    },
    "codex": { "model": "gpt-5.5" },
    "gemini": { "model": "flash", "extraArgs": ["--verbose"] },
    "claude": {
      "model": "sonnet",
      "binary": "/usr/local/bin/claude",
      "extraArgs": ["--verbose"]
    },
    "agent": {
      "model": "auto",
      "binary": "/usr/local/bin/agent"
    },
    "openclaw": {
      "model": "main",
      "binary": "/usr/local/bin/openclaw"
    },
    "opencode": {
      "binary": "/usr/local/bin/opencode"
    },
    "copilot": {
      "binary": "/usr/local/bin/copilot"
    },
    "agy": {
      "binary": "/usr/local/bin/agy"
    },
    "pi": {
      "binary": "/usr/local/bin/pi"
    },
    "devin": {
      "binary": "/usr/local/bin/devin"
    },
    "grok": {
      "binary": "/usr/local/bin/grok",
      "model": "grok-4.6"
    }
  }
}

Notes:

  • CLI providers that emit structured output report token usage (and USD cost where the CLI exposes it); plain-output providers such as Copilot report none.
  • If a CLI call fails, auto mode falls back to the next candidate.
  • Cursor Agent CLI uses the agent binary and relies on Cursor CLI auth (login or CURSOR_API_KEY).
  • Antigravity CLI uses the active agy session model; cli.agy.model is ignored by runtime selection.
  • Antigravity normal text summaries run agy --print <prompt> in a temporary cwd with --sandbox. When the prompt or command length exceeds platform argv limits (e.g. 120 KB on Linux/macOS), the document <content> payload is automatically offloaded to a temporary file (document.txt) with restricted 0o600 permissions and referenced via file:// in --print, preserving instructions before and after the content block in argv while cleaning up the single temporary directory on success, failure, or timeout. Untagged prompts are offloaded as a complete request. Short text prompts retain best-effort no-tools guidance; offloaded prompts permit reading the supplied document while discouraging file edits, local file links, and work-log narration. This is prompt steering, not a hard capability boundary. Attachment prompts keep the caller cwd so agy can inspect the requested path but do not auto-approve tools.
  • pi runs in JSON mode (--print --mode json) with --no-tools, --no-context-files, --no-extensions, --no-skills, --no-session for isolated summarization. It receives the summarize system prompt via --system-prompt, the summarize prompt over stdin, and reports usage/cost via JSONL events. Use PI_PATH to override the binary path.
  • devin runs devin --print --prompt-file <file> --export <atif>. Normal text summaries run isolated by default: a temporary cwd plus fabricated XDG_CONFIG_HOME/XDG_DATA_HOME that carry only credentials.toml and a merged config.json (user config preserved but tools denied via permissions.deny, plugins/subagents/auto-update disabled, and other-agent rule imports suppressed). Token usage is read from the ATIF export; Devin does not report USD cost. Set cli.devin.isolated to false only when you intentionally need Devin to inherit your real config/sessions. Attachment prompts keep the caller cwd and real Devin home so read-only tools can inspect the requested path. Auth comes from devin auth login credentials or WINDSURF_API_KEY; use DEVIN_PATH to override the binary path.
  • Devin reserves --export for a private result file per summary; cli.devin.extraArgs cannot override it. This prevents overlapping summaries from reading each other's output.
  • Devin isolated text summaries always use a private empty working directory, even when the caller supplies a directory. Workspace trust is bypassed only there. Attachment runs and cli.devin.isolated: false retain the caller's directory and trust check: print mode rejects an untrusted project until you trust it in Devin. This keeps project startup hooks behind the CLI's own trust boundary.
  • Devin isolation requires the system temporary directory to be outside a Git or Jujutsu checkout, because Devin searches parent directories for project configuration. If a custom TMPDIR or TEMP points inside a checkout, Summarize fails before launching Devin; choose a temporary directory outside the checkout. On Windows, authentication and user configuration come from %APPDATA%\devin even when XDG variables are set.
  • Grok CLI runs headless via grok --prompt-file <file> --output-format json and reports token usage and cost. Text summaries always use a private cwd and home: only auth.json is copied into GROK_HOME; other agent configuration, hooks, sessions, and MCP servers are not inherited. Both the system instructions and document go into a mode-0600 prompt file, never argv. Built-in tools are removed, all tool calls and MCP are denied, web search and subagents are disabled, and a generated --sandbox summarize profile extending strict is mandatory. This generated policy is the only configuration added to the isolated home; no user configuration is copied. If Grok cannot apply strict sandboxing, the summary fails rather than weakening it. Requires Grok 1.0.41 or newer and grok login or XAI_API_KEY.
  • Grok text isolation cannot be disabled with cli.grok.isolated: false. A custom temporary directory must be outside project and agent configuration trees. cli.grok.extraArgs accepts only --reasoning-effort (or --effort) and --max-turns; use GROK_PATH for the binary and cli.grok.model or cli/grok/<model> for model selection. Explicit local attachment prompts retain the caller cwd and real Grok configuration with --always-approve --sandbox off; untrusted remote attachments cannot use that mode.
  • Codex CLI normal text summaries run isolated by default: codex exec --ephemeral --ignore-user-config --ignore-rules -C <temp-dir> ... with a sanitized temporary CODEX_HOME that carries auth only. Set cli.codex.isolated to false only when you intentionally need Codex to inherit local config/rules.
  • Gemini CLI is invoked in headless mode with --prompt for compatibility with current Gemini CLI releases.
  • OpenClaw uses openclaw agent --agent <model> --message <prompt> --json because current OpenClaw requires -m/--message; very large extracted inputs are rejected before launch to avoid argv limits.
  • OpenCode uses opencode run --format json, streams prompt text over stdin, and uses the runtime default model when none is configured.
  • Copilot uses copilot -p, treats stdout as plain text, and uses the runtime default model when none is configured.

#Quick smoke test (all CLI providers)

Use a tiny local text file and run each provider with a longer timeout (Gemini can be slower):

printf "Summarize CLI smoke input.\nOne short paragraph. Reply can be brief.\n" >/tmp/summarize-cli-smoke.txt

summarize --cli codex --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli claude --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli gemini --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli agent --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli openclaw --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli opencode --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli copilot --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli agy --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli pi --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli devin --plain --timeout 2m /tmp/summarize-cli-smoke.txt
summarize --cli grok --plain --timeout 2m /tmp/summarize-cli-smoke.txt

If Agent fails with auth, run agent login (interactive) or set CURSOR_API_KEY.

#Generate free preset (OpenRouter)

summarize ships with a built-in preset free, backed by OpenRouter :free models. To regenerate the candidate list (and persist it in your config):

summarize refresh-free

Options:

  • --runs 2 (default): extra timing runs per selected model (total runs = 1 + runs)
  • --smart 3 (default): number of “smart-first” picks (rest filled by fastest)
  • --set-default: also sets "model": "free" in ~/.summarize/config.json