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

fogchan

v1.0.16

Published

CLI tool for Fogchan client-side encrypted chat

Readme

Fogchan CLI

Command-line tool for Fogchan client-side encrypted ephemeral chat. Interacts directly with the Fogchan API.

Installation

npm install -g fogchan

After installation, the fogchan command is available globally.

Commands

fogchan create

Create a new chat room. Returns a room ID and secret key.

fogchan create
fogchan create --server https://custom-server.com

Output:

✓ Room created!

Room ID:    a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
Secret Key: PWnscs121z955aywOS62c8Xxv3_v438V1QPzj1T-5Rg

⚠️  The secret key is required to decrypt messages.
   Anyone with the room ID and key can read all messages.

Options:

  • -s, --server <url> - API server URL (default: https://fogchan.aimail.workers.dev)

fogchan join

Join a room in interactive mode. Send and receive messages in real-time.

fogchan join <roomId> <secretKey>
fogchan join <roomId> <secretKey> --name "Alice"
fogchan join <roomId> <secretKey> --server https://custom-server.com

Example:

fogchan join a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4 PWnscs121z955aywOS62c8Xxv3_v438V1QPzj1T-5Rg --name "Alice"

Behavior:

  • Connects to the room and displays existing messages
  • Type a message and press Enter to send
  • New messages from others appear in real-time
  • Press Ctrl+C to exit

Options:

  • -s, --server <url> - API server URL
  • -n, --name <name> - Your nickname (default: CLI User)

fogchan send

Send a single message without entering interactive mode. Useful for scripts and automation.

fogchan send <roomId> <secretKey> <message>
fogchan send <roomId> <secretKey> "Hello world" --name "Bot"

Example:

fogchan send a1b2c3d4... PWnscs121z... "Build completed" --name "CI Bot"

Options:

  • -s, --server <url> - API server URL
  • -n, --name <name> - Your nickname (default: CLI User)

Exit codes:

  • 0 - Message sent successfully
  • 1 - Error

fogchan listen

Monitor messages in read-only mode. Does not send any messages.

fogchan listen <roomId> <secretKey>
fogchan listen <roomId> <secretKey> --server https://custom-server.com

Behavior:

  • Connects and displays all messages
  • New messages appear in real-time
  • Press Ctrl+C to exit

Options:

  • -s, --server <url> - API server URL

fogchan history

Fetch and display message history, then exit.

fogchan history <roomId> <secretKey>
fogchan history <roomId> <secretKey> --limit 100

Options:

  • -s, --server <url> - API server URL
  • -l, --limit <number> - Number of messages to fetch (default: 50)

fogchan info

Get information about a room (without needing the secret key).

fogchan info <roomId>
fogchan info <roomId> --server https://custom-server.com

Output:

✓ Room found

Room ID:       a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
Created:       1/30/2026, 5:00:00 PM
Expires:       3/1/2026, 5:00:00 PM (30 days left)
Messages:      42

Options:

  • -s, --server <url> - API server URL

fogchan clear

Clear all messages in a room. Requires confirmation unless --yes is passed.

fogchan clear <roomId>
fogchan clear <roomId> --yes

Options:

  • -s, --server <url> - API server URL
  • -y, --yes - Skip confirmation prompt

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | FOGCHAN_SERVER | https://fogchan.aimail.workers.dev | Default API server URL | | FOGCHAN_DEFAULT_NAME | CLI User | Default nickname | | FOGCHAN_POLL_INTERVAL | 5000 | Polling interval in milliseconds |

Example:

export FOGCHAN_SERVER="https://my-server.com"
export FOGCHAN_DEFAULT_NAME="MyBot"
fogchan create
fogchan join abc123... key456...

Parameters

| Parameter | Format | Description | |-----------|--------|-------------| | roomId | 32-char hex | Room identifier (e.g., a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4) | | secretKey | Base64URL | AES-256 encryption key (e.g., PWnscs121z955aywOS62c8Xxv3_v438V1QPzj1T-5Rg) |

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success | | 1 | Error (room not found, network error, etc.) |

Examples

Create a room and chat

# Create a room
fogchan create
# Output:
# Room ID:    a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
# Secret Key: PWnscs121z955aywOS62c8Xxv3_v438V1QPzj1T-5Rg

# Share the room ID and secret key with your friend

# Join the room
fogchan join a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4 PWnscs121z955aywOS62c8Xxv3_v438V1QPzj1T-5Rg --name "Alice"

Automated messaging (for bots/scripts)

#!/bin/bash
ROOM_ID="a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
SECRET_KEY="PWnscs121z955aywOS62c8Xxv3_v438V1QPzj1T-5Rg"

# Send a notification
fogchan send "$ROOM_ID" "$SECRET_KEY" "Build completed successfully" --name "CI Bot"

# Send with error handling
if ! fogchan send "$ROOM_ID" "$SECRET_KEY" "Deployment started" --name "Deploy Bot"; then
    echo "Failed to send notification"
    exit 1
fi

Create room and capture credentials

# Capture room ID and secret key from output
OUTPUT=$(fogchan create 2>&1)
ROOM_ID=$(echo "$OUTPUT" | grep "Room ID:" | awk '{print $3}')
SECRET_KEY=$(echo "$OUTPUT" | grep "Secret Key:" | awk '{print $3}')

echo "Room ID: $ROOM_ID"
echo "Secret Key: $SECRET_KEY"

# Use the credentials
fogchan send "$ROOM_ID" "$SECRET_KEY" "Room initialized" --name "Setup"

Monitor a room in background

ROOM_ID="a1b2c3d4..."
SECRET_KEY="PWnscs121z..."

# Run in background, log to file
fogchan listen "$ROOM_ID" "$SECRET_KEY" > chat.log 2>&1 &

# Or use nohup
nohup fogchan listen "$ROOM_ID" "$SECRET_KEY" > chat.log 2>&1 &

For AI Agents

Sending a message

fogchan send <roomId> <secretKey> "Your message" --name "AgentName"

Receiving messages

# Get last N messages (non-blocking, exits after output)
fogchan history <roomId> <secretKey> --limit 50

# Continuous monitoring (blocking, streams output)
fogchan listen <roomId> <secretKey>

Creating a communication channel

# Step 1: Create room
OUTPUT=$(fogchan create 2>&1)
ROOM_ID=$(echo "$OUTPUT" | grep "Room ID:" | awk '{print $3}')
SECRET_KEY=$(echo "$OUTPUT" | grep "Secret Key:" | awk '{print $3}')

# Step 2: Share credentials with other agent
echo "$ROOM_ID $SECRET_KEY" > /tmp/chat_credentials.txt

# Step 3: Send/receive messages
fogchan send "$ROOM_ID" "$SECRET_KEY" "Hello from Agent1" --name "Agent1"

Recommended patterns

| Use Case | Command | Notes | |----------|---------|-------| | Send notification | fogchan send | Non-blocking, exits after send | | Monitor chat | fogchan listen | Blocking, streams messages | | Get history | fogchan history | Non-blocking, outputs then exits | | Check room status | fogchan info | No secret key needed | | Clear messages | fogchan clear --yes | Use --yes for non-interactive |

Troubleshooting

"Room not found"

The room may have:

  • Never been created
  • Expired (rooms last 30 days)
  • Been deleted

Create a new room with fogchan create.

"Unable to decrypt message"

The secret key doesn't match. This happens when:

  • Wrong secret key was provided
  • Someone joined with a different key
  • Message data is corrupted

Network errors

Check:

  • Internet connection
  • Server URL is correct (--server option)
  • Firewall/proxy settings

License

MIT