Skip to content

CLI

The package includes a Node 20+ CLI. Use npx earthling-ui or bunx earthling-ui from your project.

Discover

bash
npx earthling-ui list --json
npx earthling-ui info button --json
npx earthling-ui info dialog --source --json

Discovery reads the installed version's source and reports exports, type paths, dependencies, and required helper files. Add --source when you need implementation details. The same metadata ships as earthling-ui/catalog.json.

Initialize

bash
npx earthling-ui init

The wizard creates a config with component and utility directories. Automation can write it directly:

json
{ "componentDir": "src/components", "utilsDir": "src/utils" }

Eject

bash
npx earthling-ui eject button --dry-run --json
npx earthling-ui eject button

Eject finds the nearest parent config, copies the component and its transitive source dependencies, rewrites local imports, and installs the declared dependencies with your package manager. Destinations must stay inside the configured project.

  • --dry-run: preview without writing or installing.
  • --no-install: copy files and leave dependency installation to you.
  • --overwrite: replace existing component files; customized shared utilities are preserved and reported.
  • --json: machine-readable output without prompts; failures exit nonzero.

Keep the earthling-ui/index.css import in your Tailwind stylesheet. Ejected source is yours to maintain; ensure Tailwind scans its directory.

Create a project

bash
npx earthling-ui create ssr my-app
npx earthling-ui create spa my-spa
npx earthling-ui create monorepo my-workspace

Templates also include cli and db. Omit arguments to use the interactive setup.

CLI — Earthling UI