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

@nacre.work/cli

v0.26.0

Published

Command line client for Nacre: layers, grants, ingest and search

Downloads

4,231

Readme

@nacre.work/cli

The command line client for a Nacre installation.

Longer than its sibling packages' READMEs on purpose: the others are libraries an application imports and this is the one thing a person runs, so this page is where they land.

npx @nacre.work/cli login --url https://api.example
npx @nacre.work/cli layers create handbook --name Handbook
npx @nacre.work/cli ingest ./docs --layer handbook
npx @nacre.work/cli search "when do new hires get access"

Commands

| | | |---|---| | login --url <url> | sign in and remember the session. --email, --org optional | | whoami | which principal this session is, and where | | layers | the layers you can read | | layers create <slug> | --name, --description, --workspace, --provider | | grant <permission> <scope> --to <principal> | see below | | ingest <file\|dir>... --layer <slug> | index text files and wait. --watch keeps going | | search <query> | --layer, --top-k | | eval --layer <slug> | score the layer's reference queries. --top-k, --floor |

--json prints the response as JSON for a script rather than a person.

A scope is layer:<slug>, workspace:<slug> or document:<id>. A principal is user:<id>, group:<id> or service_account:<id>.

Administering an organization

All of these need org_admin, and a member gets the same 404 for them as for anything else invisible.

| | | |---|---| | users | everyone, with role and state | | users create <email> | --admin for org_admin. The password is generated and shown once | | users password <id> | issue a new one, shown once | | users role <id> <member\|org_admin> | | | users disable <id> | the row is kept — the access log names that id | | groups | teams a grant can name | | groups create <name> / groups delete <id> | deleting takes the group's grants with it | | groups members <id> | | | groups add\|remove <id> <user:id\|group:id> | | | service-accounts | keys, with prefix and last use | | service-accounts create <name> | the key is shown once | | service-accounts revoke <id> | | | audit | the access log. --action, --actor, --result, --from, --to, --limit |

A password is never given, only generated. --password is refused rather than passed on: an argument ends up in a shell history, and a password an administrator chose is a password they know. The same applies to a service account key — it exists in the response that created it and nowhere afterwards, because what is stored is a hash.

audit --limit counts records, not pages. It follows the cursor to the end of what was asked for. Asking for one page cannot tell a working cursor from a stuck one, and this API's pagination has shipped broken in both directions — once repeating a row forever, once skipping everything between a truncated bound and the real value.

The session

login writes ~/.config/nacre/config.json at mode 0600, in a directory at 0700. It holds a refresh token, which renews itself and so outlives the access token beside it; on a shared machine a default umask would leave that readable by everyone.

NACRE_API_URL and NACRE_TOKEN override the file. That is what CI uses: there is no terminal to sign in from and nothing that could write a renewed token down, so the environment is the whole session — and the file's refresh token is deliberately not paired with it.

Exit codes

| | | |---|---| | 0 | it worked | | 1 | the request was refused, or a document failed to index | | 2 | the invocation was wrong, and repeating it will fail the same way |

A script that cannot tell 1 from 2 retries the second one forever. An ingest where any document failed exits 1 with the per-document summary still on stdout, so a nightly pass cannot report success having indexed nothing.

Two things that are not bugs

Permissions are not a ladder. write does not imply read; admin implies both. An ingest-only service account holds write and cannot search back what it wrote.

"Not found" and "not allowed to see it" are the same answer. The server returns 404 for both, deliberately and everywhere, so this client cannot tell you which one happened and does not guess.

What it does not do

  • Upload binaries. Text files only; a PDF goes through POST /v1/documents as multipart/form-data.
  • Delete anything while watching. A file disappearing is indistinguishable from the first half of how every editor saves, so --watch never removes a document. That is DELETE /v1/documents/{id}, by hand.
  • Administer an installation. Creating organizations, users and service accounts is the API and the admin UI.

Apache 2.0. Full documentation at github.com/nacre-work/nacre.