An OpenCode plugin that turns a first-line video directive into real prompt attachments.
It supports two flows:
/video <local-path-or-url>: attach the whole video as avideo/*prompt part for models that accept direct video input./video-frames <local-path-or-url>: useffmpegto sample frames and attach them as images for models that do not accept full video.
OpenCode's provider layer already understands video/* input, but the built-in read tool only auto-attaches images and PDFs. This plugin fills that gap without forking OpenCode core.
Add it to your OpenCode config:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
[
"opencode-video-gateway",
{
"direct_max_bytes": 41943040,
"frames": 6
}
]
]
}Whole video:
/video ./demo.mp4
Describe what happens in this clip.
Frame fallback:
/video-frames https://example.com/demo.mp4
Summarize the key scenes.
ffmpegandffprobemust be available in the environment for/video-frames./videodownloads remote URLs before attaching them.- Large direct video attachments can exceed provider limits; use
/video-frameswhen that happens.