Skip to content
Lenso UI

CLI

Use the source candidate to inspect contracts and review safe consumer setup plans.

Build the source candidate

The package is @lenso/cli, with the lenso binary. It is currently unpublished. In a candidate checkout with workspace dependencies installed, prepare docs and then build the CLI:

pnpm --filter @lenso/ui-docs buildpnpm --filter @lenso/cli buildnode packages/cli/dist/cli.mjs --help

The build validates and copies the current production contract. A built or packed candidate runs without the monorepo, React, Next or a TypeScript/StyleX compiler. Use the Node range reported in contract compatibility; Node 24.18.0 is the tested runtime.

Read the release contract

node packages/cli/dist/cli.mjs metadata --jsonnode packages/cli/dist/cli.mjs list --jsonnode packages/cli/dist/cli.mjs info menu --jsonnode packages/cli/dist/cli.mjs docs react/components/menu --locale cn

metadata reports release identity and digest. list supplies canonical family slugs and public parts. info resolves actual signatures, callback state and property rows. docs prints the same authored Markdown as the documentation page's Copy Markdown action.

The current commands are list, info, docs, metadata, check and init. The CLI does not expose a separate example-download, theme-generation or remote-fetch command. Use the matching binary's --help rather than assuming another tool's options.

Check a consumer

node packages/cli/dist/cli.mjs check --cwd ./my-app --json

check reads consumer source and reports policy, compatibility and static setup hints. It does not execute application code or prove browser stylesheet delivery. Skipped symlinks, oversized files and unresolved source are reported; a nonzero result requires review.

Review setup before writing

node packages/cli/dist/cli.mjs init --framework vite --cwd ./my-app --json

init is a dry run. Review the proposed files, conflicts and manual theme-entry step. --framework next selects the supported App Router Webpack setup, not Turbopack or Pages Router.

Add --write only when you intend to apply a conflict-free, still-current plan. The writer preserves package fields and refuses incompatible pins, complex scripts and user-owned configuration. A generated file that you edit becomes user-owned.

The CLI never installs dependencies or runs project scripts. It creates metadata and theme helpers, but you must import the theme helper from the actual rendering entry or layout. An I/O failure can leave a partial write; inspect the plan and filesystem before retrying.