Interactive vs Non-Interactive
By default, commands can run interactively when stdin/stdout are TTY-capable.
- Interactive mode prompts for missing selection, path, or package-manager input.
--yesdisables prompts and uses explicit flags/defaults.- If prompts are required but no TTY is available, commands fail with guidance to use
--yes.
create vs init
createscaffolds a new directory and then installs dependencies.initinspects an existing project, plans merges, and can dry-run those merges before applying them.- Both commands can resolve a package manager from
--pm, lockfiles, installed managers, or interactive selection.
Structured Output Phases
Current command implementations emit these sections:
createCreating a new Lattice app -> Resolving -> Scaffolding -> Configuring -> Installing -> Git -> Next Steps
initInspecting -> Planning -> Dry Run -> Applying -> Result -> Next Steps
add,remove,upgradeSelecting -> Planning -> Dry Run/Applying -> Result -> Next Steps
doctorChecking -> Summary -> Warnings -> Errors -> Recommended Commands -> Result
Dry Run Contract
In dry-run mode:
- Planned package-manager actions are printed with
[dry-run]prefix. - No dependency changes are applied.
- Output explicitly includes:
No files were changed.for the dependency commands. init --dry-runalso reports the planned file/package merge set before any confirmation step.
Examples:
Global CLI
lattice init --dry-run
lattice add dialog,toast --preset overlay --dry-run
lattice remove --preset overlay --dry-run
lattice upgrade --preset form --dry-run
Monorepo Local Script
pnpm lattice init --dry-run
pnpm lattice add dialog,toast --preset overlay --dry-run
pnpm lattice remove --preset overlay --dry-run
pnpm lattice upgrade --preset form --dry-run