Common flags

Cross-cutting flags every verb supports.

Every verb supports the same cross-cutting flags. Verb-specific flags live on each verb's page.

FlagDescription
--provider <slug>Override the configured default provider for this verb.
--api-key <key>Override the env-var API key. No effect for Ollama.
-o, --output <path>Write the result to a file. With --stream, written incrementally.
-q, --quietSuppress stdout. File output via -o is still written; stderr status (spinners, cache hints, warnings, errors) is unaffected. See Stdout decision matrix.
--retries <n>Retry retryable provider errors up to N times with exponential backoff. Default 0, max 10.
--timeout <seconds>Per-attempt timeout. Default varies by verb (web/data 120, text/image/speech 300, transcription/video 600); max 86400.
--session <name>Bind the call to a session so the usage record carries session: <name> and the call appears under marmot session get <name> (chat-mode sessions also prepend chat history for run). Available on every verb.
--dry-runResolve options, auth, and adapter, then print a JSON envelope describing what would be sent and exit before making the provider call. No usage record is written. Useful for prompt iteration on metered AI verbs and pipeline debugging. Available on every verb.

--retries and --timeout are scoped:

  • Available on: AI generation (run, image, speak, transcribe), sync data verbs (search, scrape, answer, map, enrich, lookup, verify), and the initial submission of async verbs (research, crawl, findall).
  • Not available on: get (already a polling primitive — control retry via your own loop) or api <provider> (raw passthrough — wrap your own retry).
  • On async verbs, --retries retries the initial submission only. The polling loop has its own backoff and is not affected.
  • When a retry fires, marmot prints a one-line note to stderr: [retry 1/3] tavily search: HTTP 429 — backing off 800ms. Useful for spotting silent-double-billing on paid providers.

Output

Each verb has a default output format and a flag to override it.

VerbDefault output
run (text), transcribe, answer, researchPlain text
imageTTY: file path on stdout. Piped: raw bytes (n=1).
speakTTY: plays audio. Piped: raw bytes.
Other web and data verbsStructured JSON envelope

Override flags:

FlagEffect
--jsonForce the structured {ok, provider, data, ...} envelope.
--textForce plain text. Default for the verbs above; the flag is kept for back-compat.
--rawWeb and data verbs only. Emit the provider's native body under raw instead of the normalized data.
--binaryimage and speak only. Force raw bytes to stdout.
--b64image and speak only. JSON envelope with inline base64.
--streamrun only. Stream tokens as they arrive. Implies plain text.

List/get commands (preset list/get, session list/get, providers list, tasks list/get)

These commands now ship a TTY-aware default: human-readable table or key/value layout on an interactive terminal, the JSON envelope when piped or redirected. Pass --json to force JSON, or --markdown for a markdown pipe-table (handy when embedding output in docs / Slack / GitHub comments). --json and --markdown are mutually exclusive.

marmot preset list                 # human table on TTY
marmot preset list | jq            # JSON (piped → fallback)
marmot preset list --markdown      # markdown table, regardless of TTY

Async verbs

research, crawl, and findall are async. They take two extra flags.

FlagDescription
--waitBlock and poll until terminal status. The default.
--asyncSubmit and return the task id immediately.

See Async tasks.

Cache flags (web and data sync verbs)

search, scrape, answer, map, enrich, lookup, and verify all share two flags for the response cache. Caching is opt-in per provider; these flags only matter when providers.<slug>.cache.enabled is true.

FlagEffect
--no-cacheSkip cache read and write for this call.
--refreshSkip cache read but write the fresh response, overwriting any existing entry.

See Caching for the full model and the marmot cache subcommands.

Stdout decision matrix

Every verb that accepts -o <file> resolves what to send to stdout using these rules:

-o setstdout piped--quietWhat happens
nononoEmit to screen (default).
noyesnoEmit to pipe (default).
yesnonoWrite the file; stay silent on screen (new default in 0.10.0).
yesyesnoWrite the file AND emit to the pipe.
anyanyyes--quiet always wins: stdout silent. File still written if -o is set.

--quiet only governs stdout. Stderr (spinners, cache hints, warnings, errors) is unaffected.

Examples:

# Write to file, stay silent — common case.
marmot run "summarize this" -o out.md

# Write to file AND consume in a pipe.
marmot run "summarize this" -o out.md | grep -i critical

# Force silence even when piped (write file only, pipe gets nothing).
marmot search "openrouter pricing" -o out.json --quiet

# Want to watch the stream AND save it? Drop -o and use shell tee.
marmot run --stream "long answer" | tee out.md

The matrix applies to AI verbs (run, transcribe, image, speak, video) and web/data verbs (search, scrape, answer, map, crawl, research, findall, enrich, lookup, verify).

stdout vs stderr

Marmot keeps results on stdout and status on stderr, so pipelines stay clean.

ChannelCarries
stdoutThe rendered result: text, envelope, raw bytes, or file path.
stderrSpinners, cache messages, fallbacks, warnings.

Spinners and cache messages disable themselves automatically when stderr is not a TTY (CI runners, redirected output) or when CI=true or NO_COLOR=1 is set.

Streaming runs (--stream) skip the spinner because tokens go live to stdout and a spinner on the same terminal would interfere. Cache messages still apply on first use of a provider.

Resolution order

For --provider, --model, and any other configurable default:

  1. Explicit flag on the command line
  2. ~/.marmot/config.json, set via marmot setup or marmot config set
  3. First-run auto-config: if no default is set for an AI verb (text, image, speech, transcription), marmot detects available API keys in your environment and picks the first ready provider in this order: ollama (local) → openrouter → vercel → cloudflare → openai → anthropic. The choice is persisted to ~/.marmot/config.json and a one-line stderr note announces it. You can override later with marmot setup or marmot config set.
  4. Error, with a hint listing every supported provider's env var and a link to where to get a key.