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

@benvargas/pi-firecrawl

v1.0.0

Published

Firecrawl tools for pi - Web scraping, crawling, and data extraction via Firecrawl's REST API

Readme

@benvargas/pi-firecrawl

Firecrawl tools for pi, the AI coding agent.

Provides focused Firecrawl REST API access for:

  • firecrawl_scrape
  • firecrawl_map
  • firecrawl_search

Features

  • Scrape (firecrawl_scrape) — Scrape a single URL
  • Map (firecrawl_map) — Discover URLs on a site
  • Search (firecrawl_search) — Search the web and optionally scrape results
  • Tool allowlist — Enable/disable tools via tools config
  • Configurable limits — Client-side truncation with configurable max bytes/lines
  • Multiple config sources — JSON config, environment variables, or CLI flags
  • Direct REST API — Simple, fast, no protocol overhead

Installation

pi install npm:@benvargas/pi-firecrawl

Or try without installing:

pi -e npm:@benvargas/pi-firecrawl

Setup

Get an API key from firecrawl.dev and configure it using one of these methods.

Option 1: Environment Variable

export FIRECRAWL_API_KEY="your_firecrawl_api_key"
pi

Option 2: JSON Config

Create ~/.pi/agent/extensions/firecrawl.json:

{
  "url": "https://api.firecrawl.dev",
  "apiKey": "your_firecrawl_api_key",
  "headers": null,
  "tools": ["firecrawl_scrape", "firecrawl_map", "firecrawl_search"],
  "timeoutMs": 30000,
  "maxBytes": 51200,
  "maxLines": 2000
}

If you want to disable search, remove it from the tools array.

Option 3: CLI Flags

pi --firecrawl-api-key=your_firecrawl_api_key

Usage

Once installed, the AI can use these tools when appropriate:

"Scrape https://example.com and get the main content"
"Map docs.example.com and list likely API pages"
"Search for React tutorials and summarize top results"

Tools

firecrawl_scrape

Scrape a single URL.

| Parameter | Description | Default | |-----------|-------------|---------| | url | Target URL (required) | — | | formats | Output formats array | — | | onlyMainContent | Extract only main content | — | | waitFor | Wait time in milliseconds | — | | timeout | Request timeout | — | | mobile | Use mobile viewport | — | | includeTags | Tags to include | — | | excludeTags | Tags to exclude | — | | skipTlsVerification | Skip TLS verification | — | | piMaxBytes | Client-side max bytes override | — | | piMaxLines | Client-side max lines override | — |

firecrawl_map

Discover URLs on a site.

| Parameter | Description | Default | |-----------|-------------|---------| | url | Base URL to map (required) | — | | search | Search query to filter URLs | — | | sitemap | Sitemap handling mode (include, skip, only) | — | | includeSubdomains | Include subdomains | — | | limit | Maximum URLs to return | — | | ignoreQueryParameters | Ignore query parameters | — | | piMaxBytes | Client-side max bytes override | — | | piMaxLines | Client-side max lines override | — |

firecrawl_search

Search the web and optionally scrape results.

| Parameter | Description | Default | |-----------|-------------|---------| | query | Search query (required) | — | | limit | Maximum results | — | | lang | Language code | — | | country | Country code | — | | scrapeOptions | Scrape options for results | — | | piMaxBytes | Client-side max bytes override | — | | piMaxLines | Client-side max lines override | — |

Configuration

Config File Locations

Config files are loaded in order (first match wins):

  1. Path from --firecrawl-config flag
  2. Path from FIRECRAWL_CONFIG environment variable
  3. ./.pi/extensions/firecrawl.json (project-level)
  4. ~/.pi/agent/extensions/firecrawl.json (global)

If none exist, the extension writes a default config to the global path with apiKey set to null.

Config File Format

{
  "url": "https://api.firecrawl.dev",
  "apiKey": null,
  "headers": null,
  "tools": ["firecrawl_scrape", "firecrawl_map", "firecrawl_search"],
  "timeoutMs": 30000,
  "maxBytes": 51200,
  "maxLines": 2000
}

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | FIRECRAWL_URL | API base URL | https://api.firecrawl.dev | | FIRECRAWL_API_KEY | Firecrawl API key (Bearer token) | — | | FIRECRAWL_TIMEOUT_MS | Request timeout (ms) | 30000 | | FIRECRAWL_TOOLS | Comma-separated tool list | — | | FIRECRAWL_MAX_BYTES | Max bytes to keep from output | 51200 | | FIRECRAWL_MAX_LINES | Max lines to keep from output | 2000 | | FIRECRAWL_CONFIG | Path to JSON config file | — |

CLI Flags

| Flag | Description | |------|-------------| | --firecrawl-url | Override the Firecrawl API base URL | | --firecrawl-api-key | Firecrawl API key | | --firecrawl-timeout-ms | HTTP timeout (milliseconds) | | --firecrawl-config | Path to JSON config file | | --firecrawl-tools | Comma-separated tool list | | --firecrawl-max-bytes | Max bytes to keep from output | | --firecrawl-max-lines | Max lines to keep from output |

Output Truncation

Tool output is automatically truncated to prevent context window overflow:

  • Default limits: 51200 bytes and 2000 lines
  • Client overrides: models can request piMaxBytes/piMaxLines (clamped to configured max)
  • Temp files: when truncated, full output is saved to a temp file with the path included in the response

Requirements

Uninstall

pi remove npm:@benvargas/pi-firecrawl

License

MIT