Skip to content

Install your first item

Manteen requires Node 22.12 or newer. Install the CLI with the package manager already used by your application:

Terminal window
npm install --save-dev manteen

From the application root, inspect the initialization plan and then apply it:

Terminal window
npx manteen init --dry-run
npx manteen init

init supports Vite, Next App Router, Next Pages Router, valid Next hybrids, and framework-mode React Router. It configures Mantine’s provider, theme, core styles, a Manteen-owned package-style file, PostCSS, and TypeScript aliases while preserving the framework’s generated structure.

Install a component from the live registry:

Terminal window
npx manteen info @house/article-card
npx manteen add @house/article-card

The source is copied into your aliases and belongs to your project afterward. In manteen@0.3.0 and newer, Manteen records the source URL, ownership, installed hash, pristine-base hash, theme contribution, and package styles in the receipt-v3 manteen.lock.json. The exact pristine source for each ordinary file lives under .manteen/bases/. Commit the receipt, installed source, and .manteen/bases/ together so updates remain reproducible in every clone.

Terminal window
npx manteen diff
npx manteen diff --stat
npx manteen update @house/article-card

diff shows what changed from the pristine base to your local file, what changed upstream, and what the proposed result would change locally. By default, update performs that same three-way merge: non-overlapping local and upstream edits are preserved together.

Line diff3 remains the first merge path. If it conflicts on a .ts or .tsx file, Manteen automatically tries one conservative AST-assisted fallback for changes to distinct stable imports or exported top-level declarations. The AST only identifies exact source ranges; it never reformats output. Ambiguous or same-declaration changes remain conflicts.

If both sides changed the same text incompatibly, Manteen refuses before modifying the project; --force does not clear the conflict and conflict markers are never written. After reviewing the diff, explicitly discard local edits and reset to upstream only when that is what you intend:

Terminal window
npx manteen update @house/article-card --take-upstream

That reset also rebuilds a missing or corrupt pristine base. Files removed upstream are reported and retained by update; Manteen does not infer deletions or renames.

First discover every file proven absent from the same current registry item:

Terminal window
npx manteen remove --upstream-removed --dry-run

Then preview the exact POSIX receipt destination you intend to remove, and rerun without --dry-run only after reviewing it:

Terminal window
npx manteen remove --upstream-removed --file src/components/ui/old.tsx --dry-run
npx manteen remove --upstream-removed --file src/components/ui/old.tsx

If the local file differs from its pristine upstream base, the selection refuses as adapted. Preserve the file, or repeat the same exact selection with the additional destructive intent only when discarding that adaptation is deliberate:

Terminal window
npx manteen remove --upstream-removed \
--file src/components/ui/old.tsx \
--discard-adapted

The removal transaction covers that project file, its obsolete base, and its exact receipt record. It does not infer a rename or uninstall the item, dependencies, theme contributions, or managed styles. A real run without an exact --file refuses as usage rather than broadening the deletion.

Next, learn how to build your own registry.