pi-fetch
Efficient web fetch tool for Pi
Package details
Install pi-fetch from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-fetch- Package
pi-fetch- Version
2.0.0- Published
- Apr 12, 2026
- Downloads
- 328/mo · 19/wk
- Author
- kotarac
- License
- GPL-2.0-only
- Types
- extension
- Size
- 37.6 KB
- Dependencies
- 1 dependency · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions/fetch.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-fetch
Efficient web fetch tool for Pi.
Adds a fetch tool that retrieves a URL and returns the page content, truncated to 50KB / 2000 lines.
What it does
- Fetches
http(s)URLs. - Always asks for HTML (
Accept: text/html, application/xhtml+xml, */*). Only some sites support returningtext/markdown, and converting HTML generally does a better job cleaning up real-world pages. - Converts HTML pages to clean, LLM-friendly text.
- If the response isn’t HTML, it returns textual content as-is; binary content is saved to a temp file.
Install
This repo is a Pi package (see package.json#pi.extensions). Once installed, Pi auto-discovers and loads the extension.
Global install (writes to ~/.pi/agent/settings.json):
- From GitHub:
pi install git:github.com/kotarac/pi-fetch
- From npm:
pi install npm:pi-fetch
Project-local install (writes to .pi/settings.json in your project):
- From GitHub:
pi install -l git:github.com/kotarac/pi-fetch
- From npm:
pi install -l npm:pi-fetch
Try without installing
Try the package for a single run:
- From GitHub:
pi -e git:github.com/kotarac/pi-fetch
- From npm:
pi -e npm:pi-fetch
Notes
- Requires
curlinstalled and available inPATH. - Output is truncated to keep LLM context usage predictable.
- The implementation is intentionally pragmatic and may look a bit ugly. It was largely generated with an LLM and optimized for “works reliably” over elegance.
- The tool prioritizes efficiency and keeping output compact/predictable for LLM context, even if that means it won’t choose the best possible representation for every site.
- Extensions execute with full system permissions. Only install code you trust.
License
GPL-2.0-only