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

@mm-pm/empire-auth

v0.1.2

Published

gcloud-style CLI login for the Empire platform — prints Auth0 ID tokens for internal tools

Readme

@mm-pm/empire-auth

gcloud-style login CLI for the Empire platform. Log in through the browser once, then let your scripts and tools fetch a valid Auth0 ID token on demand — instead of copying a token out of browser devtools and pasting it around.

Install

npm install -g @mm-pm/[email protected]

Or run it without installing anything:

npx @mm-pm/[email protected] login

Requires Node 20 or newer.

Pin the version rather than letting npx float to whatever is newest. npx @mm-pm/empire-auth without a version re-resolves on every run, so anything published to this name later would execute on your machine automatically — and this tool holds live credentials. Bump the pin deliberately when a new version is announced.

Usage

empire-auth login                # browser login (production)
empire-auth login --env qa       # staging
empire-auth token                # print a valid ID token (refreshes silently)
empire-auth whoami               # show your email + roles, as the platform sees them
empire-auth logout               # revoke the refresh token and delete local credentials

login opens your browser. Once you've signed in, the terminal picks it up automatically and you're done — you won't need to log in again for weeks, and token renews itself in the background.

Credentials are stored per environment in ~/.empire/credentials-<env>.json, readable only by you (0600).

Using it from a script or an AI coding tool

token prints the token to stdout and nothing else, so it composes with anything:

TOKEN=$(empire-auth token)
curl -H "Authorization: Bearer $TOKEN" "$API_URL/some/endpoint"
import { execFileSync } from 'child_process';
const token = execFileSync('empire-auth', ['token'], { encoding: 'utf8' }).trim();

Fetch the token at the moment you need it rather than storing it in a file or pasting it into a prompt. Tokens are short-lived, so a copied one stops working within hours — calling token each run avoids that entirely, and keeps credentials out of your shell history and chat logs.

Troubleshooting

Not logged in to prod — run empire-auth login. This also appears when your session has finally expired; the fix is the same.

The browser didn't openlogin prints the URL it wanted to open. Paste it into a browser on the same machine.

All callback ports are busy — the CLI listens on ports 8765–8767 to receive the login. Close whatever is using them, or finish any other empire-auth login still waiting in another terminal.

Token rejected — your login worked but the platform doesn't recognise the account. Check empire-auth whoami; if your email looks wrong, empire-auth logout and log in again with the right account.

Remote / SSH machines are not supported — the browser has to be able to reach localhost on the same machine the CLI runs on.

How it works

  • Standard OAuth 2.0 authorization code flow with PKCE, against Empire's own Auth0 client — a public client with no secret — so the platform accepts these tokens with no backend change.
  • The browser redirect comes back to a short-lived local listener on 127.0.0.1 (ports 8765–8767) that shuts down as soon as login completes, times out after 5 minutes, and is never reachable from another machine.
  • Your refresh token is rotated on every use, so a leaked copy stops working the next time you run token. logout revokes it centrally rather than only deleting the local file.