CLI
Use the CLI to initialize your project, inspect the registry, and add components.
Usage
Commands
initset up Glass UI in an existing projectaddcopy components from the registry into your applistlist all available registry componentsinfoinspect one component before adding itdoctordiagnose local setup issues
init
Initialize Glass UI in an existing project.
npx @glass-ui-kit/cli@latest initOptions
| Option | Description |
|---|---|
-y, --yes | Skip 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 |
--force | Overwrite generated files if they already exist |
--no-install | Skip dependency installation |
Notes
- Writes or updates
glass.config.json, shared utils, and base styles. --frameworkoverrides autodetection.- Use
--forceonly when you want generated files rewritten.
add
Add one, many, or all registry components to your project.
npx @glass-ui-kit/cli@latest add cardOptions
| Option | Description |
|---|---|
--all | Add all available components |
--overwrite | Replace existing component files |
--path <dir> | Use a custom output directory |
--no-install | Skip dependency installation |
--deps-only | Install dependencies without writing component files |
--cwd <path> | Run the command against another project directory |
Notes
- Run
initfirst soglass.config.jsonexists. --pathoverrides the configured components alias for this run.- Invalid combinations include passing names with
--all, or--deps-onlywith--no-install.
list
List available Glass UI registry components.
npx @glass-ui-kit/cli@latest listOptions
| Option | Description |
|---|---|
--json | Output the validated registry payload as JSON |
Notes
listreads from the remote registry and does not need a local project.- Default output prints component names in registry order.
info
Show details for a single registry component.
npx @glass-ui-kit/cli@latest info cardOptions
| Option | Description |
|---|---|
--json | Output the validated registry item as JSON |
Notes
- Component lookup uses the exact registry name.
- Useful for checking dependencies, files, and metadata before
add.
doctor
Diagnose whether a project is ready to use the Glass UI CLI.
npx @glass-ui-kit/cli@latest doctorOptions
| Option | Description |
|---|---|
--cwd <path> | Run the command against another project directory |
--json | Output the diagnostic report as JSON |
Notes
doctorinspects project state without changing files.- Useful when
initoraddis failing because config, aliases, or CSS paths look wrong.