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

@cookyourbooks/cli

v0.1.0

Published

Command-line client for CookYourBooks: export/import your recipe library, seed cookbook tables of contents, and load demo content.

Readme

cyb — CookYourBooks CLI

npm install -g @cookyourbooks/cli     # Node.js 20+; or: npx @cookyourbooks/cli <command>
cyb --help

The quickest start is Settings → CLI tokens in the app. Create a token there and the page shows a ready-to-paste cyb login command with this deployment's URL and anon key filled in.

From a checkout instead of npm:

pnpm --filter @cookyourbooks/cli build     # bundles to apps/cli/dist/index.js
alias cyb="node $PWD/apps/cli/dist/index.js"

The CLI has two kinds of commands, which authenticate differently.

Library commands (CLI token)

export, import, and toc … call token-scoped RPCs with a cyb_cli_* token minted in Settings → CLI tokens. The token is saved to ~/.config/cookyourbooks/config.json (mode 0600).

cyb login --url https://<ref>.supabase.co --anon-key <anon-key> --token cyb_cli_…
cyb whoami

# Back up the whole library, then restore recipes into a collection
cyb export --pretty -o library.json
cyb import library.json --collection <collection-uuid>

# Seed a cookbook's table of contents (one title per line)
cyb toc import titles.txt --collection <collection-uuid>
cyb toc export --format text

Demo content (cyb demo load)

Loads the public-domain demo corpus (scripts/demo-content/fetch.ts writes it to scripts/demo-content/out/) into an account through the real OCR import pipeline. The pages are uploaded to Storage and queued as import_batches / import_items exactly like the app's "Choose images" flow, and the account's own OCR key and model do the reading. Clean drafts are then promoted with the app's auto-accept bar (isDraftAutoAcceptable in @cookyourbooks/domain).

  • One cookbook and one batch (Demo · <title>) per book.
  • One import item per recipe. A recipe that crosses a page break is sent as one multi-image OCR call.
  • Weak drafts stay on the batch board under Needs review, as they would in the app.

These commands sign in as the account instead of using a CLI token, because Storage uploads need a user session. The session exists only for the run, and the password is read from an environment variable, never from a flag. The account needs an OCR key saved (Settings → LLM & models); --provider / --model override its saved model.

# 1. Fetch the corpus (page images only — the loader doesn't use the text)
deno run --allow-net --allow-read --allow-write --allow-run \
  scripts/demo-content/fetch.ts --images

# 2. See what would load
cyb demo load --dry-run                         # run from the repo root (default dir is relative)

# 3. Load it. URL / anon key fall back to the `cyb login` config.
export [email protected]
read -rs CYB_PASSWORD && export CYB_PASSWORD
cyb demo load                                   # every book
cyb demo load --only italian-cook-book --max-recipes 4
cyb demo load --no-accept                       # leave results for review in the app
cyb demo load --no-wait                         # queue and exit; the worker finishes later

A run prints each upload and the OCR queue as it drains, then a summary:

The Italian Cook Book: The Art of Eating Well
  ↑ curled-omelet-frittata-in-riccioli (1 page)
  ↑ gnocchi (2 pages)
  uploaded 3/3 page images
  + batch bf180752-… (2 items) queued for OCR
  … 2 pending
  … 2 ocr_done

book                             queued  recipes  review  failed  pending
italian-cook-book                     2        2       0       0        0

Re-running is safe. A book whose batch already exists is resumed, not uploaded again: the run waits for any pages still in the queue and promotes what's ready. Promotion overwrites a same-titled recipe in the cookbook rather than duplicating it. --force uploads the book again as a new batch.

Local Supabase. Serve the worker in mock mode (OCR_MOCK_MODE=1), register import_worker_config in Vault (see the root CLAUDE.md), and seed an ocr_test_fixtures row. The seeded [email protected] / demo1234 account works once it has an OCR key (ocr_key_set) and prefs.

The App Store screenshot pipeline (scripts/ios-screenshots/) uses the same corpus. mobile.yml's ios-screenshots dispatch can run cyb demo load first (load_demo_library), so the demo account is fully stocked before the screenshots are taken.

Releasing

Published to npm as @cookyourbooks/cli by .github/workflows/cli-publish.yml. To release, bump version in apps/cli/package.json, commit, and push a matching tag:

git tag cli-v0.1.0 && git push origin cli-v0.1.0

The workflow typechecks, tests, installs the packed tarball into an empty project as a smoke test, then runs npm publish --provenance. The published package is the single esbuild bundle (dist/index.js); the workspace packages it uses (@cookyourbooks/domain, @cookyourbooks/db) are compiled into it, so they're devDependencies and aren't published.