give non-vision opencode models the ability to see images and screenshots by routing them to a vision-capable model.
when a user attaches a screenshot to a text-only model, opencode rejects it with an error. This plugin intercepts that flow by registering a see_image tool that sends the image to a vision model and returns a textual description the primary model can reason about.
when the active model is already vision-capable (its capabilities.input.image is true), the plugin stays out of the way: the see_image instructions are not injected, and a stray see_image call returns a harmless "you already saw this natively" note instead of an error. beware that this might lead to issues while switching models mid session, so a clean session might fix most of your problems (if any).
install
one command (recommended):
opencode plugin opencode-see-image --global
This installs the package and adds it to your config. Then restart opencode.
edit config manually:
Add the plugin to your opencode config:
// ~/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-see-image"]
}
Then restart opencode.
install via your agent (for some reason?)
ask your agent:
install the opencode-see-image plugin
it'll run opencode plugin opencode-see-image --global and tell you to restart.
prerequisites
the plugin supports both OpenCode v1 (1.3.4 or newer) and v2 (2.x). the same package loads under either runtime: it exports a single dual-shaped plugin object carrying both a v1 server() and a v2 setup(), and each runtime picks the member it understands.
you need a connected vision-capable provider. The plugin auto-detects whichever you have connected, either of these work:
free (OpenCode, formerly Zen)
- run
/connectin opencode - select opencode (OpenCode, formerly Zen)
- paste your API key from opencode.ai/auth
the plugin uses mimo-v2.6-flash-free automatically — if you don't have an OpenCode Go sub, it skips the paid model entirely (no errors) and routes to the free model. free models get retired every few months and have a usage limit, so set a fallback if you want see_image to keep working when that happens.
paid, w/ OpenCode Go
- run
/connectin opencode - select opencode-go
- paste your API key from opencode.ai/auth
the plugin prefers minimax-m3 via opencode-go when available.
paid, w/ another provider
set the SEE_IMAGE_* env vars to point at any Anthropic-Messages-compatible endpoint. see Configuration below.
the resolve order: explicit SEE_IMAGE_API_KEY env → configured SEE_IMAGE_PROVIDER → fallback → opencode-go (MiniMax M3) if you have a Go sub connected → opencode (mimo-v2.6-flash-free). If no Go sub is connected, opencode-go is skipped so free users never hit a "model not found" error.
how the eye surgery works
user attaches screenshot
|
v
opencode rejects it: 'this model does not support image input'
| (the model only sees the filename, or nothing at all)
v
plugin's system-prompt instructions tell the model to call see_image
|
v
see_image tool resolves the image:
1. asks the opencode server for the session's attachments (exact name,
then unicode-normalized name, then most recent image)
2. falls back to reading opencode's SQLite DB directly (this session,
then any session)
3. falls back to a filesystem search
4. if the name matched nothing but the session has an image, uses the
most recent one anyway
|
v
sends the image to the vision model and returns the textual description
|
v
primary model answers using the description
if everything misses, the error message lists the images actually attached to the session so the model can retry with a correct filename.
security [ introduced in 1.3.1 ]
the vision call handles attacker-influenceable content (the image itself, plus the question), so the helper model is locked out of the agent toolset on every route:
- sdk route (default): the helper session is created with a wildcard deny (
"*": falseplus explicit per-tool denies), which opencode converts to session permission rules that strip every tool. - cli fallback (free Zen models): the spawned
opencode rungets a deny-allOPENCODE_PERMISSIONconfig and runs without--dangerously-skip-permissions, so no tool is offered and nothing can be auto-approved. - http route (
apiKeyset): a plain Anthropic-Messages API call with notoolsfield at all.
on v2 the helper session is created with a session-scoped deny-all permission rule (* / * → deny), which drops every tool from the request. as extra layers, the context hook strips any remaining tools and a permission.evaluate hook denies any check the helper raises. free Zen models also go through this helper session on v2, not through the CLI, because v2's opencode run ignores OPENCODE_PERMISSION.
versions before 1.3.1 passed tools: {} on the SDK route, which opencode treats as "no overrides" — the vision model received the full toolset and could actually execute commands (#6). update if you're on an older version.
v1 / v2 compatibility [ introduced in 1.4.0 ]
opencode's two runtimes use incompatible plugin module shapes:
| runtime | loader accepts | hook surface |
|---|---|---|
v1 (opencode 1.x) |
default export { id?, server } (object form since 1.3.4) |
tool, event, chat.params, experimental.chat.system.transform |
v2 (opencode 2.x) |
default export { id, setup } (or { id, effect }) |
ctx.tool.transform, ctx.session.hook, ctx.permission.hook, ctx.model.list |
a plugin written for one shape fails to load on the other — v2 reports must export a default definition with an id and an effect or setup function, v1 reports must default export an object with server(). this package handles both from a single entrypoint:
index.tsexports one object with bothsetup(v2) andserver(v1). v2's schema accepts{ id, setup, … }and ignores the extraserverkey; v1's detector finds{ id, server }and calls it. neither runtime sees a shape it rejects.v1.tsholds the legacy adapter,v2.tsthe modern one. they sharecore.ts(config resolution, the Anthropic-Messages HTTP call, the system prompt, the heartbeat) andlib.ts(image resolution), so the two paths cannot drift.- on v2, model vision capability comes from
ctx.model.list()(the active model arrives as a bare{ id, providerID }ref), and thesee_imageinstructions are injected throughctx.session.hook("context", …).see_imageis registered withcodemode: false, so it's a direct tool likeread/bashrather than hidden behind v2'sexecutewrapper. - v2 has no plugin API for deleting sessions, so each vision call leaves a small idle
see_image helpersession behind (v1 deletes them). - auto-update works on both. on v1 it runs
opencode plugin … --global; on v2 it moves the version pin in your config (v2 reloads the plugin live) or runsopencode plugin update opencode-see-imagefor an unpinned entry. to install on v2:opencode plugin add opencode-see-image.
index.ts exports nothing but its default on purpose: the v1 loader calls every exported binding as if it were a plugin factory, so a stray helper export would crash the plugin at load time.
the see_image tool
the plugin registers a see_image tool with two arguments:
| arg | type | required? | description |
|---|---|---|---|
filePath |
string | n | path to the image. Absolute path, or a bare filename like "Screenshot 2026-06-18 at 17.32.24.png" to auto-locate. Omit (or pass "latest") to use the most recent image attached to the conversation. |
question |
string | n | a specific question about the image. Defaults to a general detailed description. Use this to focus on a particular detail (e.g. "What error is shown in the terminal?"). |
your model calls this tool automatically when you attach a screenshot, you don't need to do anything special. The question arg is optional; the model uses it when you ask something specific about the image.
auto mode (v2 only, opt-in)
by default the text-only model has to notice the image and call see_image. with "auto": true the plugin describes images before the request goes out, so the model just reads a description in place of each image. no tool call, nothing for the model to forget.
{
"plugin": [["opencode-see-image", { "auto": true }]]
}
how it works:
- it runs in v2's session
contexthook, which sees the request's messages before OpenCode turns unsupported images into itsthis model does not support image inputerror. each image (pasted, or returned by a tool such asread) is replaced with the vision model's description, fenced as untrusted data. - it only acts on models the catalog marks as text-only. vision models get the image untouched, and a model missing from the catalog keeps the normal
see_imageflow. - the hook edits a per-request copy of the conversation, so nothing is saved. switch to a vision model mid-session and it sees the original image again.
- each image is described once. descriptions are cached in memory and in
$XDG_CACHE_HOME/opencode-see-image(default~/.cache/opencode-see-image, readable only by you), so replaying the conversation on every step costs no extra vision calls, even after a server restart. the cache is keyed by the vision route too, so switching the vision model gets fresh descriptions. delete the folder to drop all of them. - a turn waits at most
timeoutfor descriptions, describing up to 3 images at a time. images that aren't done by then stay as they are for that step and finish in the background. - if the vision call fails, the image stays as it is: OpenCode inserts its usual error and the model can still call
see_image. a failed image is retried after 5 minutes, not on every step. see_imagestays registered, so the model can still ask a specificquestionabout an image the description did not cover.- the model only knows what the description says, so pick a strong vision model with
provider/model. a small one can misread or skip details. - compaction and
generaterequests get the same treatment, so summaries keep what the images showed. - v1 is unchanged: auto mode needs OpenCode 2.x.
configuration
you can configure the vision route two ways: via plugin options in your opencode config (recommended), or via SEE_IMAGE_* env vars. The plugin uses opencode's SDK client by default (handles auth automatically). Set SEE_IMAGE_API_KEY to bypass the SDK and call an HTTP endpoint directly.
via plugin options (config)
Set the vision route in your opencode config (~/.config/opencode/opencode.json or opencode.json in a project) using the tuple form of the plugin array entry:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
[
"opencode-see-image",
{
"provider": "egon-proxy",
"model": "qwen3.6-35b-a3b:latest"
}
]
]
}
Supported option keys (all optional):
| option | env var fallback | default | description |
|---|---|---|---|
provider |
SEE_IMAGE_PROVIDER |
opencode-go |
Provider ID for SDK routing |
model |
SEE_IMAGE_MODEL |
minimax-m3 |
Vision model ID |
fallback |
SEE_IMAGE_FALLBACK |
(none) | Second route as provider/model, tried right after provider/model fails |
auto |
SEE_IMAGE_AUTO |
false |
v2 only: describe images up front for text-only models instead of waiting for a see_image call. See auto mode |
endpoint |
SEE_IMAGE_ENDPOINT |
https://opencode.ai/zen/go/v1/messages |
HTTP endpoint (only used with apiKey) |
apiKey |
SEE_IMAGE_API_KEY |
(uses SDK) | Bypass SDK, call HTTP endpoint directly |
timeout |
SEE_IMAGE_TIMEOUT |
30000 |
Per-candidate timeout in ms. Prevents hanging on slow models. In auto mode, also the longest a turn waits for descriptions. |
apiVersion |
SEE_IMAGE_API_VERSION |
2023-06-01 |
anthropic-version header (HTTP mode only) |
userAgent |
SEE_IMAGE_USER_AGENT |
(Chrome UA) | User-Agent header (HTTP mode only) |
precedence: per field, resolution is plugin option → SEE_IMAGE_* env var → built-in default. Config options take precedence over env vars; env vars remain the fallback when an option is unset. Existing env-var-only setups are unchanged.
note on secrets: a project-level opencode.json usually ends up in git — keep apiKey out of it and use the SEE_IMAGE_API_KEY env var instead.
via env vars
same settings as environment variables:
| env var | default | description |
|---|---|---|
SEE_IMAGE_MODEL |
minimax-m3 |
Vision model ID |
SEE_IMAGE_PROVIDER |
opencode-go |
Provider ID for SDK routing |
SEE_IMAGE_FALLBACK |
(none) | Second route as provider/model, tried right after the configured one |
SEE_IMAGE_AUTO |
false |
1/true turns on auto mode (v2 only) |
SEE_IMAGE_API_KEY |
(uses SDK) | Bypass SDK, call HTTP endpoint directly |
SEE_IMAGE_ENDPOINT |
https://opencode.ai/zen/go/v1/messages |
HTTP endpoint (only used if SEE_IMAGE_API_KEY is set) |
SEE_IMAGE_API_VERSION |
2023-06-01 |
anthropic-version header (HTTP mode only) |
SEE_IMAGE_USER_AGENT |
(Chrome UA) | User-Agent header (HTTP mode only) |
SEE_IMAGE_TIMEOUT |
30000 |
Per-candidate timeout in ms. Prevents hanging on slow models. In auto mode, also the longest a turn waits for descriptions. |
using a different vision model
any Anthropic-Messages-compatible endpoint works. for example, to use a direct MiniMax key:
export SEE_IMAGE_ENDPOINT="https://api.minimax.io/v1/messages"
export SEE_IMAGE_MODEL="minimax-m3"
export SEE_IMAGE_API_KEY="your-minimax-key"
to use a different opencode-go model (e.g. Kimi K2.7):
export SEE_IMAGE_MODEL="kimi-k2.7-code"
to fall back to another provider when the main route fails (expired key, usage limit, retired model):
["opencode-see-image", {
"provider": "openai",
"model": "gpt-5.4-mini",
"fallback": "google/gemini-2.5-flash"
}]
verified vision-capable models
Free (OpenCode, formerly Zen):
| model | Notes |
|---|---|
mimo-v2.6-flash-free |
free, usage-limited, image input per models.dev. default fallback when only OpenCode is connected (routed via CLI on v1, via a tool-less helper session on v2). replaces mimo-v2.5-free, which is retired. |
big-pickle |
for some reason, big pickle works as an image capable model when called through the sdk w/ an active opencode go sub. |
paid (OpenCode Go):
| model | speed | notes |
|---|---|---|
minimax-m3 |
~3000ms | default. fast, clean, and accurate. |
kimi-k2.7-code |
~7000ms | clean and accurate. |
kimi-k2.6 |
~12000ms | accurate but slow. |
qwen3.7-plus |
~15000ms | slow, spends a bit more tokens because of thinking. |
updating
auto-update (built in): uses the opencode-plugin-update-kit and shows a toast: "opencode-see-image updated to X.Y.Z, restart opencode to apply". You just need to restart opencode to load the new version.
manual update:
opencode plugin opencode-see-image --force --global
then restart opencode.
pin a version in your config to opt out of auto-updates:
"plugin": ["opencode-see-image@0.4.2"]
platform support
works on macOS, Windows, and Linux, in both the CLI/TUI (Bun runtime) and the desktop app (whose server runs on Node inside Electron). The package ships compiled JS and avoids Bun-only APIs at load time, so it loads on either runtime. Attachment lookup goes through the opencode server API first (works everywhere, including remote workspaces), with a direct SQLite read and a filesystem search as fallbacks.
file search locations
when opencode rejects an image attachment, the model only receives a bare filename. see_image first checks the opencode DB (cross-platform), then falls back to searching these filesystem locations, in order:
macOS
$TMPDIR/TemporaryItems/NSIRD_screencaptureui_*/(where macOS stashes dragged screenshots)$TMPDIR/TemporaryItems/~/Desktop,~/Downloads, current working directory
Windows
%TEMP%/%TMP%(dragged/temp images)%USERPROFILE%\Pictures\Screenshotsand the OneDrive-redirected%USERPROFILE%\OneDrive\Pictures\Screenshots(Win+PrtScn / Snipping Tool)%USERPROFILE%\Pictures~\Desktop,~\Downloads, current working directory
Linux
$TMPDIR//tmp~/Pictures/Screenshots,~/Pictures~/Desktop,~/Downloads, current working directory
pass an absolute filePath to skip the search.
License
MIT
