Skip to content

Repository files navigation

Wensity CLI

The command line tool for Wensity. Install React components, UI primitives, and shareable Tailwind CSS presets into your project as source code you own.

There is no @wensity/ui runtime dependency and no theme provider to wire up. Everything the CLI installs lands in your repository as plain files you can read, edit, and commit.

npm license

Docs · Components · Preset studio · Registry · wensity.com

Terminal recording: wensity init applies a preset, then wensity add installs a component into the project

Quick start

# New project, with an app scaffold
npx wensity@latest init --template next

# Existing project
npx wensity@latest init

# Add a component
npx wensity@latest add button
npx wensity@latest add liquid-multimodal-input

Requires Node.js 20 or later. Works with npm, pnpm, yarn, and bun. The CLI picks your package manager from the client that invoked it, falling back to the lockfile in your project root, and installs component dependencies with it.

Presets

A preset is a shareable code that captures a full visual style: color palette, border radius, fonts, and control colors. Build one visually in the preset studio, copy the wsty1 code, and apply it.

# New project, styled from the start
npx wensity@latest init --preset <wsty1-code>
npx wensity@latest init --preset <wsty1-code> --template next

# Existing project, style and CSS only
npx wensity@latest apply --preset <wsty1-code>

# See what a code contains before applying it
npx wensity@latest preset inspect <wsty1-code>
npx wensity@latest preset inspect <wsty1-code> --json

Applying a preset writes two things:

  1. Style settings into wensity.json (icon library, radius, fonts, control colors).
  2. A delimited --primitive-* CSS block in your Tailwind CSS file.

Later add and update runs read that style automatically, so newly installed components match what is already there. apply rewrites the CSS block in place and never touches your component source.

Plain init with no --preset refuses to overwrite an existing wensity.json unless you pass --force. To restyle an existing project, prefer apply --preset.

Icon libraries

Wensity primitives are authored against Tabler. If your project uses Lucide, set that in your preset or wensity.json and the CLI rewrites icon imports at install time for UI primitives. It installs exactly one icon package, whichever you chose.

This transform applies to UI primitives only. Larger composed components ship with their icons as authored.

Commands

Command What it does
wensity init Create wensity.json and local helper files. Optional --preset applies style and CSS, optional --template scaffolds an app
wensity apply --preset <code> Apply a preset to an existing project, style and CSS only
wensity preset inspect <code> Decode and print a preset code, add --json for machine output
wensity list List registry components and blocks
wensity add <slug...> Download component source into your project, skipping files that already exist
wensity update <slug...> Re-download components and overwrite the local copies
wensity login Save a Wensity API token for Pro component access
wensity logout Remove saved credentials
wensity whoami Verify the saved token and print the account and plan
wensity version Print the CLI version

Useful flags:

Flag Effect
--template next|vite|astro|react-router Scaffold a new app during init
--type component|block Narrow list, add, and update
--api-url <url> Point at a different Wensity origin, defaults to https://ui.wensity.com
--force Allow init to overwrite an existing wensity.json
--json Machine readable output where supported

Authentication

Free components need no account. Wensity Pro components and blocks require an API token from the dashboard.

npx wensity@latest login
npx wensity@latest whoami

The token is written to ~/.config/wensity/credentials.json with 0600 permissions. The location honours XDG_CONFIG_HOME, and can be overridden with WENSITY_CONFIG_HOME or WENSITY_CREDENTIALS_FILE. Access is checked server side on every request, so the token is the only secret involved and it never leaves your machine except as a bearer header to the Wensity API.

Run wensity logout to delete it.

Wensity CLI or the shadcn CLI

Free Wensity components are published to a public shadcn registry, so you can install them with either tool. Use whichever fits your project.

Wensity CLI shadcn CLI with @wensity/*
Full editable source Yes Yes
@wensity/ui runtime dependency Never Never
Stored presets and wensity.json style Yes No
Lucide delivery Yes, via icon transform No, payloads are Tabler canonical
Project scaffolding (--template) Yes No
Wensity Pro components Yes, with a token Not published

The public registry lives at wensity/registry:

npx shadcn@latest add @wensity/button

Configuration

wensity.json sits at your project root:

{
  "$schema": "https://ui.wensity.com/schema/wensity.json",
  "version": 1,
  "registry": "https://ui.wensity.com/api/registry",
  "components": "src/components/wensity",
  "utils": "src/lib/utils",
  "tailwind": {
    "config": "tailwind.config.ts",
    "css": "src/app/globals.css"
  },
  "aliases": {
    "components": "@/components/wensity",
    "utils": "@/lib/utils"
  },
  "style": {
    "iconLibrary": "tabler",
    "radius": "medium"
  }
}

init also records a style block with fonts and control colors, which is what --preset overwrites. Paths and aliases are read on every add and update, so you can relocate the components directory and the CLI follows.

Development

pnpm install
pnpm typecheck
pnpm test
pnpm build

vendor/preset holds the preset codec, style schema, and icon map. It is vendored from the Wensity workspace and bundled into the published binary, so edits there are part of this repository.

Issues and pull requests are welcome. For bugs in a component's source rather than the CLI itself, open an issue on wensity/registry instead.

License

MIT. See LICENSE.

Copyright (c) 2026 Wensity Private Limited.

About

Install React components, UI primitives, and shareable Tailwind CSS presets into your Next.js project as source code you own.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages