Skip to content

CLI reference

The znverse CLI installs effects and kits from the znverse registry into your project. It needs Node.js 22.13 or newer and has no runtime dependencies.

bash
npx znverse <command> [options]

Commands

add

bash
npx znverse add <effect...>

Installs one or more effects. Each name can be:

  • an effect slug, such as tilt-card;
  • a kit, such as kits/landing-page;
  • a full registry item URL, such as https://znverse.vercel.app/r/tilt-card.json.

The CLI then:

  1. downloads each item and everything it depends on;
  2. plans every file and checks for conflicts before writing anything;
  3. writes the files;
  4. installs missing npm packages;
  5. prints the import line for each effect.

list

bash
npx znverse list

Prints every installable effect with its framework and name.

login

bash
npx znverse login

Saves a personal token so add can install Pro effects. Create the token in Dashboard, Settings, CLI access; it is shown only once. The CLI asks for the token (or reads it from --token or from piped input), checks it with the registry and saves it for that registry. A revoked or mistyped token is refused and nothing is saved.

Saved tokens live in ~/.config/znverse/auth.json, or $XDG_CONFIG_HOME/znverse/auth.json when that variable is set. The folder is created with mode 0700 and the file with 0600, and each token is stored under its registry origin.

logout

bash
npx znverse logout

Removes the saved token for the current registry. Tokens saved for other registries stay.

whoami

bash
npx znverse whoami

Prints the email and plan (Free or Pro) of the token the CLI would use.

Pro effects

add works the same way for Pro effects. When an effect is not in the public registry, the CLI asks the registry's token endpoint for it with your token:

SituationResult
Your account is on ProThe effect installs like any other
Your account is on Free<effect> is a Pro effect. Get Pro at https://znverse.vercel.app/pricing
The token was revoked or is wrongYou are asked to run npx znverse login again
No token at allThe same Pro hint for a known Pro effect, otherwise the usual not-found message

The token comes from --token, then the ZNVERSE_TOKEN environment variable, then the saved login for that registry. It is sent only to the registry's own /api endpoints, only over https (or http to localhost), and never for free effects.

Options

OptionEffect
--registry <url>Use another registry, for example http://localhost:3000 while developing
--cwd <dir>Install into another folder instead of the current one
--token <token>Use this token for one command instead of the saved login
--overwriteReplace files that already exist with different content
--dry-runShow what would be written and installed, and change nothing
--skip-installDo not run the package manager; print the install command instead
--forceAllow running inside the znverse repository itself
-h, --helpShow help
-v, --versionShow the version

The registry can also be set with the ZNVERSE_REGISTRY_URL environment variable. The --registry option wins over the variable, and the variable wins over the default https://znverse.vercel.app.

Existing files

SituationResult
The file does not existIt is created
The file exists with the same contentIt is left alone and shown as same
The file exists with different contentShown as exists, and nothing at all is written unless you pass --overwrite

Because conflicts are checked before writing, a run either writes everything it planned or nothing.

Package managers

The CLI uses the package manager of your project. It looks for pnpm-lock.yaml, pnpm-workspace.yaml, bun.lock, yarn.lock or package-lock.json in the project folder and its parents, so it also works in a monorepo package. Without a lockfile it uses the package manager that ran it, and falls back to npm. Packages that are already in your package.json are skipped.

Safety

The CLI treats the registry as untrusted input:

  • Files are only written inside the effect's own folder, components/znverse/<effect>/ or public/znverse/<effect>/. It refuses paths that leave the project, hidden files such as .npmrc, and paths through symbolic links.
  • Package names must be plain names with a plain version range. Anything that looks like a flag, a URL, a git address or shell syntax is refused.
  • Registries must use https. Plain http is accepted only for localhost.
  • Text from the registry is cleaned of terminal control characters before it is printed.

Exit codes

CodeMeaning
0Success, including dry runs
1Something went wrong; the message says what and nothing was left half-written

Troubleshooting

MessageFix
Not found: …/r/<effect>.jsonCheck the slug with npx znverse list. Copy-only effects are not in the registry
<effect> is a Pro effectGet Pro, then run npx znverse login with a token from your dashboard
Your znverse token was not acceptedThe token was revoked; create a new one and run npx znverse login
No package.json foundRun the command in your app folder or pass --cwd
file(s) already exist with different contentReview the files, then re-run with --overwrite
This is the znverse repositoryRun the command in your own project