Skip to content

VS Code Extension

The Figram VS Code extension provides a rich editing experience for YAML diagram files with autocompletion, real-time validation, and integrated server management.

Features

Autocompletion

Get intelligent suggestions as you type:

  • provider: - Suggests aws, azure, gcp with icon counts
  • kind: - Suggests available icons filtered by the node’s provider
nodes:
- id: my-ec2
provider: aws # Autocomplete: aws (873 icons), azure (636 icons), gcp (216 icons)
kind: compute.ec2 # Autocomplete: Only AWS icons when provider is 'aws'

Diagnostics

Real-time validation highlights errors and warnings:

IssueSeverityExample
Invalid providerErrorprovider: amazon → “Invalid provider ‘amazon’. Expected: aws, azure, gcp”
Unknown kindWarningkind: invalid.thing → “Unknown kind ‘invalid.thing’ for provider ‘aws‘“
Missing required fieldsWarningMissing version or docId
Duplicate node IDsErrorTwo nodes with same id
YAML syntax errorsErrorInvalid YAML structure

Snippets

Quickly scaffold diagrams with built-in snippets:

PrefixDescription
figram-diagram, diagramBasic diagram template
figram-vpc, aws-vpcAWS VPC architecture template
figram-node-aws, node-awsAWS node
figram-node-gcp, node-gcpGCP node
figram-node-azure, node-azureAzure node
figram-container, figram-sectionContainer/Section node with width and height
figram-node-parent, node-childNode inside a container (with parent)
figram-edge, edgeEdge connecting two nodes
figram-edge-simple, edge-simpleSimple edge without label
figram-edges, edgesEdges section with one edge
figram-icons, iconsCustom icons section
figram-icons-file, icons-filefigram-icons.yaml file template
figram-three-tier, three-tierThree-tier architecture template

Server Management

Control the Figram WebSocket server directly from VS Code:

  • Status Bar - Shows server state (stopped/running) and port
  • Commands:
    • figram: Start Serve - Start the WebSocket server
    • figram: Stop Serve - Stop the server
    • figram: Restart Serve - Restart the server

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for “figram”
  4. Click Install

From VSIX

Terminal window
# Build the extension
cd packages/vscode
bun run package
# Install the generated .vsix file
code --install-extension figram-vscode-*.vsix

Configuration

Configure the extension in VS Code settings (settings.json):

{
// CLI command (default: auto-detect or npx figram@latest)
"figram.cli.command": ["bunx", "figram"],
// Server settings
"figram.serve.host": "127.0.0.1",
"figram.serve.port": 3456,
"figram.serve.allowRemote": false,
"figram.serve.secret": "",
"figram.serve.noWatch": false,
"figram.serve.iconsPath": "",
// Diagnostics settings
"figram.diagnostics.enabled": true,
"figram.diagnostics.debounceMs": 300
}

Commands

CommandDescription
figram: Init diagram.yamlCreate a new diagram template
figram: Build JSON (current file)Convert current YAML to JSON
figram: Start ServeStart WebSocket server
figram: Stop ServeStop WebSocket server
figram: Restart ServeRestart WebSocket server
figram: Serve ActionsQuick pick menu for server actions
figram: Show OutputShow extension output channel
figram: Refresh DiagnosticsForce re-analyze current file

Supported Files

The extension activates for:

  • diagram.yaml / diagram.yml
  • *.figram.yaml / *.figram.yml
  • figram-icons.yaml / figram-icons.yml
  • Any YAML file containing docId: and nodes: