CLI

Use the CLI to initialize your project, inspect the registry, and add components.

Usage

glass-ui [command] [options]
npx @glass-ui-kit/cli@latest [command] [options]

Commands

  • init set up Glass UI in an existing project
  • add copy components from the registry into your app
  • list list all available registry components
  • info inspect one component before adding it
  • doctor diagnose local setup issues

init

Initialize Glass UI in an existing project.

npx @glass-ui-kit/cli@latest init
glass-ui init [options]

Options

OptionDescription
-y, --yesSkip the confirmation prompt
--cwd <path>Run the command against another project directory
--css <path>Use a custom CSS file instead of autodetecting one
--components <alias>Set the components alias saved in glass.config.json
--utils <alias>Set the utils alias saved in glass.config.json
--framework <name>Force the framework instead of autodetecting it
--forceOverwrite generated files if they already exist
--no-installSkip dependency installation

Notes

  • Writes or updates glass.config.json, shared utils, and base styles.
  • --framework overrides autodetection.
  • Use --force only when you want generated files rewritten.
glass-ui init
glass-ui init --framework next
glass-ui init --css src/app/globals.css --no-install
glass-ui init -y --components "@/components/ui" --utils "@/lib/utils"

add

Add one, many, or all registry components to your project.

npx @glass-ui-kit/cli@latest add card
glass-ui add [components...] [options]
glass-ui add --all [options]

Options

OptionDescription
--allAdd all available components
--overwriteReplace existing component files
--path <dir>Use a custom output directory
--no-installSkip dependency installation
--deps-onlyInstall dependencies without writing component files
--cwd <path>Run the command against another project directory

Notes

  • Run init first so glass.config.json exists.
  • --path overrides the configured components alias for this run.
  • Invalid combinations include passing names with --all, or --deps-only with --no-install.
glass-ui add card
glass-ui add card modal button
glass-ui add --all
glass-ui add card --overwrite
glass-ui add card --path src/components/custom
glass-ui add card --deps-only

list

List available Glass UI registry components.

npx @glass-ui-kit/cli@latest list
glass-ui list [options]

Options

OptionDescription
--jsonOutput the validated registry payload as JSON

Notes

  • list reads from the remote registry and does not need a local project.
  • Default output prints component names in registry order.
glass-ui list
glass-ui list --json

info

Show details for a single registry component.

npx @glass-ui-kit/cli@latest info card
glass-ui info <component> [options]

Options

OptionDescription
--jsonOutput the validated registry item as JSON

Notes

  • Component lookup uses the exact registry name.
  • Useful for checking dependencies, files, and metadata before add.
glass-ui info card
glass-ui info button --json

doctor

Diagnose whether a project is ready to use the Glass UI CLI.

npx @glass-ui-kit/cli@latest doctor
glass-ui doctor [options]

Options

OptionDescription
--cwd <path>Run the command against another project directory
--jsonOutput the diagnostic report as JSON

Notes

  • doctor inspects project state without changing files.
  • Useful when init or add is failing because config, aliases, or CSS paths look wrong.
glass-ui doctor
glass-ui doctor --cwd ../my-app
glass-ui doctor --json