Lattice reference

CLI

The lattice CLI scaffolds rbxts/react projects and manages @lattice-ui packages, their peers, and providers.

lattice-ui Stable direction import lattice

The lattice CLI is a Node tool for Lattice UI projects. It scaffolds new rbxts/react games, installs primitive packages together with their required peers and providers, and audits an existing project for missing dependencies. It is published to npm as lattice-ui and exposes two equivalent binaries: lattice and lattice-ui.

Use the CLI when you want package selection, peer resolution, and project health checks handled for you instead of editing package.json by hand.

Running the CLI

The CLI requires Node 20+. Run it on demand with npx — no install needed:

Terminal window
npx lattice-ui <command> [options]

Or install it globally to get the shorter lattice binary:

Install with pnpm
pnpm add lattice-ui
Terminal window
npm i -g lattice-ui
lattice <command> [options]

Both binaries (lattice and lattice-ui) run the same program. Run lattice help for the built-in usage summary or lattice version to print the installed version.

Commands

CommandPurpose
createScaffold a new project from the rbxts template.
initAdd Lattice to an existing project.
addInstall component packages plus their peers and required providers.
removeRemove selected component packages.
upgradeUpgrade installed @lattice-ui/* packages.
doctorAudit lockfiles, peers, and provider expectations.
help / versionPrint usage or the CLI version.

create

Scaffolds a new project into an optional [project-path] (defaults to the current directory) from the rbxts template.

Terminal window
npx lattice-ui create my-game --pm npm --git --no-lint
Prop Type Description
[project-path] positional Target directory for the new project. At most one is accepted; defaults to the current directory.
--yes flag Accept defaults and skip interactive prompts.
--pm <pnpm | npm | yarn> Force a package manager instead of auto-detecting one.
--git flag Initialize a git repository in the new project.
--template <rbxts> Project template to scaffold from. Currently rbxts.
--lint flag Include the lint setup. Conflicts with --no-lint.
--no-lint flag Skip the lint setup. Conflicts with --lint.

init

Initializes Lattice inside an existing project. Unlike create, it accepts no positional path and no --git/--no-lint flags, and it supports --dry-run.

Terminal window
npx lattice-ui init --dry-run
Prop Type Description
--yes flag Accept defaults and skip prompts.
--dry-run flag Show what would change without writing files.
--pm <pnpm | npm | yarn> Force a package manager instead of auto-detecting one.
--template <rbxts> Template to initialize from.
--lint flag Include the lint setup.

add

Installs one or more component packages along with everything they need. Pass component names directly (comma- or space-separated) and/or --preset groups. With no names or presets and without --yes, add prompts you to pick presets and components interactively.

Terminal window
npx lattice-ui add dialog,toast --preset overlay

For each selected component the CLI gathers its npm package, its peers (@rbxts/react, @rbxts/react-roblox), and any required providers, then installs the set minus whatever is already present. Optional providers are reported as suggestions but not installed. After a real run it points you at doctor.

Prop Type Description
[name...] positional Component names to add. Comma-separated lists are split (e.g. dialog,toast).
--preset <preset...> Add every component in a preset. Repeatable and comma-separated.
--pm <pnpm | npm | yarn> Force a package manager instead of auto-detecting one.
--yes flag Skip the install confirmation prompt.
--dry-run flag Print the planned install command without changing anything.

remove

Removes the selected component packages. Accepts the same selection inputs and flags as add.

Terminal window
npx lattice-ui remove dialog --dry-run
Prop Type Description
[name...] positional Component names to remove (comma- or space-separated).
--preset <preset...> Remove every component in a preset.
--pm <pnpm | npm | yarn> Force a package manager.
--yes flag Skip the confirmation prompt.
--dry-run flag Preview the changes without applying them.

upgrade

Upgrades installed @lattice-ui/* packages. Same selection inputs and flags as add and remove.

Terminal window
npx lattice-ui upgrade --dry-run
Prop Type Description
[name...] positional Specific packages to upgrade. Omit to consider all installed @lattice-ui packages.
--preset <preset...> Upgrade every component in a preset.
--pm <pnpm | npm | yarn> Force a package manager.
--yes flag Skip the confirmation prompt.
--dry-run flag Preview the upgrade without applying it.

doctor

Audits the project and reports issues without changing anything. It checks for a missing or duplicated lockfile, a packageManager field that disagrees with the resolved manager, whether any @lattice-ui component packages are installed, unknown @lattice-ui packages, and missing peers or providers. Missing required providers are errors (non-zero exit); everything else is a warning. It finishes with recommended commands.

Terminal window
npx lattice-ui doctor
Prop Type Description
--pm <pnpm | npm | yarn> Force the package manager used for the audit instead of auto-detecting.

Presets

Presets are named bundles of components so you can install a related set in one go with --preset.

PresetComponents
overlaypopover, tooltip, dialog, toast
formcheckbox, radio-group, switch, text-field, textarea

Package manager resolution

When --pm is omitted, the CLI resolves a package manager automatically from the project lockfile or installed managers, and pass --pm <pnpm|npm|yarn> to override that choice. doctor surfaces resolution problems: a missing lockfile, multiple lockfiles, or a packageManager field that does not match the resolved manager.

Dry runs

init, add, remove, and upgrade all accept --dry-run. A dry run prints the exact package-manager command it would run and reports that no files were changed, which is the safest way to preview a change before committing to it.