CLI
newtui — every command and flag, for React, Vue and the plain HTML/CSS build.
One CLI serves both frameworks. It detects React or Vue during init and
records the answer in components.json; every later
command reads it from there.
npx newtui@latest initpnpm dlx newtui@latest inityarn dlx newtui@latest initbunx newtui@latest initdeno run -A npm:newtui@latest initvlx newtui@latest initvp dlx newtui@latest initnubx newtui@latest initnlx newtui@latest initupx newtui@latest init- npm
- pnpm
- yarn
- bun
- deno
- vlt
- vp
- nub
- ni
- upm
init
Reads your project and writes three things: components.json, a cn helper at
your utils alias, and the --newt-* token block appended to the global
stylesheet it found.
In a Nuxt project, init also adds a components option to nuxt.config. The
option keeps the index.ts barrels out of Nuxt’s component scan. See
Component barrels.
npx newtui@latest init
npx newtui@latest init --defaults
npx newtui@latest init --framework vue --bundler nuxt --css src/assets/css/tailwind.css
| Flag | Effect |
|---|---|
-d, --defaults |
Take every default instead of asking. |
-f, --framework |
react or vue, when detection would guess wrong. |
-b, --bundler |
nuxt or vite, for Vue projects. |
--css <path> |
The stylesheet to write the tokens into. |
--dark-selector |
Where dark tokens go: class (.dark, default), data-theme, media, or a selector. |
--skip-install |
Write the files, leave the package manager alone. |
-y, --yes |
Skip confirmations. |
Running it twice does not write the tokens twice: it looks for them in your stylesheet first and skips.
The tokens can live in a file of their own. When --css names a new file and
another stylesheet in the project already loads Tailwind, init leaves
@import "tailwindcss" out of the new file and prints the @import line to
add to your existing entry, so Tailwind is not loaded twice.
add
Writes a component and everything it is built out of.
npx newtui@latest add button
npx newtui@latest add modal badge embed
npx newtui@latest add # pick from a list
npx newtui@latest add --all
Registry dependencies are resolved before anything is written, so add modal
writes the button it is built on too. npm packages are collected across the
whole tree and installed in one pass.
| Flag | Effect |
|---|---|
-o, --overwrite |
Replace files that already exist instead of keeping them. |
-a, --all |
Add every component in the registry. |
-p, --path |
Write to this directory rather than the ui alias. |
--skip-install |
Write the files, leave the package manager alone. |
-y, --yes |
Do not ask before skipping a file that exists. |
A file already on disk is kept, not replaced: you are asked, and with --yes it
is skipped and reported.
After the files are written, add checks that your project declares every
theme name the components use. A class such as shadow-elevation-high produces
no CSS without --shadow-elevation-high in your theme, and Tailwind does not
warn about it. add lists each missing name and prints the block to paste. Run
tokens to write it for you.
Third-party registries
A name written @registry/item installs from somebody else’s registry:
npx newtui@latest add @magicui/marquee # React: the shadcn/ui directory
npx newtui@latest add @ai-elements/message # Vue: the shadcn-vue directory
npx newtui@latest view @magicui/marquee # read it first
The namespace resolves through registries in
components.json, then through the
community directory of your framework: the
shadcn/ui directory for React, the
shadcn-vue directory for Vue.
These registries are other people’s code. newt/ui does not review, host or endorse them: read what a component does before you install it.
- The item and what it depends on. A third-party component names its
dependencies bare, such as
buttonorcard, and means the shadcn component of that name. Those come from@shadcn, not from newt/ui. A file that already exists is kept, so your newt/uibuttonstays unless you pass--overwrite. - Imports.
@/registry/<style>/ui/…and its siblings are rewritten to your aliases. - Colours. These components use shadcn’s colour names, such as
bg-primary. On Tailwind v4 the first install appends one@theme inlineblock that maps each name to the--newt-*token with the same role. On Tailwind v3 the CLI says so and leaves the theme to yourtailwind.config. - Nothing outside the project. A path that is absolute or climbs with
..is refused.
list
Prints the registry.
npx newtui@latest list
npx newtui@latest list --json
npx newtui@latest list --framework vue --type registry:ui
--json is the cheapest grounding you can hand an agent — see
Using with AI.
search
list with a filter. Matches case-insensitively across name, title and
description, so a half-remembered word is enough.
npx newtui@latest search presence
npx newtui@latest search chat --json
view
Prints a component’s source without installing it — the read-only half of
add, for deciding whether you want it.
npx newtui@latest view button
npx newtui@latest view modal badge --json
info
What this project is: framework, bundler, Tailwind major, where the aliases point, which registry it reads, and which components it already has.
npx newtui@latest info
npx newtui@latest info --json
--json is what the skill and the
MCP server read, so an agent starts from facts rather than from a
guess about your layout.
mcp
Runs the MCP server over stdio, or writes the configuration an editor needs to launch it.
npx newtui@latest mcp
npx newtui@latest mcp init --client claude
See MCP server for what it exposes and which clients are supported.
diff
Compares a component you have installed against the one the registry currently ships, so an upgrade is a decision rather than a surprise.
npx newtui@latest diff button
diff also lists the theme names the registry’s version uses that your project
does not declare, the same check add runs.
tokens
Adds the theme names your stylesheet is missing, and only those.
npx newtui@latest tokens # every name in the theme
npx newtui@latest tokens app-launcher popover # only what these components use
npx newtui@latest tokens --dry-run # print the block, write nothing
A project that ran an older init, or keeps its token file by hand, can lack
names that newer components use. tokens reads your stylesheet and every file
it imports with a relative path. It then appends the missing names in the shape
your Tailwind major reads:
- Tailwind v4. An
@themeblock with the missing entries, such as--shadow-elevation-high, and the raw--newt-*variables they read. - Tailwind v3. The raw
--newt-*variables. The CLI does not edittailwind.config, so it prints thetheme.extendentries to add there.
A second run finds nothing missing and writes nothing.
| Flag | Effect |
|---|---|
--dry-run |
Print the missing names and the block, no write. |
Global flags
| Flag | Effect |
|---|---|
-c, --cwd <dir> |
Run against another directory. |
-r, --registry <url> |
Read items from another registry. NEWT_REGISTRY_URL does the same. |
--legacy |
Use the plain HTML/CSS CLI instead — see below. |
-h, --help |
Print the help. |
-v, --version |
Print the version. |
The HTML/CSS CLI
The same components exist as plain CSS with BEM class names, with no Tailwind,
no framework and no build step. That flavour ships inside the same package and
is reached through --legacy, or through the newtui-html binary.
npx newtui@latest --legacy init
npx newtui@latest --legacy add button
npx newtui@latest --legacy list
init writes newt-ui.json and copies tokens.css to
styles/newt-tokens.css; add copies a .css and an .html file per
component into components/ui, following the same dependency links as the
registry. See HTML & CSS.