Guide · Mado UI
CLI
Inspect, add, update and diagnose open-code UI source with the zero-dependency CLI.
Read before writing
npx @madojs/ui@latest init
npx @madojs/ui@latest list [--json]
npx @madojs/ui@latest view <item> [--json]
init creates project configuration,
list combines registry and local state,
and view prints one item's metadata
and source without installing it. Every command accepts
--cwd <path>.
Copy source deliberately
npx @madojs/ui@latest add <item...> [--dry-run]
npx @madojs/ui@latest remove <item...> [--dry-run]
npx @madojs/ui@latest migrate <explicit-item...> [--dry-run]
add resolves dependencies and applies
one atomic write plan. Existing targets stop that plan unless directly
selected with --overwrite.
remove plans removal from owned state;
migrate is an explicit compatibility
boundary, never a background rewrite.
Reconcile three states
npx @madojs/ui@latest diff [item...]
npx @madojs/ui@latest update [item...] --dry-run
npx @madojs/ui@latest update [item...]
npx @madojs/ui@latest update <explicit-item...> --overwrite
Update compares the hash recorded by the lock, the current local hash
and the current registry hash. Pristine source can advance safely;
local-only edits are preserved; if both local and upstream changed, the
complete transaction stops and points to
diff.
Conflicting customizations are replaced only by
update <explicit-item...>
--overwrite. The flag never expands to implicit dependencies, and
update --overwrite without item names
is rejected.
Diagnose project state
npx @madojs/ui@latest doctor
Doctor validates configuration, lock compatibility, copied hashes, stylesheet imports and autonomous custom-element tags. It reports actionable drift without silently changing source.
Stable and reproducible selectors
Use @latest for normal work. It selects
the current stable CLI and registry for that invocation but never
changes already copied source without an explicit command.
npx @madojs/ui@0.2.0 view panel
The exact selector above reproduces the catalog build's registry. Use exact versions only for historical reproduction; the live unversioned catalog deliberately follows the stable npm tag.