npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apmantza/greedysearch-pi

v1.8.10

Published

Headless multi-engine AI search (Perplexity, Bing Copilot, Google AI) via browser automation -- NO API KEYS needed. Extracts answers with sources, optional synthesis. Grounded AI answers from real browser interactions.

Readme

GreedySearch for Pi

GreedySearch

Multi-engine AI web search for Pi via browser automation.

  • No API keys
  • Real browser results (Perplexity, Bing Copilot, Google AI)
  • Optional Gemini synthesis with source grounding
  • Chrome runs headless by default — no window, purely background

Install

pi install npm:@apmantza/greedysearch-pi

Or from git:

pi install git:github.com/apmantza/GreedySearch-pi

Tools

  • greedy_search — multi-engine AI web search
  • websearch — lightweight DuckDuckGo/Brave search (via pi-webaio)
  • webfetch / webpull — page fetching and site crawling (via pi-webaio)

Quick usage

greedy_search({ query: "React 19 changes" });
greedy_search({ query: "Prisma vs Drizzle", engine: "all", depth: "fast" });
greedy_search({
  query: "Best auth architecture 2026",
  engine: "all",
  depth: "deep",
});
// Headless is the default — no window. To force visible Chrome:
greedy_search({ query: "Bing captcha setup", engine: "bing", visible: true });

Parameters (greedy_search)

  • query (required)
  • engine: all (default), perplexity, bing, google, gemini
  • depth: standard (default), fast, deep
  • fullAnswer: return full single-engine output instead of preview
  • headless: set to false to show Chrome window (default: true)
  • visible / alwaysVisible: set to true to always use visible Chrome for this search

Environment variables

| Variable | Default | Description | | ------------------------------------ | ------------- | ------------------------------------------------------------- | | GREEDY_SEARCH_VISIBLE | (unset) | Set to 1 to show Chrome window instead of headless | | GREEDY_SEARCH_ALWAYS_VISIBLE | (unset) | Set to 1 to force visible Chrome for all GreedySearch runs | | GREEDY_SEARCH_IDLE_TIMEOUT_MINUTES | 5 | Minutes of inactivity before auto-killing GreedySearch Chrome | | GREEDY_SEARCH_LOCALE | en | Default result language (en, de, fr, es, ja, etc.) | | CHROME_PATH | auto-detected | Path to Chrome/Chromium executable |

Depth modes

  • fast - quickest, no synthesis/source fetching
  • standard - balanced default for engine: "all" (synthesis + fetched sources)
  • deep - strongest grounding and confidence metadata

Runtime commands

Inside Pi, prefer the extension commands (no package path needed):

/greedy-visible      # launch visible Chrome for captcha/login/cookie setup
/greedy-status       # show GreedySearch Chrome status
/greedy-kill         # stop GreedySearch Chrome
/set-greedy-locale   # set default result language (de, fr, es, ja, etc.)

Git install path:

GS=~/.pi/agent/git/github.com/apmantza/GreedySearch-pi
node "$GS/bin/launch.mjs" --status
node "$GS/bin/visible.mjs"          # visible mode
node "$GS/bin/visible.mjs" --kill   # strong visible/port cleanup
node "$GS/bin/kill-visible.mjs"     # same as visible.mjs --kill
node "$GS/bin/cdp-visible.mjs" list # safe CDP: GreedySearch visible Chrome only
node "$GS/bin/cdp-headless.mjs" list # safe CDP: GreedySearch headless Chrome only
node "$GS/bin/cdp-greedy.mjs" list  # safe CDP: any GreedySearch Chrome mode

npm global install path:

GS="$(npm root -g)/@apmantza/greedysearch-pi"
node "$GS/bin/launch.mjs" --status
node "$GS/bin/visible.mjs"
node "$GS/bin/visible.mjs" --kill
node "$GS/bin/kill-visible.mjs"
node "$GS/bin/cdp-visible.mjs" list
node "$GS/bin/cdp-headless.mjs" list
node "$GS/bin/cdp-greedy.mjs" list

Chrome is auto-cleaned after 5 min idle. Override with GREEDY_SEARCH_IDLE_TIMEOUT_MINUTES=10 or disable with 0.

CDP safety: use cdp-visible.mjs, cdp-headless.mjs, or cdp-greedy.mjs for debugging. They always set CDP_PROFILE_DIR to the dedicated GreedySearch Chrome profile and never fall back to your main Chrome session. Avoid calling raw bin/cdp.mjs manually unless you explicitly set CDP_PROFILE_DIR.

Requirements

  • Chrome
  • Node.js 20.11.0+

Known engine quirks

Bing Copilot

Bing Copilot detects headless Chrome and sandboxes all AI responses inside nested iframes (copilot.microsoft.comcopilot.funblob:). In this mode the copy button is hidden and the Cloudflare Turnstile challenge blocks content delivery. The clipboard-based extraction cannot work.

Auto-recovery: When Bing or Perplexity fails with a headless-only extraction error (clipboard, verification, timeout, Cloudflare), GreedySearch automatically switches to visible Chrome and retries, even in fast mode. If manual verification is required, the visible browser is left open and the tool returns instructions to solve the challenge and rerun the same search.

If you prefer to skip the auto-recovery delay, launch visible Chrome ahead of time with /greedy-visible, set GREEDY_SEARCH_ALWAYS_VISIBLE=1, or pass visible: true to greedy_search.

Anti-detection

Headless Chrome auto-injects stealth patches before any page JavaScript runs:

  • navigator.webdriver hidden, plugins/languages faked, window.chrome shimmed
  • WebGL vendor spoofed (Intel Iris), realistic hardware concurrency / memory
  • CDP automation markers deleted, requestAnimationFrame kept alive
  • Human-like click simulation with coordinate jitter and variable delays

This bypasses casual bot detection (basic navigator.webdriver checks) but does not defeat commercial anti-bot services (DataDome, PerimeterX, Kasada). Bing Copilot specifically detects headless and sandboxes responses behind Cloudflare Turnstile — see Known engine quirks for the auto-recovery mechanism.

When using depth: "standard" or depth: "deep", source content is fetched and synthesized:

  • Reddit — Uses Reddit's public .json API for posts and comments (no scraping)
  • GitHub — Uses GitHub REST API for repos, READMEs, and file trees
  • General web — Mozilla Readability extraction with browser fallback for bot-blocked pages
  • Metadata — title, author/byline, site name, publish date, language, excerpt

Project layout

  • bin/ — runtime CLIs (search.mjs, launch.mjs, launch-visible.mjs, visible.mjs, kill-visible.mjs, safe CDP wrappers, cdp.mjs)
  • extractors/ — engine-specific automation + stealth/consent handling
  • src/ — search pipeline, chrome management, source fetching, formatting
  • skills/ — Pi skill metadata

Testing

Cross-platform test runner (Windows + Unix):

npm test              # run all tests
npm run test:quick    # skip slow tests
npm run test:smoke    # basic health check

Full bash test suite (Unix only):

npm run test:bash           # comprehensive tests
./test.sh parallel          # race condition tests
./test.sh flags             # flag/option tests

Changelog

See CHANGELOG.md.

License

MIT