A tool plugin for OpenCode that displays images in graphics-capable terminals like Kitty.
Installation
Agents should follow the instructions in the installation document.
Humans should simply request OpenCode to perform the installation:
Perform the installation instructions in the following document: https://raw.githubusercontent.com/rezrov/opencode-image/refs/heads/master/INSTALLATION.md
Usage
The plugin provides two tools in OpenCode:
image_display— Display a single image centered in the terminalimage_dismiss— Remove the displayed image
Once the tool is installed, you can ask OpenCode to:
- "Display the picture example.jpg in the current directory"
- "Find all the images in ~/Downloads and display them one at a time, for five seconds each"
- "Find the newest snapshot image in ~/Desktop and display it"
- "Dismiss the image"
How It Works
.opencode/tools/image.ts— TypeScript tool definitions (OpenCode plugin API).opencode/tools/image.py— Python graphics protocol engine
The tool runs as a subprocess, discovers the controlling TTY by walking the process tree, and communicates with Kitty via the terminal graphics protocol. This protocol only supports PNG format, so other formats are handled by creating a temporary PNG file in the same directory.
Requirements
- A graphics-capable terminal emulator (at the time of writing, this tool has only been tested with the Kitty terminal emulator on macOS)
- OpenCode 1.2.20 or later
- Python 3.9 or later
- Either bun or npm to install dependencies
