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

@narumitw/pi-google-genai

v0.14.1

Published

Pi extension that exposes Google GenAI search, maps, and URL context grounding tools.

Downloads

733

Readme

🔎 pi-google-genai — Google GenAI grounding tools for Pi

npm Pi extension License: MIT

@narumitw/pi-google-genai exposes Google GenAI Interactions grounding tools to Pi.

✨ Features

  • google_search for Google Search grounding.
  • google_maps for Google Maps/place grounding.
  • google_url_context for asking about specific http:// or https:// URLs.
  • Uses Pi auth for Google (/login google, auth.json, runtime key, or GEMINI_API_KEY) unless google-genai.json contains a literal apiKey.
  • Lets /google-genai tools persist which of the three tools are active.
  • Truncates large outputs and writes the full raw interaction response to a private temp file only when truncation happens.

📦 Install

pi install npm:@narumitw/pi-google-genai

Try without installing permanently:

pi -e npm:@narumitw/pi-google-genai

Try from this repository:

pi -e ./extensions/pi-google-genai

⚙️ Configuration

Config lives at:

${PI_CODING_AGENT_DIR:-~/.pi/agent}/google-genai.json

Example:

{
  "apiKey": "YOUR_GOOGLE_API_KEY",
  "model": "gemini-3.5-flash",
  "apiUrl": "https://generativelanguage.googleapis.com/v1beta/interactions",
  "timeoutMs": 60000,
  "tools": ["google_search", "google_maps", "google_url_context"]
}

The file is written as 0600.

Timeout precedence is: per-call timeoutMs parameter, google-genai.json timeoutMs, then the 60000ms default. Timeout values must be integer milliseconds from 1 to 2147483647.

🔐 Auth precedence

  1. Literal apiKey in google-genai.json.
  2. Pi Google auth via /login google, auth.json, runtime key, or GEMINI_API_KEY.
  3. Missing-auth tool error.

apiKey in this config is literal only. $GEMINI_API_KEY, ${GEMINI_API_KEY}, and !command are not resolved here. Use Pi /login google or GEMINI_API_KEY for that behavior.

💬 Command

/google-genai init
/google-genai status
/google-genai config
/google-genai help
/google-genai tools
/google-genai enable
/google-genai disable
  • init: interactively creates or updates config. API key may be blank; blank keeps an existing key or uses Pi auth fallback.
  • status / config: shows config path, model, API URL, timeout, auth source, and enabled tools. It never prints the key.
  • tools: select which Google GenAI tools are active and persist the selection.
  • enable: enable all three tools.
  • disable: disable all three tools. The slash command remains available so you can re-enable them.

🛠️ Tools

🔎 google_search

Search Google through Gemini grounding.

Parameters:

  • query: search question.
  • searchTypes?: optional array of web_search and/or image_search. Omit it for Google's default web search.
  • timeoutMs?: per-call timeout in milliseconds.

Large / broad searches

Very broad market-research, comparison, review, or search-result synthesis queries can time out. A timeout error means the request exceeded the configured duration; it is not a “no results found” response. Prefer several narrow searches over one big query, or raise config timeoutMs or per-call timeoutMs when a broader call is genuinely needed.

Instead of:

2026 AI coding assistant product trends agentic coding IDE local first developer tools web UI Cursor Claude Code GitHub Copilot

Try:

Cursor AI coding features 2026
Claude Code features agentic coding
GitHub Copilot coding agent features 2026
AI coding assistant trends 2025 2026
local first AI developer tools trends

🗺️ google_maps

Ask Google Maps-grounded questions.

Parameters:

  • query: maps/place question.
  • latitude? and longitude?: optional pair for location-sensitive questions. If one is set, both are required. Latitude must be -90..90; longitude must be -180..180.
  • timeoutMs?: per-call timeout in milliseconds.

🔗 google_url_context

Ask Gemini to use specific URLs as context.

Parameters:

  • prompt: question or instruction.
  • urls: one or more http:// or https:// URLs.
  • timeoutMs?: per-call timeout in milliseconds.

Use Firecrawl instead when you need raw HTML/markdown extraction, crawling, or URL discovery.

🧪 Manual live smoke test

Automated tests mock Google. Before publishing, you can manually try:

export GEMINI_API_KEY=your-key
pi -e ./extensions/pi-google-genai

Then ask Pi to use:

Use google_search to answer: Who won Euro 2024?
Use google_maps to find Italian restaurants near latitude 34.050481 longitude -118.248526.
Use google_url_context to summarize https://ai.google.dev/gemini-api/docs/interactions.

🪶 Why no @google/genai dependency yet?

The first version only needs one POST to the Interactions API, so native fetch is enough. Add @google/genai later when the extension needs SDK-heavy features such as file upload, live sessions, Vertex/Enterprise auth, batch/video operations, or file-search store management.

📁 Package layout

extensions/pi-google-genai/
├── src/
│   ├── google-genai.ts  # Pi entrypoint and command orchestration
│   └── *.ts             # Package-local config, client, response, and tool modules
├── test/google-genai.test.ts
├── README.md
├── LICENSE
├── tsconfig.json
└── package.json

Only google-genai.ts is a Pi entrypoint; the other source modules are internal.

🏷️ Keywords

pi-package, pi-extension, google, gemini, genai, search, maps

📄 License

MIT. See LICENSE.