Code Editor
Monaco-based Workspace editor with multi-tab editing, network-aware syntax highlighting, Cmd+S saves, run-file shortcuts, and dedicated Markdown/image/diff viewers.
Overview
The Workspace editor is built on Monaco — the same editor core used by VS Code — so editing scripts, templates, and config files feels familiar. You get multiple cursors, find/replace, bracket matching, the Monaco command palette, and keyboard-first navigation, all running locally against files on disk.
It is tuned for network work out of the box:
- No minimap — the minimap is disabled to keep narrow panes readable.
- Line numbers on, two-space tabs, word wrap off, and whitespace rendered on selection.
- Font follows Settings — the editor font family and size honor your choices under Settings → Appearance.
It uses the Monaco editor core, but it is not VS Code and does not run VS Code extensions. Language intelligence comes from the Workspace LSP layer, not the VS Code marketplace.
Editing Files
Open files from the file explorer. Each file opens in its own inner tab, so you can keep a template, a script, and a runbook open side by side while you work a device session in parallel. A dot on the tab marks unsaved changes.
Right-click a tab for tab actions. The menu adapts to the file type:
- Preview Markdown / Edit Markdown — on
.mdand.markdownfiles, toggle between the raw editor and a rendered preview. - Run File — on runnable scripts (
.py,.sh,.bash,.zsh,.js,.ts). - Copy Path — copies the file's absolute path to the clipboard.
- Close, Close Others, and Close All.
When a runnable file is active, a play button also appears in the inner tab bar; clicking it streams output to the Workspace output panel.
Shortcuts & Commands
Beyond the standard Monaco bindings, the Workspace adds two file-level actions. On macOS use Cmd; on Windows and Linux use Ctrl.
| Action | Shortcut | Notes |
|---|---|---|
| Save file | Cmd/Ctrl + S | Writes via the Agent; shows a “Saved” toast. Works even when the editor doesn't have focus. |
| Run file | Cmd/Ctrl + Shift + B | Runnable scripts only; also in the tab context menu. |
| Command palette | F1 | Monaco built-in — search every editor command. |
| Format document | Shift + Alt + F | Where a formatter is registered (e.g. JSON, XML, YANG, Python). |
| Add cursor / multi-cursor | Cmd/Ctrl + D, Alt + Click | Standard Monaco multi-cursor editing. |
The editor also offers inline AI edits: trigger the AI prompt widget, describe a change, and review the highlighted diff with Accept or Reject before it touches the file. See AI Chat for how AI features are configured.
Syntax & Languages
The editor maps a file's extension to a Monaco language for highlighting and, where available, richer language features. The built-in mapping covers the formats common in network engineering:
| Language | Extensions |
|---|---|
| Python | .py |
| YAML | .yaml, .yml |
| JSON | .json |
| XML | .xml |
| YANG | .yang |
| Jinja2 templates | .j2, .jinja, .jinja2 (highlighted as HTML) |
| Shell | .sh, .bash, .zsh |
| INI / config | .ini, .cfg, .conf, .toml |
| Other code | .ts, .js, .go, .rs, .java, .sql, .tf (HCL), .html, .css, Dockerfile, Makefile |
For Python, YANG, XML, and JSON the editor adds richer features (diagnostics, completion, formatting) through the Workspace language layer. A YANG file picks up the custom tokenizer and an indent-based pretty-printer; JSON uses Monaco's bundled worker for schema validation and format-document.
# Edited in the Workspace with YAML highlighting
all:
children:
core:
hosts:
r1.lab: { ansible_host: 10.0.0.1 }
r2.lab: { ansible_host: 10.0.0.2 }
vars:
ansible_network_os: cisco.ios.ios{% for iface in interfaces %}
interface {{ iface.name }}
description {{ iface.desc }}
ip address {{ iface.ip }} {{ iface.mask }}
{% endfor %}Cisco/Junos device config backups are highlighted with a dedicated “Network CLI” (netcli) grammar — a vendor-agnostic tokenizer for IOS/IOS-XE/IOS-XR/NX-OS and Junos. That grammar is used by the config backup viewer; see Config Snapshots. Language intelligence for source files (Python via Pyrefly, YANG/XML/JSON, and user-added LSP servers) is documented in Language Support.
Non-Text Viewers
The editor area dispatches by content type. Opening something that isn't plain source code routes to a dedicated viewer instead of the text editor:
- Markdown preview
- Right-click a
.md/.markdowntab and choose Preview Markdown to render it; toggle back with Edit Markdown. - Image & media viewer
- Images (PNG, JPG, GIF, WEBP, BMP, ICO, SVG), PDFs, audio (MP3/WAV/OGG), and video (MP4/WEBM) open in a viewer that reads the file as binary and renders it inline. Pair this with Image Paste & Drop.
- Git diff, blame & history
- Diffs, blame, and version history open in dedicated Git editors rather than the plain text view. See Git Integration.
Saving & Binary Files
Saves are written by the local Agent to the file's real path inside the Workspace — nothing is uploaded. Press Cmd/Ctrl + S and you'll see a “Saved” toast; if a write fails, the error is shown instead and the tab stays marked as modified.
The Agent supports binary-safe reads and writes, so non-text artifacts (pasted screenshots, downloaded PDFs, packet captures) are stored and re-rendered byte-for-byte rather than being mangled as text.
There is no auto-save. Unsaved tabs show a dot indicator — save with Cmd/Ctrl + S before closing a tab or switching away if you want to keep your changes.
Q&A
- Q: Is this the same editor as VS Code?
- A: It uses the Monaco editor core that powers VS Code, but it is not VS Code and does not run VS Code extensions. Workspace language features come from the LSP layer.
- Q: How do I save a file?
- A: Press
Cmd/Ctrl + S. The Agent writes the file to its real path on disk and shows a “Saved” toast. - Q: Can I run a script from the editor?
- A: Yes — for
.py,.sh,.bash,.zsh,.js, and.tsfiles. UseCmd/Ctrl + Shift + B, the play button in the tab bar, or Run File in the tab context menu. Output streams to the Workspace output panel. - Q: Do device config backups get syntax highlighting?
- A: Yes. Cisco/Junos CLI backups use the custom
netcligrammar, and structured backups (JSON, XML, YAML) use their native languages, in the config backup viewer. See Config Snapshots. - Q: Can I preview Markdown or open images?
- A: Yes. Markdown has a rendered preview toggle, and images, PDFs, audio, and video open in a dedicated binary viewer.
- Q: Where are files written?
- A: To their real path inside the Workspace, by the on-device Agent. Nothing is uploaded.
Related Features
- File Explorer — open and manage files.
- Language Support — Pyrefly, YANG/XML/JSON, and user-added LSP servers.
- Git Integration — review, diff, blame, and commit your edits.
- Image Paste & Drop — drop screenshots straight into the Workspace.
- Config Snapshots — where
netcliconfig highlighting is used.