Image Paste & Drop
Paste a screenshot or drag an image onto a terminal; NetStacks saves it as a PNG and types the file path into the prompt so a CLI agent like Claude Code can read it.
Overview
Network troubleshooting is often visual — a topology diagram, a vendor GUI, an error dialog, a wiring photo. Image paste lets you bring that context into a NetStacks terminal without saving files by hand. Two gestures trigger it on the terminal:
- Paste a clipboard image with
Cmd+V/Ctrl+V(e.g. after a screenshot). - Drag and drop an image file onto the terminal from your file manager.
In every case NetStacks normalizes the image to PNG, saves it, and then types the saved file's full path into the terminal input followed by a single space — with no Enter. Nothing is executed; the path simply sits on the command line, ready for you or a CLI agent to use.
How It Works
When you paste or drop an image, NetStacks:
- Converts the image to PNG (any format the WebView can decode is accepted; it is re-encoded through an off-screen canvas).
- Saves it to a screenshots directory using a monotonically increasing number as the filename —
1.png,2.png, and so on. - Types the saved file's full path plus a trailing space into the terminal prompt, without sending a newline.
- Shows a toast confirming the path, e.g.
Screenshot saved to …/3.png.
The counter is seeded from the highest existing N.png in the screenshots directory when the terminal mounts, so new pastes never overwrite earlier ones. The directory is not wiped automatically — clear it yourself if you want to reclaim space.
Where Images Are Saved
The save location depends on the kind of session the terminal is attached to:
| Session type | Save location |
|---|---|
| Local terminal with a Workspace open | <workspace-root>/.netstacks/screenshots/N.png |
| Local terminal, no Workspace open | /tmp/netstacks-screenshots/N.png |
| Remote / enterprise / jumpbox session | /tmp/netstacks-screenshots/N.png on the target host |
For a local Workspace session the PNG is written directly to the hidden .netstacks/screenshots folder inside the Workspace. The .netstacks directory is internal state, so the images do not appear alongside your project files and are kept out of version control.
For a remote, enterprise, or jumpbox session the image cannot be written through the local filesystem — the terminal is talking to another machine. Instead NetStacks base64-encodes the PNG and sends a one-shot shell command over the session that decodes it into /tmp/netstacks-screenshots/ on the remote host. Echo is briefly suppressed while the data streams so the encoded blob doesn't clutter your scrollback:
stty -echo 2>/dev/null; \
mkdir -p /tmp/netstacks-screenshots && \
printf '%s' '<base64-png>' | base64 -d > "/tmp/netstacks-screenshots/3.png" && \
stty echo 2>/dev/nullThe remote path relies on a POSIX shell with base64, printf, and mkdir available on the target host. On a minimal device shell that lacks base64, the decode step will fail and only an empty or partial file is written.
Using Images with a CLI Agent
The inserted path is what makes images useful to a command-line AI agent. CLI tools such as Claude Code detect image file paths on the prompt and read the image natively, so the typical flow is:
- Start your CLI agent in the terminal.
- Paste the screenshot — the path is typed onto the current line.
- Type the rest of your prompt around it and press Enter yourself.
> /home/me/proj/.netstacks/screenshots/3.png why is this BGP neighbor stuck in Active?For a plain shell (no agent), the path is equally handy: pasted at the start of a command it becomes the first argument, so you can pipe it into any tool, e.g. file /tmp/netstacks-screenshots/3.png or open it in a viewer.
For more on driving agents from the terminal, see AI: Agents and AI: Modes.
Q&A
- Q: Will pasting an image run a command in my session?
- A: No. NetStacks inserts only the saved file's path plus a trailing space and does not send Enter, so nothing executes until you press Enter yourself.
- Q: Where does the image go?
- A: For a local Workspace session, into the hidden
.netstacks/screenshots/folder in the Workspace root asN.png. With no Workspace open it goes to/tmp/netstacks-screenshots/. For a remote, enterprise, or jumpbox session it is decoded into/tmp/netstacks-screenshots/on the target host. - Q: Is there an [Image#N] token or special placeholder?
- A: No. NetStacks types the real file path, not a token. Anything that understands a path — a CLI agent or an ordinary shell command — can use it directly.
- Q: What image formats are accepted?
- A: Any image the app's WebView can decode. It is re-encoded to PNG before saving, so the stored file is always a
.png. - Q: Do old screenshots get cleaned up?
- A: Not automatically. The filename counter advances past existing
N.pngfiles so nothing is overwritten; delete the files yourself to reclaim space. - Q: Does the image leave my machine?
- A: Only if you send a prompt referencing its path to a configured AI provider. For remote sessions the PNG is additionally written to the remote host so the remote agent can read it.
Related Features
- AI: Agents — CLI agents that read pasted image paths from the terminal.
- AI: Modes — how the assistant works with terminal context.
- Workspace Overview — where the
.netstacksstate directory lives. - File Explorer — browse saved screenshots.