prismrepo add
Install one or more primitives or field components into your project.
npx prismrepo add text-field [--force] [--dry-run] [--no-install]What it does
Installs the named item(s) plus every Layer 1 primitive they depend on. add text-field also
installs input and label, since TextField wraps both. It writes each file into your
configured uiDir/fieldsDir (set by init, or defaulted), with its import
alias rewritten to your configured path, updates registry.ts through an AST-aware edit
(ts-morph, not text/regex replacement, see Generated Files), and
reports, then by default installs, whatever npm dependencies are missing.
Install several items in one call:
npx prismrepo add number-field select-field checkbox-field date-fieldAvailable catalog items
input, label, select, checkbox (Layer 1 primitives), and text-field, number-field,
select-field, checkbox-field, date-field (Layer 2 field components). Run
prismrepo list to see the current catalog and installation status.
Flags
| Flag | Effect |
|---|---|
--force | Overwrite a file prismrepo can't prove is untouched. |
--dry-run | Preview every file and dependency change without writing or installing anything. |
--no-install | Report missing npm dependencies instead of installing them. |
Safe re-runs
Every installed file carries a content-hash marker. Re-running add for an already-installed
item:
- Is a no-op if you never touched the file (or a clean update, if Prism shipped a newer template).
- Is refused, with an explanation naming the exact file, if you edited it since it was
installed. Pass
--forceonly if you actually want to discard your edits.
This is the same safety guarantee whether the item is already installed or not: prismrepo
never silently overwrites a file it can't prove is untouched.