@termuijs/cli
@termuijs/cli adds TermUI components to your project. It copies the component source into your codebase and installs the packages that component needs. You own the code after that and edit it like any other file.
Add a component
CODE
npx termuijs@latest add spinnerThis does three things:
- Resolves
spinnerin the registry athttps://termui.io/r/spinner.json. - Writes the source to
src/components/spinner/spinner.ts. - Installs the
@termuijs/*packages the source imports.
Add several at once:
CODE
npx termuijs@latest add progress-bar tableList components
CODE
npx termuijs@latest listPrints every component in the registry with its description.
Interactive picker
Run add with no name to pick from a list:
CODE
npx termuijs@latest addThe picker uses @termuijs/widgets, so the CLI runs on the same engine it installs.
Flags
| Flag | Default | Description |
|---|---|---|
--dir <path> | src/components | Destination root for the copied files. |
--dry-run | off | Print what would be written and installed. Write nothing. |
--yes, -y | off | Overwrite an existing component folder without asking. |
Other package managers
add and list work through any runner:
CODE
bunx termuijs add spinner
pnpm dlx termuijs add spinner
yarn dlx termuijs add spinnerThe CLI detects your package manager from the environment and installs dependencies with it.
Was this page helpful?