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

@stetcms/cli

v0.2.0

Published

Command line interface for Stet, the CMS for marketing and engineering: generate a typed content client and publish your tracking plan.

Downloads

242

Readme

@stetcms/cli

CI Docs License

Stet from the command line, for scripting, seeding, and CI.

Stet is the CMS where marketing owns the content model and engineering gets a typed client generated from it.

Install

npm install -g @stetcms/cli
# or run without installing
npx @stetcms/cli login

Usage

stet init

Write a stet.config.ts to start from, with the analytics block present but commented out. No network calls, so it works before you have a key.

npx stet init

| Flag | Description | | ----------------- | ---------------------------------------------------------------------- | | --config <path> | Where to write the config. Defaults to ./stet.config.ts. | | --output <path> | Where the generated content client should go. Written into the config. | | --force | Overwrite an existing config. |

--output defaults to src/stet.gen.ts when the project has a src directory and stet.gen.ts when it does not.

Without --force, an existing config is never replaced. Detection looks in every place @stetcms/vite and this CLI look, so writing to the default location cannot shadow the config your project already loads: with --force and no --config, it overwrites the file it found rather than adding one at the root. An explicit --config is honoured as given, and if that path is somewhere the resolver will not look, the command says so rather than leaving you a config nothing reads.

The next steps it prints depend on the project. A project that builds with Vite is told to install the plugin and add stet() to vite.config.ts; anywhere else — Next.js, another bundler, a CI checkout — is told to install @stetcms/client and run stet generate. The install line follows whichever package manager the project uses.

The config carries no apiKey. Export STET_API_KEY instead, so the file stays safe to commit. init does not edit your package.json.

stet generate

Generate the typed content client from your organization's content model, exactly as @stetcms/vite does at build time. Use it where there is no Vite: Next.js apps, other bundlers, or CI.

STET_API_KEY=stet_... stet generate
stet generate --key stet_... --url https://stet.example.com --output lib/stet.gen.ts

| Flag | Description | | ----------------- | -------------------------------------------------------------------- | | --url <origin> | Stet server origin. Defaults to $STET_ORIGIN, then the hosted app. | | --key <api-key> | Organization API key. Defaults to $STET_API_KEY. | | --output <path> | Where the generated module goes. Defaults to src/stet.gen.ts. | | --config <path> | Path to stet.config.ts. Auto-detected by default. | | --if-key | Succeed without generating when no API key is set. |

--url, --key and --output each override the matching key in stet.config.ts; --config chooses which file that is. Both this CLI and the Vite plugin read it (see @stetcms/config).

--if-key exists for build scripts, so stet generate --if-key && next build can run in environments that have no STET_API_KEY, such as a CI job building against a committed generated client. It is the same behaviour @stetcms/vite has without a key: say so, keep the file on disk, and carry on. Only the missing key is forgiven; with a key set, an unreachable server or a rejected key still fails the command.

The generated file imports @stetcms/client, so add that to your app's dependencies. It never contains the key: at runtime the client reads STET_API_KEY from the environment again, so the file is safe to commit. It reads STET_ORIGIN at runtime too, falling back to the origin it was generated against.

stet sync

Publish your analytics tracking plan, so Stet can chart events your code declares before anyone has fired one. The same job @stetcms/vite does on dev-server and build start; use this where there is no Vite, or in CI.

STET_API_KEY=stet_... stet sync

| Flag | Description | | ----------------- | -------------------------------------------------------------------- | | --url <origin> | Stet server origin. Defaults to $STET_ORIGIN, then the hosted app. | | --key <api-key> | Organization API key. Defaults to $STET_API_KEY. | | --config <path> | Path to stet.config.ts. Auto-detected by default. |

Replacement, not merge: an event deleted from your code disappears from the dashboard's list on the next sync, while anything already recorded under that name keeps its history.

stet login

Log in through your browser using the OAuth device flow. The CLI shows a short code, opens the verification page, and waits for you to approve the request. No password ever touches the terminal.

stet login

| Flag | Description | | ---------------- | -------------------------------------------------------------------------- | | --url <origin> | Stet server origin. Defaults to $STET_API_URL, then the hosted app. | | --no-open | Print the verification link instead of opening a browser. Useful over SSH. |

stet whoami

Show the account you are logged in as.

stet whoami
stet whoami --json

--json prints the user, session, and active organization as JSON for scripting. The session token is never included in the output.

stet logout

Clear the session stored on this machine. Running the command when already logged out also succeeds.

stet logout

stet org

Show the organization an API key is scoped to, including its billing plan.

stet org --api-key stet_...   # or set STET_API_KEY
stet org --json

| Flag | Description | | ----------------- | --------------------------------------------------------------------- | | --api-key <key> | Organization API key. Defaults to $STET_API_KEY. | | --url <origin> | Stet server origin. Defaults to $STET_API_URL, then the hosted app. | | --json | Print the organization as JSON. |

Configuration

  • STET_API_URL: default server origin for the account commands (login, whoami, org). generate and sync resolve theirs through stet.config.ts and STET_ORIGIN instead.
  • The session token is stored at ~/.config/stet/auth.json ($XDG_CONFIG_HOME/stet/auth.json when set) with 0600 permissions. Run stet logout to remove it.

Development

This package lives in the Stet monorepo under published/cli and is built with vp pack (Vite+). Releases are versioned with Changesets and published from CI.

vp install
vp run cli#build

The stet bin is bin/stet.mjs, a committed launcher that defers to the bundled dist/index.mjs. It exists so pnpm can link the bin at install time inside the monorepo, where dist is gitignored and only exists after the build above; before that build it exits with a message saying to run it.

License

Apache-2.0