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

opencode-email-notify

v1.0.0

Published

OpenCode plugin to send email notifications on session.idle

Readme

opencode-email-notify

EN | 中文

An OpenCode plugin that listens for the session.idle event and sends email notifications.

Features

  • Supports SMTP password authentication and OAuth2 authentication
  • Supports HTTP / HTTPS / SOCKS5 / SOCKS4 proxies
  • Supports multiple recipients
  • Uses OpenCode structured logging

Installation

Method 1: Local Development

Clone this repository to any directory, install dependencies, and OpenCode will automatically load the plugin from .opencode/plugins/:

git clone https://github.com/your-org/opencode-email-notify.git
cd opencode-email-notify
bun install   # or npm install, to install nodemailer, socks, etc.

Method 2: Install via npm

Add to your opencode.json:

{
  "plugin": ["opencode-email-notify"]
}

Configuration

Supports both configuration files and environment variables. Environment variables take precedence over configuration files.

Configuration File

Configuration files use the JSON with Comments (JSONC) format and support the following locations (project-level overrides global):

  • Global: ~/.config/opencode/email-notify.jsonc
  • Project-level: .opencode/email-notify.jsonc

Example:

{
  // SMTP settings
  "SMTP_HOST": "smtp.gmail.com",
  "SMTP_PORT": "587",
  "SMTP_USER": "[email protected]",
  "SMTP_PASS": "your-app-password",

  // OAuth2 authentication (choose one)
  // "SMTP_OAUTH2_ACCESS_TOKEN": "ya29.xxx",

  // Proxy (optional)
  // "SMTP_PROXY": "socks5://127.0.0.1:1080",

  // Notification settings
  "NOTIFY_TO": "[email protected]",
  "NOTIFY_FROM": "[email protected]",
  "NOTIFY_MIN_INTERVAL_MS": "600000",
  "NOTIFY_DRY_RUN": "false"
}

Multiple recipients: Use commas to separate multiple email addresses in NOTIFY_TO, e.g. "[email protected],[email protected]".

Environment Variables

All configuration items can be set via environment variables, which will override values in configuration files:

export SMTP_HOST=smtp.gmail.com
export SMTP_PORT=587
export [email protected]
export SMTP_PASS=your-app-password
export SMTP_OAUTH2_ACCESS_TOKEN=xxx
export SMTP_PROXY=socks5://127.0.0.1:1080
export [email protected],[email protected]
export [email protected]
export NOTIFY_MIN_INTERVAL_MS=600000
export NOTIFY_DRY_RUN=false

Events

Subscribes to the session.idle event and sends an email notification when an OpenCode session becomes idle.

The email includes:

  • Session title
  • Project name
  • Working directory
  • Trigger time

Logging

The plugin uses client.app.log() for structured logging. You can view initialization, send success/failure, and other information through the OpenCode logging system.

License

MIT