A GitHub Copilot extension that provides web browsing capabilities using Plasmate - the browser engine for AI agents.
Plasmate converts HTML to a Semantic Object Model (SOM), providing 10-100x token compression compared to raw HTML. This makes it ideal for AI agents that need to efficiently browse and understand web content.
-
Plasmate CLI - Install from plasmate.app or build from source:
# From the Plasmate repository cargo build --release -
Node.js 18+
# Clone the repository
git clone https://github.com/plasmate/copilot-plasmate.git
cd copilot-plasmate
# Install dependencies
npm install
# Build
npm run build- Go to GitHub Copilot Extensions
- Click "Add Extension"
- Select "Local Extension"
- Point to this directory
Or use the GitHub CLI:
gh copilot extension add ./copilot-extension.jsonFetch a web page and return structured content using Plasmate's Semantic Object Model.
@plasmate fetch https://docs.github.com/en/copilot
Parameters:
url(required) - The URL to fetchformat- Output format:som(default),text, orjsonselector- CSS selector to extract specific elements
Extract readable text content from a web page, similar to reader mode.
@plasmate extract text from https://blog.example.com/article
Parameters:
url(required) - The URL to extract text fromselector- CSS selector to limit scopemaxLength- Maximum text length in characters
Extract all links from a web page with metadata.
@plasmate get all links from https://docs.example.com
Parameters:
url(required) - The URL to extract links fromselector- CSS selector to limit scopepattern- Regex pattern to filter linksinternalOnly- Only return same-domain links
Search the web and optionally fetch result pages.
@plasmate search "rust async web scraping"
Parameters:
query(required) - Search querymaxResults- Maximum results (default: 5, max: 10)fetchResults- Fetch and parse each result page
Set these environment variables to customize behavior:
| Variable | Description | Default |
|---|---|---|
PLASMATE_PATH |
Path to plasmate binary | plasmate |
PLASMATE_TIMEOUT |
Request timeout (ms) | 30000 |
DEBUG |
Enable debug logging | false |
@plasmate fetch the React hooks documentation
I'll help you understand React hooks. Let me fetch the documentation.
@plasmate search "best practices for TypeScript error handling" and summarize
I'll search and compile information about TypeScript error handling best practices.
@plasmate get all internal links from https://api.example.com/docs that contain "/v2/"
I'll extract the v2 API documentation structure for you.
@plasmate extract the main text from https://blog.example.com/post/123
Let me get the article content for you.
# Install dependencies
npm install
# Run in development mode
npm run dev
# Type check
npm run typecheck
# Lint
npm run lint
# Build for production
npm run build-
Copilot invokes a tool - When you ask Copilot to browse the web, it calls one of the Plasmate tools
-
Plasmate fetches the page - The extension invokes the Plasmate CLI to fetch and parse the web page
-
HTML becomes SOM - Plasmate converts the HTML to a Semantic Object Model, preserving meaning while dramatically reducing tokens
-
Copilot receives structured data - The compressed, semantic representation is returned to Copilot for analysis
GitHub Copilot
│
▼
┌─────────────────────┐
│ Copilot Extension │
│ (This package) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Plasmate CLI │
│ (Browser engine) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Web Page (HTML) │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Semantic Object │
│ Model (10-100x │
│ compression) │
└─────────────────────┘
MIT