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

@e9n/pi-gmail

v0.2.0

Published

Gmail extension for pi — read, search, compose, and send emails via Gmail API

Readme

@e9n/pi-gmail

Full Gmail integration for pi — read, search, compose, reply, and manage emails via the Gmail API.

Features

  • Read & search — search with Gmail query syntax, read individual emails or full threads
  • Compose & reply — create drafts, reply to threads, send immediately
  • Manage — archive, trash, label, mark read/unread
  • Attachments — download attachments to disk
  • Notifications — optional background polling with TUI alerts for new mail
  • Web UI — OAuth flow and auth status page via pi-webserver

Setup

1. Create Google OAuth credentials

  1. Go to Google Cloud Console
  2. Create a project (or use an existing one)
  3. Enable the Gmail API
  4. Create OAuth 2.0 Client ID credentials (Desktop or Web application)
  5. Add http://localhost:<port>/gmail/callback as an authorized redirect URI

2. Configure pi settings

Add to ~/.pi/agent/settings.json:

{
  "pi-gmail": {
    "clientId": "your-client-id.apps.googleusercontent.com",
    "clientSecret": "your-client-secret"
  }
}

Values can use env:VAR_NAME syntax to read from environment variables.

3. Authenticate

Run /gmail-auth in pi to start the OAuth flow — opens a browser for Google sign-in and stores tokens locally.

Settings

| Key | Type | Default | Description | |-----|------|---------|-------------| | clientId | string | — | Google OAuth client ID (required) | | clientSecret | string | — | Google OAuth client secret (required) | | notifications.enabled | boolean | false | Enable background polling for new mail | | notifications.intervalMinutes | number | 5 | Polling interval in minutes | | notifications.query | string | "is:unread" | Gmail search query for notifications |

Tool: gmail

All actions are accessed through a single gmail tool with an action parameter.

Actions

| Action | Description | Key params | |--------|-------------|------------| | search | Search emails with Gmail query syntax | query, max_results | | read | Read a single email by ID | id | | read_thread | Read a full conversation thread | thread_id | | list_inbox | List recent inbox messages | max_results | | list_unread | List unread messages | max_results | | list_labels | List all Gmail labels | — | | compose | Create a draft email | to, subject, body, cc, bcc | | reply | Reply to a thread | thread_id, body, reply_all | | send | Compose and send immediately | to, subject, body | | send_draft | Send an existing draft | draft_id | | list_drafts | List all drafts | — | | delete_draft | Delete a draft | draft_id | | archive | Archive messages (remove from inbox) | id or ids | | trash | Move messages to trash | id or ids | | label | Add or remove labels | id, add_labels, remove_labels | | mark_read | Mark messages as read | id or ids | | mark_unread | Mark messages as unread | id or ids | | download_attachment | Save an attachment to disk | id, attachment_id, save_path |

Commands

| Command | Description | |---------|-------------| | /gmail-auth | Start OAuth authentication flow | | /gmail-logout | Disconnect Gmail account | | /gmail-status | Show current authentication status |

Web UI

When pi-webserver is running, the extension mounts:

  • /gmail — Auth status page with connect/disconnect
  • /gmail/auth — OAuth redirect to Google
  • /gmail/callback — OAuth callback handler
  • /api/gmail/status — JSON auth status endpoint

Install

pi install npm:@e9n/pi-gmail

License

MIT