pi-lab-webfetch

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

pi-lab

A collection of pi coding agent extensions, packaged for pi install.

Packages

Package Description Version
@pi-lab/permissions Permission system — enforce allow / deny / ask rules on tool calls NPM Version
@pi-lab/webfetch Fetch URL and get clean Markdown; includes X/Twitter fetch optimizations NPM Version
@pi-lab/websearch Search the web with Exa NPM Version
@pi-lab/xsearch Search X/Twitter with xAI Grok and citation URLs NPM Version
@pi-lab/grok-build Use local Grok Build for image/video and richer X search/thread reading NPM Version
@pi-lab/env Load .env into pi sessions NPM Version
@pi-lab/input-history recalls inputs across all sessions in the same project NPM Version
@pi-lab/notify Desktop notifications NPM Version

Install

Each package can be installed individually:

pi install npm:@pi-lab/permissions

Or pin to a git ref:

pi install git:github.com/anthod0/pi-lab@main

X/Twitter tool comparison

All three tools can be useful, depending on the task:

Tool Best for Notes
grok_build Reading X posts/threads with rich context; natural-language X search Usually gives the most complete context, including replies, quotes, media details, views, and bookmarks. Native X search typically returns about 10 posts per search call.
xsearch Broader X search with many citation URLs Uses the xAI API-key workflow and is better when you need more search results/citations rather than deep thread context.
webfetch Fast, simple fetch of a single X post body Usually faster and more deterministic, but returns less context than Grok Build.

Development

pnpm install

# type-check all packages
pnpm typecheck

# test an extension locally without installing
pi -e ./packages/<name>/src/index.ts

# test the compiled output
cd packages/<name>
pnpm build
pi -e ./dist/index.mjs