Subnets Preview
Preview IP subnet layouts inside VS Code / Cursor using the Visual Subnet Calculator — without leaving the editor.
Export JSON from v0-subnets (or any compatible networkAddress + subnets[] file), run Subnet: Preview JSON, and the layout opens in Simple Browser with Divide/Join, notes, and colors.
Features
- In-editor preview — opens Simple Browser beside your code (no external browser required).
- Works without a JSON file focused — finds
docs/subnet-config-*.json (or your configured glob) automatically.
- Smart file pick — uses the focused editor only when it contains valid v0-subnets JSON; ignores unrelated JSON (e.g.
tasks.json).
- Empty calculator fallback — if no config exists in the workspace, opens a blank v0-subnets page to start planning.
- No telemetry — no analytics, no background network calls from the extension itself.
- Workspace-local reads only — no shell, no Python, no access to secrets or env files.
Usage
- Install the extension.
- Open a workspace that contains a v0-subnets JSON export (optional).
- Run Subnet: Preview JSON from the Command Palette (
Cmd+Shift+P / Ctrl+Shift+P).
Or bind a keyboard shortcut to command network.subnetPreview.open.
Which config file is used?
| Situation |
File used |
| Focused editor has valid v0-subnets JSON |
That file |
| No valid JSON focused |
Latest match of network.subnetPreview.configGlob (default: docs/subnet-config-*.json) |
| Primary glob finds nothing |
Tries network.subnetPreview.configFallbackGlobs (default: **/*subnet-config*.json) |
| Multiple matches |
Latest path (sorted); set promptWhenMultiple to true for a picker |
| No config in workspace |
Empty v0-subnets calculator (if openEmptyWhenMissing is true) |
Re-run the command after saving JSON changes — an already-open Simple Browser tab does not auto-refresh.
Compatible with exports from v0-subnets.vercel.app:
{
"networkAddress": "10.0.0.0",
"maskBits": "16",
"subnets": [
{
"networkAddress": "10.0.0.0",
"maskBits": 24,
"note": "app-uat",
"color": "blue"
}
]
}
Settings
| Setting |
Default |
Description |
network.subnetPreview.configGlob |
docs/subnet-config-*.json |
Primary workspace glob |
network.subnetPreview.configFallbackGlobs |
["**/*subnet-config*.json"] |
Extra globs if primary finds nothing |
network.subnetPreview.promptWhenMultiple |
false |
Show picker when multiple configs match |
network.subnetPreview.openEmptyWhenMissing |
true |
Open empty calculator when no config file exists |
Privacy and data handling
| Data |
Handled how |
| Telemetry |
None. |
| Workspace JSON |
Read locally via VS Code API only. |
| Preview URL |
Built in-process; opens https://v0-subnets.vercel.app/?config=<base64>. |
| Third party |
v0-subnets receives your layout (CIDRs, notes) in the URL query when the page loads. Avoid personal data in note fields. |
| PII |
Extension does not collect or store PII. |
Security
- Config paths must stay inside the workspace folder.
- JSON is validated (v0-subnets shape) and size-capped (1 MiB).
- Preview URL host is fixed to
v0-subnets.vercel.app only.
- Error toasts are generic (no filesystem paths).
Requirements
- VS Code 1.80+ or Cursor with Simple Browser support.
- A workspace folder open (not a single loose file).
Publisher
newbmiao · Extension ID newbmiao.subnets-preview
License
MIT