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

@cirne/zmail

v0.2.0-alpha.20260329.194818

Published

Agent-first email system — sync, index, and search email for AI agents

Readme

zmail

Email as a queryable dataset for AI agents.

Modern email systems are human-first — designed around inbox browsing and manual workflows. zmail reimagines email as a structured, searchable dataset with a native interface for AI agents.

What it does

  • Syncs email from IMAP (Gmail-first) into local storage (~/.zmail/data/maildir, SQLite index at ~/.zmail/data/zmail.db)
  • Indexes for FTS5 full-text search and exposes CLI + MCP interfaces
  • Supports agent-optimized shortlist → hydrate workflows via CLI search controls

Quick start

  1. Install (see AGENTS.md for full installation options)

    npm install -g @cirne/zmail

    For development:

    npm install
  2. Run interactive setup

    zmail setup

    Or from the repo:

    npm run zmail -- setup

    This creates ~/.zmail/config.json and ~/.zmail/.env with your IMAP credentials and OpenAI API key. The setup command validates credentials and guides you through the process.

  3. Initial sync (example: last 7 days)

    zmail sync --since 7d

    Or from the repo:

    npm run zmail -- sync --since 7d

    Refresh (fetch new messages):

    zmail refresh

    Or from the repo:

    npm run zmail -- refresh
  4. Search (header-first default)

    zmail search "apple receipt after:30d" --json

    Or from the repo:

    npm run zmail -- search "apple receipt after:30d" --json

CLI

zmail sync [--since <spec>]     # Initial sync: fill gaps going backward
zmail refresh                    # Refresh: fetch new messages since last sync
zmail search <query> [--mode auto|fts|semantic|hybrid]
                  [--detail headers|snippet|body]
                  [--fields <csv>] [--ids-only] [--timings]
                  [--limit <n>] [--json]
zmail status
zmail stats
zmail read <id> [--raw]         # or zmail message <id>
zmail thread <id> [--raw]
zmail mcp                        # Start MCP server (stdio)

Query can use inline operators: from:, to:, subject:, after:, before: (e.g. zmail search "from:[email protected] invoice OR receipt").

Agent interfaces

  • CLI: Use for direct subprocess calls. Fast for one-off queries. Commands default to JSON (search, who, attachment list) or text (read, thread, status, stats). Use --text or --json flags to override.
  • MCP: Use for persistent tool-based integration. Run zmail mcp to start stdio server. See docs/MCP.md for details.

Recommended agent retrieval pattern

# 1) Fast shortlist
zmail search "from:[email protected] receipt after:30d" \
  --detail headers --fields messageId,date,subject --ids-only --json

# 2) Hydrate selected IDs
zmail read "<message-id>"

# Optional: fetch original raw MIME source
zmail read "<message-id>" --raw

Schema drift recovery

zmail intentionally does not run automatic migrations on existing local DBs. If startup reports schema drift, rebuild local data and resync:

rm -rf ~/.zmail/data/
zmail sync --since 7d

For a maildir-only SQLite reindex without deleting raw email (same steps as a schema bump), use zmail rebuild-index — see AGENTS.md.

Architecture

Built with TypeScript + Node.js 20+. All data stored locally on a persistent volume — no cloud sync service, no third-party access to your email.

Documentation:

Status

Active development. Core sync/index/search flows are working; CLI search interface is being expanded for agent-first workflows.

License

MIT