Elements CLI
The Elements CLI provides command-line access to the Elements design system. Use it to scaffold new projects pre-configured with Elements, look up component APIs and design tokens, validate templates, and generate shareable playgrounds -- all without leaving your terminal
Install CLI
Install the Elements CLI to your system. This will add the nve command to your path and provide several helpful commands for working with Elements.
curl -fsSL https://nvidia.github.io/elements/install.sh | bash
curl -fsSL https://nvidia.github.io/elements/install.cmd -o install.cmd && install.cmd && del install.cmd
# install the CLI
npm install -g @nvidia-elements/cli
Usage
Project Creation
Use the CLI to quickly bootstrap frontend UIs pre-configured with Elements.
# generate a vite/typescript project and start dev server once created
nve project.create --type=typescript --start
API Search
The CLI also can provide API search results withing the terminal.
nve api.search "badge"
Search result output:
## nve-badge
A visual indicator that communicates a status description of an associated component. Status badges use short text, color, and icons for quick recognition .
### Example
<nve-badge>badge</nve-badge>
### Import
import '@nvidia-elements/core/badge/define.js';
### Slots
┌─────────────┬──────────────────────────┐
│ name │ description │
├─────────────┼──────────────────────────┤
│ │ default slot for content │
├─────────────┼──────────────────────────┤
│ prefix-icon │ slot for prefix icon │
├─────────────┼──────────────────────────┤
│ suffix-icon │ slot for suffix icon │
└─────────────┴──────────────────────────┘
...
Commands
nve --upgradenve api.list [format]nve api.search <query> [format]nve api.get <names> [format]nve api.template.validate <template>nve api.imports.get <template>nve api.tokens.list [format]nve packages.listnve packages.get <name>nve packages.changelogs.get <name> [format]nve examples.list [format]nve playground.validate <template>nve playground.create <template> [type] [name] [author]nve project.create <type> [cwd] [start]nve project.validate <type> [cwd]nve project.setup [cwd]Troubleshooting
403 Forbidden
A 403 Forbidden error means your token has expired. Re-authenticate to resolve it.
npm config set registry https://registry.npmjs.org && npm login --auth-type=legacy
Unsupported Engine
An Unsupported engine warning means your Node.js version is out of date. The CLI requires Node.js v20 or later. Update Node.js and try again.