Plasmate - Web Browser for AI

April 11, 2026 ยท View on GitHub

Fetch and view web pages as Semantic Object Model (SOM) directly in VS Code. Plasmate is the browser engine for AI agents - it transforms HTML into structured, token-efficient JSON that's perfect for AI consumption.

Features

  • Fetch Page as SOM - Convert any web page to structured JSON with semantic information
  • Fetch as Text - Extract readable text content from web pages
  • Fetch as Markdown - Convert web pages to clean Markdown format
  • Fetch from Selection - Select a URL in your code and fetch it instantly
  • Interactive SOM Viewer - Custom webview with syntax highlighting, collapsible regions, and statistics
  • Copy Element IDs - Click any element ID in the SOM viewer to copy it

Fetch Page Command

SOM Viewer

Requirements

  • Plasmate CLI must be installed and available in your PATH
  • VS Code 1.85.0 or higher

Installing Plasmate

# Using cargo
cargo install plasmate

# Or build from source
git clone https://github.com/nicholasberlin/plasmate
cd plasmate
cargo build --release

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Plasmate"
  4. Click Install

From VSIX

  1. Download the .vsix file from Releases
  2. In VS Code, go to Extensions
  3. Click the "..." menu and select "Install from VSIX..."
  4. Select the downloaded file

Usage

Commands

Access commands via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

CommandDescription
Plasmate: Fetch Page as SOMPrompt for URL and display as structured JSON
Plasmate: Fetch Page as TextPrompt for URL and display as plain text
Plasmate: Fetch Page as MarkdownPrompt for URL and display as Markdown
Plasmate: Fetch URL from SelectionFetch the URL currently selected in the editor

Keyboard Shortcuts

ShortcutCommand
Ctrl+Shift+F / Cmd+Shift+FFetch Page as SOM
Ctrl+Shift+U / Cmd+Shift+UFetch URL from Selection

Context Menu

Right-click on selected text containing a URL to see "Plasmate: Fetch URL from Selection" in the context menu.

Configuration

Configure Plasmate in VS Code Settings (Ctrl+, / Cmd+,):

SettingDescriptionDefault
plasmate.executablePathPath to the plasmate executable"plasmate"
plasmate.timeoutTimeout in milliseconds for fetching pages30000
plasmate.defaultFormatDefault output format (som, text, markdown)"som"
plasmate.showStatsBarShow statistics bar in SOM viewertrue
plasmate.customHeadersCustom HTTP headers to send with requests{}

Example Configuration

{
  "plasmate.executablePath": "/usr/local/bin/plasmate",
  "plasmate.timeout": 60000,
  "plasmate.defaultFormat": "som",
  "plasmate.customHeaders": {
    "Authorization": "Bearer your-token"
  }
}

SOM Viewer Features

The custom SOM viewer provides:

  • Syntax Highlighting - JSON keys, strings, numbers, and booleans are color-coded
  • Collapsible Regions - Click the arrow to collapse/expand objects and arrays
  • Search - Filter and highlight content with the search box
  • Statistics Bar - View element count, text nodes, interactive elements, and data size
  • Copy Element IDs - Click any element ID to copy it to clipboard
  • Open in Editor - Open the raw JSON in a standard VS Code editor

What is SOM?

The Semantic Object Model (SOM) is a structured JSON representation of web pages designed for AI agents. It:

  • Reduces token usage by up to 16x compared to raw HTML
  • Preserves semantic information about page structure
  • Identifies interactive elements (links, buttons, forms)
  • Provides stable element IDs for agent interactions

Troubleshooting

"Plasmate executable not found"

Make sure plasmate is installed and in your PATH:

which plasmate

Or configure the full path in settings:

{
  "plasmate.executablePath": "/path/to/plasmate"
}

Timeout errors

Increase the timeout setting:

{
  "plasmate.timeout": 60000
}

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

Publishing

The extension auto-publishes to VS Code Marketplace when a GitHub Release is created.

Setup (one-time):

  1. Create publisher "plasmate" at https://marketplace.visualstudio.com/manage/publishers/
  2. Create a PAT at https://dev.azure.com/ with Marketplace (Publish) scope
  3. Add VSCE_PAT secret to GitHub repo settings

To release:

# Bump version in package.json, then:
git tag v0.1.1
git push --tags
gh release create v0.1.1 --generate-notes

License

MIT License - see LICENSE for details.