pi-plasmate

March 29, 2026 ยท View on GitHub

A Pi coding agent extension that adds web browsing via Plasmate SOM (Semantic Object Model).

When your coding agent needs to read documentation, check a reference page, or understand a website, it gets structured semantic content instead of raw HTML. 4x fewer tokens, explicit element roles, and available actions.

Installation

Add to your ~/.pi/agent/settings.json:

{
  "packages": ["git:github.com/plasmate-labs/pi-plasmate"]
}

Option 2: Manual

git clone https://github.com/plasmate-labs/pi-plasmate ~/.pi/agent/extensions/pi-plasmate
cd ~/.pi/agent/extensions/pi-plasmate
npm install

Prerequisites

Install Plasmate:

npm install -g plasmate

Tools registered

browse_web

Fetch any URL and return structured SOM content.

> Read the React documentation at https://react.dev/learn

The agent calls browse_web with the URL and gets back structured regions, typed elements, and available actions. Set extract_text: true for a compact text representation.

browse_web_compile

Compile a local HTML file to SOM without network requests.

> Analyze the structure of ./build/index.html

Useful when working with local HTML files in a project.

/plasmate

Show extension status: CLI version, cache configuration, available tools.

Configuration

Environment VariableDescription
PLASMATE_CACHE_API_KEYSOM Cache API key for faster cached lookups (optional)
PLASMATE_CACHE_URLCache base URL (default: https://cache.plasmate.app)

Without a cache key, the extension uses the local plasmate CLI directly.

How it works

  1. Agent decides it needs to read a web page
  2. Calls the browse_web tool with the URL
  3. Extension fetches the page via SOM Cache API (if configured) or local Plasmate CLI
  4. Returns structured SOM JSON with page regions, element roles, and metadata
  5. Agent reasons over 4x fewer tokens with explicit semantic structure

License

Apache 2.0