NetStacksNetStacks

Code Editor

Edit files in a workspace with the Monaco editor: tabs, syntax highlighting, Markdown preview, AI inline edit, and running Python, shell and JavaScript files.

Overview

Files you open from the file explorer open in the workspace editor, which is built on Monaco (the editor used by VS Code). It uses a dark theme with line numbers, a tab size of 2, and no word wrap or minimap. The font size and family follow Settings → General (Font Size and Font Family under Appearance).

The workspace editor is part of Workspaces, which are available in the standalone desktop app only.

Editor Tabs

Each open file gets a tab. A dot on the tab means unsaved changes. Runnable files have a ▶ button (Run <file>), and ▲ collapses the editor area. With no files open, the editor shows Open a file from the explorer.

Right-click a tab for:

  • Preview Markdown / Edit Markdown (Markdown files)
  • Run File (runnable files)
  • Copy Path
  • Close, Close Others, Close All

Shortcuts

ShortcutAction
Cmd/Ctrl+SSave the file (a Saved message confirms it)
Cmd/Ctrl+Shift+BRun the file (runnable types only)
Cmd/Ctrl+IAI inline edit

Monaco's standard editing shortcuts (find and replace, multi-cursor, comment toggle and so on) also work.

File Types and Highlighting

The editor picks a language from the file extension:

ExtensionsHighlighted as
.pyPython (with Pyrefly language features, see below)
.yangYANG (with a formatter)
.xmlXML (with a formatter)
.jsonJSON (validation and formatting)
.yaml, .ymlYAML
.j2, .jinja, .jinja2HTML
.cfg, .conf, .ini, .tomlINI
.sh, .bash, .zshShell
.ts, .tsx / .js, .jsxTypeScript / JavaScript
.mdMarkdown
.tfHCL (Terraform)
.html, .htm, .css, .sql, .rs, .go, .javaTheir own languages
Files named Dockerfile or MakefileDockerfile / Makefile
Anything elsePlain text
Network configs
Device configs saved as .cfg or .conf are highlighted as INI in the workspace editor. The Cisco/Junos-aware Network CLI highlighting is used in the Controller's Backup History view.

To format a YANG, XML or JSON file, use Monaco's Format Document command (right-click in the editor, or press F1 and search for it). See Language Support for Python language features and custom language servers.

AI Inline Edit

Select some code (or put the cursor where you want the change) and press Cmd/Ctrl+I. Type what you want in the Describe the edit... box and press Enter.

The AI applies its change directly in the editor and highlights it, with the bar AI edit applied — review the highlighted changes. Click Accept to keep it or Reject to undo it.

  • It uses the AI provider set in Settings → AI. See AI provider setup.
  • In Markdown and plain-text files, Cmd/Ctrl+I opens the general AI popup instead.

Markdown Preview

Right-click the tab of a .md file and choose Preview Markdown to see it rendered (GitHub-flavored Markdown with highlighted code blocks). Choose Edit Markdown to go back to the source.

Running Files

Click ▶ on the tab, press Cmd/Ctrl+Shift+B, or choose Run File. Each run opens a new terminal tab in the workspace and runs:

ExtensionCommand
.pypython3 "<file>" (or the NetStacks Engine, see below)
.sh, .bashbash "<file>"
.zshzsh "<file>"
.jsnode "<file>"
.tsnpx tsx "<file>"

The interpreter (Python, Node and so on) must be installed where the shell runs.

Python: Native or NetStacks Engine

The first time you run a .py file in a workspace, NetStacks asks How should Python files run?

  • Native (python3): runs with your system Python in a terminal tab. You manage the dependencies.
  • Netstacks Engine (UV): installs dependencies automatically from your imports using UV and PEP 723 inline script metadata. Output streams to the Output tab, which has Stop, Re-run and Clear buttons and a Runtime logs section.

Your choice is kept until you close the workspace tab. You will be asked again the next time you open it.

Note
If the workspace uses NetStacks Agent as its AI tool, there is no terminal panel, so non-Python runs (and Native Python runs) have nowhere to show their output. Use the NetStacks Engine for Python, or pick a different AI tool.

Images, PDFs and Media

Images (png, jpg, jpeg, gif, webp, bmp, ico, svg), PDFs, audio (mp3, wav, ogg) and video (mp4, webm) open in a preview tab instead of the text editor. The header shows the file type and size.