Usage
facets.json and immediately installs them into every connected adapter. There is no separate “install after add” step — facet add is the single command for bringing a new facet into a project.
Every source specifier is validated first. If the project then has no adapters installed, facet add launches the adapter picker — but only when the terminal can prompt. Otherwise it exits with an error pointing at facet adapter install.
Examples
facets.json — is in the source grammar below.
Flags
boolean
Show detailed step output on stderr.
Exit codes
What it does
1
Parse
Validate every source specifier up front. Invalid grammar exits before touching disk.
2
Discover adapters
If none installed: launch the picker when the terminal can prompt, or fail with recovery guidance when it cannot.
3
Prepare
Read each source’s
facet.json to learn its name. Sources that declare a non-empty facets: [...] array are rejected. Load the project manifest if it exists.4
Commit
Delegate to the install pipeline with the additions delta. Version resolution, integrity verification, global collision detection, and the atomic write follow the commit phase — additions always re-resolve non-exact specifiers, and new lockfile entries require registry confirmation (fails closed offline).Adding a facet is the most common way to hit a name collision: the new facet may want a name an installed facet already uses. See Name collisions for how that is resolved and what gets recorded.
Source grammar
facet add accepts these source forms (the normative source-kind taxonomy lives in Planning — Accepted source kinds):
Registry names
Git and GitHub sources
Local paths
Forms that are rejected
Re-adding a facet
Runningfacet add against a facet that’s already in facets.json is supported:
- Same source as before → no-op (lockfile may report
unchangedorrepaired). If you have since aliased or omitted one of its assets, it reportsupdatedinstead — the version did not move, but its materialization did. - Different version pin → updates the entry; the install summary shows
(was X → Y). - Bare re-add (no version) → resolves the newest published version and pins it in
facets.json. A bare add always pins to the resolved exact version, even over an existing wildcard spec. - Explicit
@latest/wildcard re-add → re-resolves to the newest match (the lockfile never pins an explicit non-exact add), but the specifier itself is written verbatim and keeps floating.
See also
facet install— re-runs the install pipeline against the currentfacets.jsonand lockfile, useful after a freshgit cloneor to reapply assets after manual edits.facet adapter install— install adapters into your machine.