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

opioidpolicy

v1.0.5

Published

A real terminal companion to the OPI browser CLI — opioid settlement spending rules, the F.I.T. test, decision matrices, transparency standards, projects, and whitepapers, from your shell.

Downloads

937

Readme

opioidpolicy — Opioid Policy Institute CLI

A real terminal companion to the browser terminal. Run opi in your shell to query OPI's accountability data: the WFAM database (waste / fraud / abuse / mismanagement), AG accountability by state, settlement-spending rules, the F.I.T. test, decision matrices, transparency standards, projects, and whitepapers — the same content the website serves.

Zero dependencies. Node 18+ (built-in fetch). Static content ships inside the package (instant + offline); live data is fetched from data.opioidpolicy.org.

Install / run

# run without installing
npx opioidpolicy help

# or install once, then use `opi`
npm i -g opioidpolicy
opi

Running opi with no command opens an interactive terminal (boot banner + prompt, ↑/↓ history, clear to reset, exit / Ctrl+C to leave).

Updating

npm i -g opioidpolicy        # update a global install to the newest version
npx opioidpolicy@latest      # or skip installs entirely — npx always runs the newest

opi version checks npm and tells you if a newer version is out. The CLI does not auto-install updates (that would be slow and surprising); it just lets you know.


Cheat sheet

Help & meta

| Command | What it does | |---|---| | opi help | list every command | | opi help <command> | a command's options + examples | | opi <command> --help | same as opi help <command> | | opi examples | copy-paste example commands | | opi version | print the version |

Opioid settlement guidance — opi opioid-settlement (bundled, offline)

| Command | What it does | |---|---| | opi opioid-settlement --quick-rules | OPI's 8 rules for spending settlement funds well | | opi opioid-settlement --fit-test | the F.I.T. test — summary of all three letters | | opi opioid-settlement --fit-test --functional | just Functional (also --impactful, --trackable) | | opi opioid-settlement --fit-test --all | all three letters in full | | opi opioid-settlement --decision-matrix | cost×impact & urgency×importance grids | | opi opioid-settlement --transparency-best-practices | the 8 transparency standards | | opi opioid-settlement --policy-briefs | where to read OPI policy briefs |

Projects & research (bundled, offline)

| Command | What it does | |---|---| | opi projects | list every OPI project | | opi whitepapers | OPI research papers (PDFs) |

WFAM database — opi wfam (live · waste / fraud / abuse / mismanagement)

| Command | What it does | |---|---| | opi wfam MI | records for one state (2-letter code) | | opi wfam all | every record (700+) | | opi wfam stats | totals — dollars documented + record count | | opi wfam --state "New York" | full state name (flag form for multi-word names) | | opi wfam --year 2024 | filter by spend year | | opi wfam --domain "Law Enforcement" | filter by spending domain | | opi wfam --search "drone" | free-text search across records | | opi wfam --per-page 50 | rows to display (default 20) | | opi wfam MI --year 2024 --total | filters combine |

Unallowable / restricted spending — opi unallowable-spending (live, WFAM-backed)

| Command | What it does | |---|---| | opi unallowable-spending MI | flagged spending in one state | | opi unallowable-spending MI law-enforcement | law-enforcement only | | opi unallowable-spending non-law-enforcement | everything except law enforcement | | opi unallowable-spending all | every flagged record |

Flag forms also work: --state MI · --law-enforcement · --non-law-enforcement · --all.

AG accountability — opi accountability (live)

| Command | What it does | |---|---| | opi accountability MI | a state's AG opioid-settlement reporting path (2-letter code) | | opi accountability --state "New York" | full state name |

Interactive terminal (run opi with no command)

| Key / word | Action | |---|---| | / | command history | | clear | reset the screen | | exit / quit / Ctrl+C | leave |

Global options

| Option | Effect | |---|---| | --base <url> / OPI_API_BASE | fetch the static content from another host (e.g. local dev) | | NO_COLOR=1 | disable ANSI colour (auto-off when output is piped) |


How the data works

  • Static content (rules, F.I.T. test, transparency, projects, whitepapers) ships inside the package → instant and offline. It's generated from the website's single sources (projects-data.js, whitepapers-data.js, and the authored JSON) via _dev/sync/gen-cli-data.mjs; re-run that and republish to update.
  • Live data (wfam, unallowable-spending, accountability) is fetched from https://data.opioidpolicy.org/cli/ and filtered locally — no server query API, no PHP.
  • State filters accept a 2-letter code (MI, which maps to the exact state — so it never matches Missouri/Mississippi) or a full name via --state (--state "New York").

Publishing

Lives in the website repo under _dev/cli-tool/ (excluded from the web upload) and is mirrored to its own repo at https://codeberg.org/opioidpolicy/opi-cli. To ship a new version: bump version in package.json, then npm publish from this folder.

License

MIT © Opioid Policy Institute. See LICENSE.