Skip to main content
Beyond generating images, ChatCLI lets the model see and understand images you attach — and answer based on them. It works in chat, /coder, /agent, one-shot (-p) and across the gateway channels (Telegram, WhatsApp, Slack, Discord, webhook).

How to attach

Point @file at an image — it detects the type and attaches it as vision input (not inlined as text):
Supported formats: PNG, JPEG, GIF, WebP. Local path or an image inside a directory. Images with the wrong extension are still detected by content (MIME sniff). PDFs are attached the same way: see PDF Input.
Chat is tool-less by design — attaching an image in chat works (it’s an attachment, not a tool). To generate/edit an image, use /coder or /agent with the @image tool.

@view — look at an image mid-task

@file attaches an image when you start a turn. But inside /agent and /coder, the model often produces a picture itself — a screenshot from @browser, a rendered diagram — and needs to see it to keep going. That’s @view:
@view loads a local image (PNG, JPEG, GIF, WebP) through the same vision pipeline as @file — size caps, compression, native multimodal or describe-fallback — and stages it so it is attached to the conversation on the next turn. The model then analyzes what is visible. It is read-only and available in /agent and /coder (in plain chat, use @file). The natural pairing is with @browser. Since @browser 1.1, screenshot goes through this same pipeline by itself: the capture is attached on the next turn without a separate @view call (--view false only saves the file). @view remains the way to look at any other image — a design mock, a downloaded file, an earlier screenshot:
PDFs are not supported yet — render the relevant page to an image (PNG/JPEG) first, then @view it.

Hybrid strategy (B + A)

ChatCLI decides automatically, looking at the active model’s vision capability in the catalog:
  • Vision model (GPT-4o/4.1/5.x, Claude 3+/4.x, Gemini, Kimi, GLM, Bedrock Claude…) → the image goes natively, the model truly sees the pixels. (Path B.)
  • Non-vision model → describe-fallback: a vision model describes the image and the text is folded into the prompt, so a text-only model can still reason about the content. (Path A.)
  • No vision model available → a clear warning and the answer continues text-only (never breaks).
No variable is required — @file image just works. CHATCLI_VISION_PROVIDER/CHATCLI_VISION_MODEL only override the fallback captioner (e.g. gpt-4o-mini as a cheap captioner). Which model describes. The describe-fallback tries up to four candidates, in this order, and moves on when one fails (a model not enabled in this account or region, a missing key): the CHATCLI_VISION_PROVIDER/CHATCLI_VISION_MODEL pair, the captioner that worked last, then for each configured provider (the session’s first) the vision models this account can invoke according to the provider’s live model listing, in their invokable form (on Bedrock, the inference profile us.anthropic.… instead of the bare foundation id), and finally the remaining catalog vision models. A listed model counts only when the catalog knows that exact id as a vision model — modality variants such as gemini-2.5-pro-preview-tts or embedding models are never offered as captioners — and listed models are tried newest first, in catalog order, not in the order the provider lists them. Another provider’s listing is fetched only when the candidates before it are exhausted. Models learned to be blind, and providers whose wire carries text only, are skipped. Reasoning models get room to think before they describe: the request leaves headroom for thinking within the model’s output ceiling.

Off-catalog vision models

Models fetched from a provider’s /models API may have no catalog entry. The decision is layered (CHATCLI_VISION_INPUT):
  1. Override CHATCLI_VISION_INPUT=native|describe|off — explicit control.
  2. Catalog (vision capability) — authoritative for known models. A model the provider’s listing added to the catalog without saying what it takes as input (Gemini, Anthropic, OpenAI, xAI, Moonshot and MiniMax listings, a Bedrock id with no known base model, a provider plugin model with no declared capabilities — e.g. gemini-4-argon) is not a verdict: it goes on to steps 3–4. OpenRouter and Copilot listings report input modalities, so theirs are.
  3. Conservative heuristic — if the id carries an unambiguous vision marker (-vl, vl-, vision, pixtral, llava, internvl, qwen-vl, omni, multimodal), treat it as native. Those names exist only on multimodal models → near-zero false positives.
  4. Learned or probed — for a model the catalog does not know, the verdict learned for it; with no verdict yet, the first image is preceded by one small probe to the model itself (a 16×16 image and a one-word reply). Accepted → native; the provider rejecting the image → describe-fallback; anything else (network, throttling, credentials) proves nothing and that image takes step 5. The verdict is kept per provider and model in vision_capabilities.json under the state directory for 30 days. Catalog-known models are never probed.
  5. Otherwise → describe-fallback.
The heuristic matches explicit markers only, never family prefixes (which have text-only exceptions like claude-3-5-haiku/o3-mini), so it never sends an image block to a model that would hard-error. CHATCLI_VISION_INPUT=native still forces native for every image, except on a provider whose wire carries text only (below).
Bedrock application inference profiles. A profile ARN (arn:aws:bedrock:…:application-inference-profile/…) is resolved to its foundation model with bedrock:GetInferenceProfile. When the role lacks that permission, the model is unknown to the catalog, and step 4 finds out whether it sees with no configuration — a Claude behind the profile gets @browser screenshots natively.
A provider that still refuses the image. If the model rejects image input mid-turn (a re-pointed profile, a stale verdict, CHATCLI_VISION_INPUT=native on a blind model), the turn is not lost: the route is remembered as blind, the turn’s images are replaced by their description and the turn is resent once. This works the same in chat, /coder, /agent, one-shot and on the server, gateway and MCP surfaces.

Per-provider coverage (native vision)

Image serialization is done by a shared helper, across 6 dialects covering the vision-capable providers: The gate is generic: the catalog’s vision capability, plus the learned verdict for off-catalog models (above). Providers whose wire carries text only — OpenAI Assistants, StackSpot and Devin — always get the description: their models are never probed (the probe would be answered without the image) and never chosen as captioners, even with CHATCLI_VISION_INPUT=native.

In the gateway (messaging channels)

Receive an image — send a photo on Telegram/WhatsApp/etc. and the gateway downloads it, then the configured model sees it (native or describe-fallback, same logic above). Image-only messages (no text) get a default analysis request. Send an image — if the agent generated/edited an image during the reply (via @image), it is attached automatically to the reply on photo-capable adapters.

Configuration


Image compression (before sending)

When native vision is active, ChatCLI shrinks the image before sending it to the model — keyless and pure-Go (no new dependency, no cgo). It is part of Context Compression:
  • Downscale the longest edge to CHATCLI_VISION_MAX_EDGE (1568px). Providers already reduce larger images server-side to this size for token accounting, so this is token-equivalent — it just avoids uploading pixels that would be thrown away — and for images above the cap it lowers the billed vision tokens.
  • JPEG re-encode of photos (quality CHATCLI_VISION_JPEG_QUALITY), far smaller than PNG, preserving transparency (alpha images stay PNG).
  • Safe by construction: never inflates the payload and leaves formats it cannot round-trip (animated GIF, WebP) untouched. URL-only images pass through unchanged.
Disable with CHATCLI_VISION_COMPRESS=off.

Notes

  • Images cost prompt tokens (a large image can be worth hundreds/thousands of tokens). Confirm before attaching large batches on paid models.
  • The image stays in history and is re-sent on subsequent turns (standard multimodal behavior).
  • To force a specific fallback captioner: CHATCLI_VISION_PROVIDER=openai CHATCLI_VISION_MODEL=gpt-4o-mini.