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

protonmail-cli

v0.1.0

Published

ProtonMail CLI via Proton Bridge IMAP/SMTP — terminal client and library

Readme

protonmail-cli

Terminal email client for ProtonMail via Proton Bridge IMAP/SMTP.

Works on Windows, macOS, and Linux. Also usable as an importable TypeScript library.

Prerequisites

Install

npm install -g protonmail-cli

Setup

# Interactive setup wizard
protonmail-cli config init

# Verify everything works
protonmail-cli config doctor

The setup wizard prompts for your email, Proton Bridge host/port, and Bridge-specific password (found in the Bridge app under your account settings). The password is stored securely in your system keyring (Windows Credential Manager, macOS Keychain, or Linux Secret Service).

Usage

List messages

protonmail-cli mail list
protonmail-cli mail list --unread -n 10
protonmail-cli mail list --json

Read a message

protonmail-cli mail read uid:515
protonmail-cli mail read uid:515 --json
protonmail-cli mail read uid:515 --html

Send email

protonmail-cli mail send -t "[email protected]" -s "Subject" -b "Body"

# With attachments
protonmail-cli mail send -t "[email protected]" -s "Report" -b "See attached" -a report.pdf

# Pipe body from stdin
echo "Hello from the CLI" | protonmail-cli mail send -t "[email protected]" -s "Hello"

# Idempotency key prevents duplicate sends on retry
protonmail-cli mail send -t "[email protected]" -s "Invoice" -b "..." --idempotency-key "inv-2024-001"

Reply and forward

protonmail-cli mail reply uid:515 -b "Thanks!"
protonmail-cli mail reply uid:515 --all -b "Thanks everyone!"
protonmail-cli mail forward uid:515 -t "[email protected]"

Search

protonmail-cli mail search "quarterly report"
protonmail-cli mail search "invoice" --from "[email protected]" --since 2024-01-01

Other commands

# Message management
protonmail-cli mail delete uid:515
protonmail-cli mail move uid:515 Archive
protonmail-cli mail archive uid:515 uid:516
protonmail-cli mail flag uid:515 --star
protonmail-cli mail flag uid:515 --read

# Threading
protonmail-cli mail thread uid:515

# Attachments
protonmail-cli mail download uid:515 0 -o ./attachment.pdf

# Watch for new mail
protonmail-cli mail watch -i 30 --exec "echo New mail: {}"

# Drafts
protonmail-cli mail draft list
protonmail-cli mail draft create -t "[email protected]" -s "Draft" -b "WIP"

# Labels
protonmail-cli mail label list
protonmail-cli mail label add uid:515 -l important

# Mailbox management
protonmail-cli mailbox list
protonmail-cli mailbox create "My Folder"

# Local contacts
protonmail-cli contacts add [email protected] -n "User Name"
protonmail-cli contacts search "user"

# Diagnostics
protonmail-cli config doctor
protonmail-cli config show

AI / agent commands

# Structured message summary
protonmail-cli mail summarize uid:515 --json

# Extract emails, URLs, dates, phone numbers
protonmail-cli mail extract uid:515 --json

# Full command schema for LLM tool use
protonmail-cli --help-json

Global flags

| Flag | Description | |------|-------------| | --json | Machine-readable JSON output | | -v, --verbose | Verbose output | | -q, --quiet | Suppress non-essential output | | --no-color | Disable ANSI colors | | -c, --config <path> | Custom config file path |

Message selectors

Messages can be referenced by:

  • Sequence number: 42 (position in mailbox, changes on delete)
  • UID: uid:515 (stable across sessions, recommended)

Library usage

import { ImapClient, loadConfig, getPassword } from 'protonmail-cli';

const cfg = await loadConfig();
const password = await getPassword('protonmail-cli', cfg.bridge.email);

const imap = new ImapClient({
  host: cfg.bridge.imap_host,
  port: cfg.bridge.imap_port,
  email: cfg.bridge.email,
  password: password!,
});

await imap.connect();
const messages = await imap.listMessages('INBOX', 10, 0, false);
console.log(messages);
await imap.disconnect();

Configuration

Config file: ~/.config/protonmail-cli/config.yaml (Linux), ~/Library/Application Support/protonmail-cli/config.yaml (macOS), %APPDATA%\protonmail-cli\config.yaml (Windows).

bridge:
  imap_host: 127.0.0.1
  imap_port: 1143
  smtp_host: 127.0.0.1
  smtp_port: 1025
  email: [email protected]
defaults:
  mailbox: INBOX
  limit: 20
  format: text

Bridge password is stored in the system keyring, not the config file.

How it works

protonmail-cli connects to Proton Bridge running on localhost. Bridge provides standard IMAP/SMTP access to your ProtonMail account with end-to-end encryption handled transparently. The CLI uses STARTTLS and accepts Bridge's self-signed certificate automatically.

Inspired by

pm-cli by Bryan Scott (Go).

License

MIT