CLI Commands

Command signatures, behavior rules, and edge cases for create/init/add/remove/upgrade/doctor.

On this page

Global Options

  • --help
  • --version

create

Command

create: Create a new project from the rbxts template.

Shell
lattice create [project-path] [--yes] [--pm <pnpm|npm|yarn>] [--git] [--template rbxts] [--lint] [--no-lint]

Supported flags

  • --yes
  • --pm
  • --git
  • --template
  • --lint
  • --no-lint

Behavior:

  • [project-path] is optional in interactive mode.
  • In --yes mode, [project-path] is required.
  • --lint and --no-lint are mutually exclusive.
  • --template currently supports only rbxts.
  • Generated projects include lattice-ui in devDependencies.

init

Command

init: Initialize Lattice in an existing project.

Shell
lattice init [--yes] [--dry-run] [--pm <pnpm|npm|yarn>] [--template rbxts] [--lint]

Supported flags

  • --yes
  • --dry-run
  • --pm
  • --template
  • --lint

Observed output phases

  • Inspecting
  • Planning
  • Dry Run
  • Applying
  • Result
  • Next Steps

Behavior:

  • init runs only inside an existing project root that already has a package.json.
  • --dry-run prints planned file/package changes and does not mutate the repo.
  • --lint opts into ESLint + Prettier during init; otherwise interactive mode asks.
  • Package-manager resolution uses --pm, lockfiles, installed managers, or interactive selection.

add

Command

add: Install component packages and their required peers.

Shell
lattice add [name...] [--preset <preset...>] [--pm <pnpm|npm|yarn>] [--yes] [--dry-run]

Supported flags

  • --preset
  • --pm
  • --yes
  • --dry-run

Observed output phases

  • Selecting
  • Planning
  • Dry Run
  • Applying
  • Result
  • Next Steps

Behavior:

  • Without names/presets, interactive mode prompts for selection.
  • With --yes, at least one component or preset must be provided.
  • Adds required peers and required providers.
  • Optional providers are reported in output but not auto-installed.

remove

Command

remove: Remove selected component packages.

Shell
lattice remove [name...] [--preset <preset...>] [--pm <pnpm|npm|yarn>] [--yes] [--dry-run]

Supported flags

  • --preset
  • --pm
  • --yes
  • --dry-run

Observed output phases

  • Selecting
  • Result
  • Next Steps
  • Planning
  • Dry Run
  • Applying

Behavior:

  • Without names/presets, interactive mode prompts from currently installed registry components.
  • With --yes, names or presets are required.
  • Missing requested components are skipped and summarized.

upgrade

Command

upgrade: Upgrade installed @lattice-ui/* packages.

Shell
lattice upgrade [name...] [--preset <preset...>] [--pm <pnpm|npm|yarn>] [--yes] [--dry-run]

Supported flags

  • --preset
  • --pm
  • --yes
  • --dry-run

Observed output phases

  • Selecting
  • Planning
  • Dry Run
  • Applying
  • Result
  • Next Steps

Behavior:

  • With no selection, interactive mode prompts from installed packages.
  • With no selection and --yes, all installed @lattice-ui/* packages are selected.
  • Preserves dependency intent (dependencies vs devDependencies) during upgrade.
  • Missing requested packages are summarized and skipped.

doctor

Command

doctor: Check lockfiles, peers, and provider expectations.

Shell
lattice doctor [--pm <pnpm|npm|yarn>]

Supported flags

  • --pm

Observed output phases

  • Checking
  • Summary
  • Warnings
  • Errors
  • Recommended Commands
  • Result

Behavior:

  • Warnings are advisory issues such as lockfile drift or optional provider gaps.
  • Errors are hard-fail conditions such as missing required providers.
  • Recommendations are emitted as package-manager-aware commands.

Common Failure Cases

  • create --yes without [project-path].
  • create --lint --no-lint flag conflict.
  • add --yes or remove --yes without explicit selection.
  • init outside a project root with package.json.
  • Unknown component or preset names.

For execution-phase details and dry-run expectations, see Execution and Output.