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

bwsm-cli

v0.1.0

Published

`bwsm` is a Bitwarden Secrets Manager helper for monorepos.

Readme

bwsm

bwsm is a Bitwarden Secrets Manager helper for monorepos.

[!IMPORTANT] bwsm is in very early development, and is not designed for enterprise usage. This means that bugs are to be expected. Report any bugs via GitHub Issues.

Contributions are welcomed and encouraged. Just use Bun :)

Installation

Bun Package Manager:

bun install --dev bwsm-cli

NPM:

npm install -D bwsm-cli

Usage

1. Create a bitwarden.config.ts at your repository root. Define one target per app/process that should receive injected secrets.

export default {
  bootstrap: {
    // These map to existing env var names in your shell/.env files.
    accessTokenEnv: "BITWARDEN_SM_ACCESS_TOKEN",
    organizationIdEnv: "BITWARDEN_SM_ORGANIZATION_ID",
    apiUrlEnv: "BITWARDEN_SM_API_URL",
    identityUrlEnv: "BITWARDEN_SM_IDENTITY_URL",
  },
  runtime: {
    // Optional. Defaults shown.
    stateDir: ".cache/bitwarden-sm/state",
    persistState: true,
  },
  targets: {
    "@project/app1": {
      // Include at least one Bitwarden project ID.
      projectIds: ["00000000-0000-0000-0000-000000000001"],
      // Optional explicit key allowlist (in addition to project matches).
      includeKeys: [],
      // Optional denylist (always removed).
      excludeKeys: [],
    },
    "@project/app2": {
      projectIds: ["00000000-0000-0000-0000-000000000002"],
      includeKeys: [],
      excludeKeys: [],
    },
  },
} as const;

2. Provide bootstrap env vars. Set these in your shell, .env, or .env.local:

BITWARDEN_SM_ACCESS_TOKEN=
BITWARDEN_SM_ORGANIZATION_ID=
BITWARDEN_SM_API_URL=https://api.bitwarden.com
BITWARDEN_SM_IDENTITY_URL=https://identity.bitwarden.com

Precedence is: explicit process env > .env.local > .env.

3. Run commands with bwsm. Use bwsm run to inject secrets into a child process environment and execute your command. Add those inside each app's package.json scripts.

# General form
bwsm run --target <target> -- <command> [args...]

# Node app
bwsm run --target @project/app1 -- node apps/app1/server.js

# Bun app
bwsm run --target @project/app1 -- bun run --cwd apps/app1 dev

# Package script
bwsm run --target @project/app1 -- npm run -w @project/app1 dev

bwsm run injects matched secrets plus:

  • BWSM_ENV_HASH
  • BWSM_TARGET

Optional runtime flags:

bwsm run --target @project/app1 --state-dir .cache/custom-bwsm --persist-state -- node app.js
bwsm run --target @project/app1 --no-persist-state -- node app.js

4. Diagnose target setup with doctor. doctor validates one target end-to-end and reports stage-by-stage status:

bwsm doctor --target @project/app1
bwsm doctor --target @project/app1 --state-dir .cache/custom-bwsm --no-persist-state

What doctor does:

  1. Checks workspace/config discovery.
  2. Confirms target exists.
  3. Validates required bootstrap env vars.
  4. Resolves runtime state path/options.
  5. Attempts SDK login/sync.
  6. Validates org match and secret selection.

doctor prints key names/counts and resolved paths, but never secret values.

5. Clear local SDK state with logout. logout is local cache cleanup for a target state file:

bwsm logout --target @project/app1
bwsm logout --target @project/app1 --state-dir .cache/custom-bwsm

What logout does:

  1. Resolves the target-specific state file path.
  2. Deletes that file if it exists.
  3. Prunes the state directory if empty.
  4. Succeeds even if the file did not exist.

logout does not revoke tokens in Bitwarden; it only removes local persisted state.