Add a Primitive
solidiom add installs a primitive into your project, either as an npm package or as materialized source files.
Basic Usage
solidiom add dialogThis resolves the dependency graph for dialog and outputs the npm install command. In package mode, it prints the command without running it by default.
Package Mode vs Source Mode
Package mode (default): Resolves the capability graph and outputs the appropriate npm install, pnpm add, or yarn add command for all required packages. The CLI detects your package manager automatically.
solidiom add dialog --mode packageSource mode: Materializes source files directly into your project at the configured sourceDir. It handles import rewriting, runtime deduplication, and lockfile tracking.
solidiom add dialog --mode sourceFlags
| Flag | Description |
|---|---|
--mode | Install mode: package or source |
--registry | Custom registry URL for package resolution |
--no-network | Use only cached or local registry data |
--deliverable | Product-layer deliverable: primitive, component, block, template, theme |
--styling | Styling profile: css, tailwind, unocss |
--package-manager | Override package manager detection (npm, pnpm, yarn, bun) |
--install | Run the install command instead of only printing it |
--allow-unverified | Proceed with source install even if byte-level verification fails |
--force | Overwrite files modified locally since last source install |
--diff | Print a unified diff of pending source-install changes without writing |
--dry-run | Show what would be done without writing |
--json | Output as JSON |
Deliverable Kinds
The --deliverable flag requests a specific product-layer output:
primitive— Core primitive with its adapters and runtimecomponent— Composited component with styling, installed intocomponentDirblock— Domain-aware block with layout and state, installed intoblockDirtemplate— Full project templatetheme— Theme package, installed intothemeDir
Styling Profiles
Use --styling to request a specific styling output:
css— CSS custom properties and utility classestailwind— Tailwind CSS utility classesunocss— UnoCSS utility classes
Conflict Handling
In source mode, if locally modified files would be overwritten, the install is blocked with remediation hints:
Blocked — locally modified files would be overwritten:
✗ src/ui/primitives/dialog/Dialog.tsxOptions to resolve conflicts:
solidiom add dialog --mode source --diff— Preview pending changes before applyingsolidiom add dialog --mode source --force— Overwrite locally modified filessolidiom diff dialog— Review all changes between installed source and lockfile
Verification Bypass
By default, source installs require byte-level verification against the registry manifest. If verification fails, you can bypass with --allow-unverified. The lockfile records the entry with provenance: "unverified" so it can be audited later.
solidiom add dialog --mode source --allow-unverifiedPackage Manager Detection
The CLI auto-detects your package manager by looking for lock files (pnpm-lock.yaml, yarn.lock, bun.lockb) or configuration files. Override with --package-manager:
solidiom add dialog --install --package-manager pnpmPass --install to actually run the install command rather than just printing it.