wensity 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -40
- package/dist/index.js +2289 -647
- package/package.json +25 -12
package/README.md
CHANGED
|
@@ -1,63 +1,192 @@
|
|
|
1
1
|
# Wensity CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The command line tool for [Wensity](https://ui.wensity.com). Install React
|
|
4
|
+
components, UI primitives, and shareable Tailwind CSS presets into your project
|
|
5
|
+
as source code you own.
|
|
6
|
+
|
|
7
|
+
There is no `@wensity/ui` runtime dependency and no theme provider to wire up.
|
|
8
|
+
Everything the CLI installs lands in your repository as plain files you can read,
|
|
9
|
+
edit, and commit.
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/wensity)
|
|
12
|
+
[](./LICENSE)
|
|
13
|
+
|
|
14
|
+
[Docs](https://ui.wensity.com/docs/cli) ·
|
|
15
|
+
[Components](https://ui.wensity.com/components) ·
|
|
16
|
+
[Preset studio](https://ui.wensity.com/create-preset) ·
|
|
17
|
+
[Registry](https://github.com/wensity/registry) ·
|
|
18
|
+
[wensity.com](https://wensity.com)
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
4
21
|
|
|
5
22
|
```bash
|
|
6
|
-
#
|
|
23
|
+
# New project, with an app scaffold
|
|
24
|
+
npx wensity@latest init --template next
|
|
25
|
+
|
|
26
|
+
# Existing project
|
|
7
27
|
npx wensity@latest init
|
|
8
28
|
|
|
9
|
-
#
|
|
29
|
+
# Add a component
|
|
30
|
+
npx wensity@latest add button
|
|
31
|
+
npx wensity@latest add liquid-multimodal-input
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Requires Node.js 20 or later. Works with npm, pnpm, yarn, and bun. The CLI
|
|
35
|
+
picks your package manager from the client that invoked it, falling back to the
|
|
36
|
+
lockfile in your project root, and installs component dependencies with it.
|
|
37
|
+
|
|
38
|
+
## Presets
|
|
39
|
+
|
|
40
|
+
A preset is a shareable code that captures a full visual style: color palette,
|
|
41
|
+
border radius, fonts, and control colors. Build one visually in the
|
|
42
|
+
[preset studio](https://ui.wensity.com/create-preset), copy the `wsty1` code,
|
|
43
|
+
and apply it.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# New project, styled from the start
|
|
10
47
|
npx wensity@latest init --preset <wsty1-code>
|
|
11
48
|
npx wensity@latest init --preset <wsty1-code> --template next
|
|
12
49
|
|
|
13
|
-
# Existing project
|
|
50
|
+
# Existing project, style and CSS only
|
|
14
51
|
npx wensity@latest apply --preset <wsty1-code>
|
|
15
52
|
|
|
16
|
-
#
|
|
53
|
+
# See what a code contains before applying it
|
|
17
54
|
npx wensity@latest preset inspect <wsty1-code>
|
|
18
|
-
|
|
19
|
-
# Install a primitive or component
|
|
20
|
-
npx wensity@latest add button
|
|
21
|
-
npx wensity@latest add liquid-multimodal-input
|
|
55
|
+
npx wensity@latest preset inspect <wsty1-code> --json
|
|
22
56
|
```
|
|
23
57
|
|
|
24
|
-
|
|
58
|
+
Applying a preset writes two things:
|
|
59
|
+
|
|
60
|
+
1. Style settings into `wensity.json` (icon library, radius, fonts, control
|
|
61
|
+
colors).
|
|
62
|
+
2. A delimited `--primitive-*` CSS block in your Tailwind CSS file.
|
|
25
63
|
|
|
26
|
-
|
|
64
|
+
Later `add` and `update` runs read that style automatically, so newly installed
|
|
65
|
+
components match what is already there. `apply` rewrites the CSS block in place
|
|
66
|
+
and never touches your component source.
|
|
27
67
|
|
|
28
|
-
|
|
68
|
+
Plain `init` with no `--preset` refuses to overwrite an existing `wensity.json`
|
|
69
|
+
unless you pass `--force`. To restyle an existing project, prefer
|
|
70
|
+
`apply --preset`.
|
|
29
71
|
|
|
30
|
-
|
|
31
|
-
- Tabler ↔ Lucide icon imports transform at install time for **UI primitives only**
|
|
32
|
-
- Mandatory dependency swap installs exactly one icon package when icons are used
|
|
72
|
+
## Icon libraries
|
|
33
73
|
|
|
34
|
-
|
|
74
|
+
Wensity primitives are authored against [Tabler](https://tabler.io/icons). If
|
|
75
|
+
your project uses [Lucide](https://lucide.dev), set that in your preset or
|
|
76
|
+
`wensity.json` and the CLI rewrites icon imports at install time for UI
|
|
77
|
+
primitives. It installs exactly one icon package, whichever you chose.
|
|
78
|
+
|
|
79
|
+
This transform applies to UI primitives only. Larger composed components ship
|
|
80
|
+
with their icons as authored.
|
|
35
81
|
|
|
36
82
|
## Commands
|
|
37
83
|
|
|
38
|
-
| Command |
|
|
39
|
-
|
|
40
|
-
| `wensity init
|
|
41
|
-
| `wensity apply --preset <code>` | Apply
|
|
42
|
-
| `wensity preset inspect <code>` | Decode a preset code |
|
|
43
|
-
| `wensity
|
|
44
|
-
| `wensity
|
|
45
|
-
| `wensity
|
|
46
|
-
| `wensity
|
|
47
|
-
| `wensity
|
|
48
|
-
| `wensity
|
|
49
|
-
| `wensity version` | Print
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| |
|
|
56
|
-
|
|
57
|
-
|
|
|
58
|
-
|
|
|
84
|
+
| Command | What it does |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `wensity init` | Create `wensity.json` and local helper files. Optional `--preset` applies style and CSS, optional `--template` scaffolds an app |
|
|
87
|
+
| `wensity apply --preset <code>` | Apply a preset to an existing project, style and CSS only |
|
|
88
|
+
| `wensity preset inspect <code>` | Decode and print a preset code, add `--json` for machine output |
|
|
89
|
+
| `wensity list` | List registry components and blocks |
|
|
90
|
+
| `wensity add <slug...>` | Download component source into your project, skipping files that already exist |
|
|
91
|
+
| `wensity update <slug...>` | Re-download components and overwrite the local copies |
|
|
92
|
+
| `wensity login` | Save a Wensity API token for Pro component access |
|
|
93
|
+
| `wensity logout` | Remove saved credentials |
|
|
94
|
+
| `wensity whoami` | Verify the saved token and print the account and plan |
|
|
95
|
+
| `wensity version` | Print the CLI version |
|
|
96
|
+
|
|
97
|
+
Useful flags:
|
|
98
|
+
|
|
99
|
+
| Flag | Effect |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| `--template next\|vite\|astro\|react-router` | Scaffold a new app during `init` |
|
|
102
|
+
| `--type component\|block` | Narrow `list`, `add`, and `update` |
|
|
103
|
+
| `--api-url <url>` | Point at a different Wensity origin, defaults to `https://ui.wensity.com` |
|
|
104
|
+
| `--force` | Allow `init` to overwrite an existing `wensity.json` |
|
|
105
|
+
| `--json` | Machine readable output where supported |
|
|
106
|
+
|
|
107
|
+
## Authentication
|
|
108
|
+
|
|
109
|
+
Free components need no account. Wensity Pro components and blocks require an
|
|
110
|
+
API token from the [dashboard](https://ui.wensity.com/dashboard).
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npx wensity@latest login
|
|
114
|
+
npx wensity@latest whoami
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The token is written to `~/.config/wensity/credentials.json` with `0600`
|
|
118
|
+
permissions. The location honours `XDG_CONFIG_HOME`, and can be overridden with
|
|
119
|
+
`WENSITY_CONFIG_HOME` or `WENSITY_CREDENTIALS_FILE`. Access is checked server
|
|
120
|
+
side on every request, so the token is the only secret involved and it never
|
|
121
|
+
leaves your machine except as a bearer header to the Wensity API.
|
|
122
|
+
|
|
123
|
+
Run `wensity logout` to delete it.
|
|
124
|
+
|
|
125
|
+
## Wensity CLI or the shadcn CLI
|
|
126
|
+
|
|
127
|
+
Free Wensity components are published to a public shadcn registry, so you can
|
|
128
|
+
install them with either tool. Use whichever fits your project.
|
|
129
|
+
|
|
130
|
+
| | Wensity CLI | shadcn CLI with `@wensity/*` |
|
|
131
|
+
| --- | --- | --- |
|
|
59
132
|
| Full editable source | Yes | Yes |
|
|
60
|
-
| `@wensity/ui` runtime | Never | Never |
|
|
61
|
-
|
|
|
133
|
+
| `@wensity/ui` runtime dependency | Never | Never |
|
|
134
|
+
| Stored presets and `wensity.json` style | Yes | No |
|
|
135
|
+
| Lucide delivery | Yes, via icon transform | No, payloads are Tabler canonical |
|
|
136
|
+
| Project scaffolding (`--template`) | Yes | No |
|
|
137
|
+
| Wensity Pro components | Yes, with a token | Not published |
|
|
138
|
+
|
|
139
|
+
The public registry lives at [wensity/registry](https://github.com/wensity/registry):
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx shadcn@latest add @wensity/button
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Configuration
|
|
146
|
+
|
|
147
|
+
`wensity.json` sits at your project root, next to `package.json`. The CLI
|
|
148
|
+
looks for it from the current directory upward and stops at the first
|
|
149
|
+
`package.json`, so a `wensity.json` belonging to a parent folder is never used.
|
|
150
|
+
It never treats your home directory as a project. Without a `wensity.json`, the
|
|
151
|
+
default paths follow the `@/*` alias in `tsconfig.json`: `./*` puts components in
|
|
152
|
+
`components/wensity`, and `./src/*` puts them in `src/components/wensity`.
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"$schema": "https://ui.wensity.com/schema/wensity.json",
|
|
157
|
+
"version": 1,
|
|
158
|
+
"registry": "https://ui.wensity.com/api/registry",
|
|
159
|
+
"components": "src/components/wensity",
|
|
160
|
+
"utils": "src/lib/utils",
|
|
161
|
+
"tailwind": {
|
|
162
|
+
"config": "tailwind.config.ts",
|
|
163
|
+
"css": "src/app/globals.css"
|
|
164
|
+
},
|
|
165
|
+
"aliases": {
|
|
166
|
+
"components": "@/components/wensity",
|
|
167
|
+
"utils": "@/lib/utils"
|
|
168
|
+
},
|
|
169
|
+
"style": {
|
|
170
|
+
"iconLibrary": "tabler",
|
|
171
|
+
"radius": "medium"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`init` also records a `style` block with fonts and control colors, which is
|
|
177
|
+
what `--preset` overwrites. Paths and aliases are read on every `add` and
|
|
178
|
+
`update`, so you can relocate the components directory and the CLI follows.
|
|
179
|
+
|
|
180
|
+
## Source and issues
|
|
181
|
+
|
|
182
|
+
The CLI is open source at [wensity/cli](https://github.com/wensity/cli), MIT
|
|
183
|
+
licensed. Issues and pull requests are welcome there.
|
|
184
|
+
|
|
185
|
+
For a bug in a component's source rather than the CLI itself, open an issue on
|
|
186
|
+
[wensity/registry](https://github.com/wensity/registry) instead.
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT. See [LICENSE](./LICENSE).
|
|
62
191
|
|
|
63
|
-
|
|
192
|
+
Copyright (c) 2026 Wensity Private Limited.
|