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

@guquan-2002/pi-gmail

v1.0.1

Published

Gmail tools for Pi

Downloads

415

Readme

Pi Gmail Extension

English

This is a native Pi extension with no third-party runtime dependencies. It accesses Google OAuth and the Gmail REST API directly and provides the gmail_search, gmail_get, gmail_send, gmail_reply, gmail_modify, and gmail_labels tools.

Install it from npm:

pi install npm:@guquan-2002/pi-gmail

The extension requires your own Google Cloud OAuth 2.0 Desktop app client. Enable the Gmail API in your Google Cloud project, configure the OAuth consent screen, create a Desktop app OAuth client, and download the client_secret_*.json file.

Run this command in Pi:

/gmail-setup /absolute/path/to/client_secret.json

After browser authorization is complete, run /gmail-status to check the status. /gmail-logout deletes the local token but keeps the OAuth client credentials.

The OAuth client credentials and token are stored at:

~/.config/pi-gmail/credentials.json
~/.config/pi-gmail/token.json

The directory permissions are 0700, and the file permissions are 0600. The authorization scopes are gmail.modify and gmail.send. Sending, replying, changing read status, archiving, moving messages to trash, and changing labels all require confirmation before execution. Write operations are rejected when no interactive UI is available.

中文

这是一个不依赖第三方运行时包的原生 Pi 扩展。它直接访问 Google OAuth 和 Gmail REST API,提供 gmail_searchgmail_getgmail_sendgmail_replygmail_modifygmail_labels 工具。

通过 npm 安装:

pi install npm:@guquan-2002/pi-gmail

扩展要求使用你自己的 Google Cloud OAuth 2.0 桌面应用客户端。先在 Google Cloud 项目中启用 Gmail API,配置 OAuth consent screen,并创建 Desktop app 类型的 OAuth client,然后下载 client_secret_*.json

在 Pi 中运行:

/gmail-setup /absolute/path/to/client_secret.json

浏览器授权完成后,可运行 /gmail-status 检查状态。使用 /gmail-logout 会删除本机 token,但保留 OAuth 客户端凭据。

OAuth 客户端凭据和 token 分别保存在:

~/.config/pi-gmail/credentials.json
~/.config/pi-gmail/token.json

目录权限为 0700,文件权限为 0600。授权范围是 gmail.modifygmail.send。发送、回复、标记状态、归档、移入垃圾箱以及标签变更都会在执行前弹出确认;没有交互 UI 时,写操作会被拒绝。