@narumitw/pi-web-search
v0.1.3
Published
Pi package that adds a web_search tool backed by Brave Search or DuckDuckGo HTML.
Maintainers
Readme
pi-web-search
A shareable pi package that adds a web_search tool.
The tool searches the web and returns ranked results with titles, URLs, and snippets. It can use Brave Search when an API key is available, or DuckDuckGo HTML without an API key.
Install
Install directly from git:
pi install git:github.com/narumiruna/pi-web-searchOr install from a local checkout:
pi install /absolute/path/to/pi-web-search
# or, for this project only:
pi install -l ./pi-web-searchIf published to npm, install with:
pi install npm:@narumitw/pi-web-searchTo try it for one run without adding it to settings:
pi -e git:github.com/narumiruna/pi-web-search
# or
pi -e /absolute/path/to/pi-web-searchSecurity note: pi packages can execute code with your user permissions. Review packages before installing them.
Tool
web_search searches the web and returns source URLs with snippets.
Parameters:
query(string, required): search querymax_results(integer, optional): number of results, 1-10, defaults to 5provider(auto|brave|duckduckgo, optional): defaults toautosafe_search(boolean, optional): defaults totrue
Providers
auto: uses Brave Search whenBRAVE_SEARCH_API_KEYis set; otherwise uses DuckDuckGo HTML.brave: uses the Brave Search API and requires:export BRAVE_SEARCH_API_KEY=...duckduckgo: no API key required; scrapes DuckDuckGo's HTML endpoint, so it may be less reliable than an API-backed provider.
Example prompt
Search the web for the latest pi-coding-agent extension docs and summarize the top sources.Package layout
This repository is a pi package. package.json declares:
{
"keywords": ["pi-package"],
"pi": {
"extensions": ["./extensions"]
}
}The extension entrypoint is:
extensions/web-search.tsPi loads TypeScript extensions directly, so there is no build step.
Publishing to npm
Update
package.jsonmetadata (name,version, repository fields if needed).Preview the npm tarball:
npm pack --dry-runPublish:
npm publish
After publishing, users can run:
pi install npm:@narumitw/pi-web-search