pi-web-surf

Pi extension: internet search and web scraping via ketch CLI. Gives pi the ability to search DuckDuckGo/Brave/SearXNG/Exa and scrape any URL to clean markdown.

Packages

Package details

extension

Install pi-web-surf from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-web-surf
Package
pi-web-surf
Version
1.0.1
Published
Jul 9, 2026
Downloads
not available
Author
aptha
License
MIT
Types
extension
Size
9.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-web-surf

A pi extension that gives pi internet access. It registers two tools — internet_search and internet_scrape — backed by ketch, a fast Go CLI for web search and scraping.

Keywords: pi extension, pi coding agent, internet search, web search, web scraping, ketch, DuckDuckGo, Brave, SearXNG, Exa, AI agent tools, coding assistant

What is ketch

ketch is a single statically-linked Go binary (~4MB) that does web search, code search, library docs lookup, URL scraping, and site crawling. It was built for AI agents — every command outputs --json. No daemon, no runtime, no API key needed (DuckDuckGo works out of the box). Brave, SearXNG, and Exa backends are available if you have keys.

This extension wraps ketch's search and scrape commands so pi can call them as native tools.

Tools

Tool What it does
internet_search Calls ketch search --json. Returns ranked results: title, URL, and description. Accepts query (required) and limit (optional, default 5, max 10).
internet_scrape Calls ketch scrape --json. Fetches a URL and extracts clean markdown. Use after a search to read a page's full content. Accepts url (required), raw (optional), and maxChars (optional).

Usage

The model calls these tools when it needs web access. If it reaches for curl or bash to fetch URLs, tell it:

Use internet_search for web lookups. Use internet_scrape to fetch pages.

Explicit invocation also works:

Use internet_search to find the latest Go release date.

Setup

Install ketch:

brew install 1broseidon/tap/ketch   # macOS
go install github.com/1broseidon/ketch@latest   # any platform

Set the free DuckDuckGo backend:

ketch config set backend ddg

Install pi-web-surf:

git clone https://github.com/yanralapdy/pi-web-surf ~/.pi/agent/extensions/pi-web-surf

Run /reload in pi.

Test

npx tsx --test index.test.ts

Files

File Purpose
helpers.ts Pure functions: formatResults, formatScrape, checkKetch, runKetch. Zero dependencies.
index.ts Extension entry. Registers the two tools with pi.
index.test.ts 10 tests: result formatting, edge cases, and ketch detection.

License

MIT