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

@latrinebot/cli

v0.5.0

Published

Tiny CLI over the Latrine Bot public API.

Downloads

405

Readme

@latrinebot/cli

A tiny CLI over the Latrine Bot public API. Read-only by default, perfect for scripts, alerts, and CI jobs.

npm version License: MIT

Part of the dfnwtf/latrinebot monorepo.

npm install -g @latrinebot/cli
# or
npx @latrinebot/cli status <project-id>

Configuration

What you need

| Credential | Used by | Where to get it | |---|---|---| | Project ID (UUID) | every command | the dashboard URL ?project=<id> or latrine projects list once authenticated | | Metrics key (lb_live_...) | read-only commands (status, stats, events, watch) | dashboard → API tab → Generate metrics key. Shown once. | | Session JWT | write commands (start, stop, preflight, run-once, projects, keys) | Sign in at latrinebot.com/app, then copy the session token from DevTools |

The eligibility check (latrine eligibility <id> <wallet>) is public and needs neither.

How to pass them

In order of precedence the CLI reads: command flag, env var, then ~/.latrine/config.json.

Flags (one-off):

latrine status <project-id> --metrics-key lb_live_xxxxxxxx
latrine start  <project-id> --token eyJhbGciOi...

Env vars (per shell session):

export LATRINE_METRICS_KEY=lb_live_xxxxxxxx
export LATRINE_TOKEN=eyJhbGciOi...
export LATRINE_API=https://api.latrinebot.com   # optional override

Config file (permanent, recommended for personal use):

mkdir -p ~/.latrine
cat > ~/.latrine/config.json <<EOF
{
  "metricsKey": "lb_live_xxxxxxxx",
  "token":      "eyJhbGciOi..."
}
EOF
chmod 600 ~/.latrine/config.json

PowerShell equivalent:

New-Item -ItemType Directory -Force "$env:USERPROFILE\.latrine" | Out-Null
'{"metricsKey":"lb_live_xxxxxxxx","token":"eyJhbGciOi..."}' |
  Set-Content "$env:USERPROFILE\.latrine\config.json"

Why even reads need a key

Latrine Bot treats per-project metrics (cycle counts, holders snapshot, last-event payloads) as operator-private, not public. They are read-only data, but only the project owner should see them. Truly public data (eligibility check, share card, widget snapshots) is on the client.public.* surface and needs no credentials.

Commands

Read-only (metrics key)

# Snapshot
latrine status <project-id>

# Latest N events (default 10)
latrine events <project-id> --limit 20

# Watch live (polls every 5s)
latrine watch <project-id>

# Eligibility check for any wallet (public, no auth needed)
latrine eligibility <project-id> <wallet-pubkey>

# Token page LIVE view: split, hold fund, perks (public, no auth)
latrine live <project-id>
latrine live <project-id> --json

Authenticated (Bearer JWT)

# Run preflight on a project
latrine preflight <project-id>

# List your projects
latrine projects list

# Start / stop
latrine start <project-id>
latrine stop <project-id>

# Force a single cycle now
latrine run-once <project-id>

# Get a metrics key (printed once)
latrine keys create <project-id> --label "ci-monitor"
latrine keys list <project-id>
latrine keys revoke <project-id> <key-id>

Discovery

latrine version
latrine health

Examples

Slack alert on a failed cycle

#!/usr/bin/env bash
set -e
events=$(latrine events "$PROJECT" --limit 5 --json)
echo "$events" | jq -e '.events[] | select(.severity=="error")' >/dev/null && \
  curl -sX POST "$SLACK_WEBHOOK" -d '{"text":"Latrine Bot error on '"$PROJECT"'"}'

CI smoke test before deploying a token site

latrine eligibility "$PROJECT" "$TEAM_WALLET" --json > eligibility.json

Why this CLI

  • Read-only by default. Never asks for, never logs your wallet secret.
  • Works with the same metrics key that powers the dashboard widgets.
  • Zero runtime deps beyond @latrinebot/sdk.
  • Output is human by default, JSON with --json for scripts.

License

MIT - see the root LICENSE.