From cf26efa1556e67959b183b6a43d97da6c29e53bd Mon Sep 17 00:00:00 2001 From: Seth Etter Date: Sun, 30 Aug 2026 21:14:46 -0500 Subject: [PATCH] pi: add web-access skill (curl-based search/fetch, no API keys) --- agent/skills/web-access/SKILL.md | 33 ++++++++++++++++++++++++++++++++ sync.sh | 1 + 2 files changed, 34 insertions(+) create mode 100644 agent/skills/web-access/SKILL.md diff --git a/agent/skills/web-access/SKILL.md b/agent/skills/web-access/SKILL.md new file mode 100644 index 0000000..98ebfc9 --- /dev/null +++ b/agent/skills/web-access/SKILL.md @@ -0,0 +1,33 @@ +--- +name: web-access +description: Key-free web search and page fetching using curl. Use when you need to search the web, look up documentation, or read a web page. No API keys or external services required. +--- + +# Web Access + +Search and fetch directly via bash. No API keys or services. Prefer these over the firecrawl MCP or any key-based search API. + +## Search — Bing RSS + +```bash +Q=$(printf %s "search terms here" | jq -sRr @uri) +curl -s -m 15 "https://www.bing.com/search?q=$Q&format=rss" \ + | xmllint --xpath '//item' - \ + | sed -E 's::\n:g; s:: \| :g; s:<[^>]+>::g' +``` + +Each result: `title | URL | snippet`. If it returns nothing, the endpoint may be rate-limited — retry once, then tell the user. + +## Fetch a page — curl + pandoc + +```bash +curl -sL -m 20 -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125 Safari/537.36" "URL" \ + | pandoc -f html -t gfm-raw_html +``` + +`-L` follows redirects; the UA string avoids bot blocks. Pages include nav/TOC boilerplate — trim with `sed -n '/start-pattern/,$p'` or `head`/`tail` around the main content before quoting it. + +## Notes + +- DuckDuckGo's `html.duckduckgo.com` and `lite.duckduckgo.com` endpoints are bot-challenged from this network — don't use them. +- For JSON APIs, plain `curl` + `jq` is all you need. diff --git a/sync.sh b/sync.sh index 54ec445..a725a19 100755 --- a/sync.sh +++ b/sync.sh @@ -26,6 +26,7 @@ function link_configs { mappings["agent/AGENTS.md"]="$HOME/.pi/agent/AGENTS.md" mappings["agent/extensions/notify.ts"]="$HOME/.pi/agent/extensions/notify.ts" mappings["agent/extensions/notify-focus.sh"]="$HOME/.pi/agent/extensions/notify-focus.sh" + mappings["agent/skills/web-access"]="$HOME/.pi/agent/skills/web-access" for key in "${!mappings[@]}"; do source="${key}" -- 2.51.2