Skip to content

skatkov/opencode-lightpanda

Repository files navigation

opencode-lightpanda

A Lightpanda browser plugin/tool for OpenCode. It is like WebFetch tool on steroids.

Features

  • Headless
  • 10x faster than headless Chrome, 16x less memory
  • Returns markdown pages without ads or clutter
  • Can also extract JSON data
  • Handles JS-heavy websites like a pro

Requirements

Install

Install Lightpanda, then install the plugin globally:

opencode plugin -g opencode-lightpanda@latest

To update an existing installation:

opencode plugin -g -f opencode-lightpanda@latest

Quit and restart OpenCode.

If OpenCode cannot find Lightpanda, start it with LIGHTPANDA_BIN set to the executable's absolute path.

Usage

Starts a fresh Lightpanda process for every call, so cookies and browser state are not retained.

lightpanda({
  url: "https://example.com",
  format: "markdown",
  timeout: 30,
})

Available formats are markdown, json, and semantic_tree.

Local Development

bun install
bun run check
bun test

Load the checkout directly by adding it to ~/.config/opencode/opencode.json:

{
  "plugin": ["file:///absolute/path/to/opencode-lightpanda/lightpanda.ts"]
}

Config

The tools can be controlled independently:

{
  "permission": {
    "webfetch": "deny",
    "lightpanda": "allow"
  }
}

About

A Lightpanda browser plugin/tool for OpenCode.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages