WSL Screenshot — see the user's screen
Capture what is currently on screen and look at it. From WSL, Windows PowerShell can reach
the Windows desktop, save a PNG, and the read tool opens it.
Supporting files sit beside this file, relative to the directory containing SKILL.md:
wsl-screenshot/
├── SKILL.md
└── scripts/
├── capture.sh # entry point (bash)
└── screenshot.ps1 # Windows capture (PowerShell)
Workflow
Run the capture script from the skill's base directory (OpenCode provides that base directory when this skill loads):
bash "<skill-dir>/scripts/capture.sh"It prints one line: the WSL path to the PNG, for example
/mnt/c/Users/<you>/AppData/Local/Temp/opencode-screenshots/screen-20260918-210959-032.pngView that path with the
readtool. This is the step that lets you see the screen — running the script alone shows you nothing.read(path="/mnt/c/.../screen-....png")Answer the user's actual question about what is visible (describe the app, read the error, find the button). Do not just report the file path.
Options
| Goal | Command |
|---|---|
| All monitors (default) | capture.sh |
| One monitor | capture.sh -m 1 (monitors are 1-indexed) |
| Shrink a huge capture | capture.sh -w 1600 (max width in px, keeps aspect ratio) |
| Choose the output folder | capture.sh -o ~/shots |
Capture all monitors when the user does not name one. If they say "my other screen" or
"the second monitor", use -m; ask only if it is genuinely ambiguous.
Notes
- By default images go to Windows temp (
%TEMP%\opencode-screenshots), which is the fastest place for PowerShell to write. Override with-ofor somewhere durable. - Reading a
/mnt/c/...path may require anexternal_directorypermission entry for that path inopencode.jsonc. If thereadtool is denied, either add the permission or re-run with-opointing at a directory you are already allowed to read. - The PNG is lossless. A full multi-monitor capture can be several MB; add
-w 1920for a smaller image. - A locked or disconnected session captures black. Say so rather than guessing at content.
- Capture only when the request calls for it. To discard old shots:
rm /mnt/c/Users/*/AppData/Local/Temp/opencode-screenshots/*.png.
Troubleshooting
powershell.exe: command not found— not inside WSL. On native Linux use the desktop's own tool instead (grim,gnome-screenshot,spectacle,import).Empty output /
screen capture failed— run the PowerShell script directly to see the raw error:powershell.exe -NoProfile -ExecutionPolicy Bypass \ -File "$(wslpath -w "<skill-dir>/scripts/screenshot.ps1")"Image works but you still cannot see it — you skipped step 3. Call
readon the printed path.