Ghostcn
Skip to Content
Guides

Review component updates

Compare installed, local, and incoming code before replacing a copied component.

Updating the npm CLI does not rewrite copied components. Commit your theme, then review before re-adding:

npx ghostcn@1.4.0 diff
npx ghostcn@1.4.0 diff pricing-table --latest
npx ghostcn@1.4.0 diff pricing-table --json

diff is read-only. It uses the bundled or configured registry by default. --latest explicitly checks the remote registry, which may be ahead of npm; it fails if the remote comparison is unavailable. JSON output includes installed, local, and incoming content for three-way review.

Files can be unchanged, upstream-changed, locally-modified, conflicted, missing, untracked, or removed-upstream. Keep .ghostcn/installed.json with your theme to retain baselines. A legacy copy without a baseline is untracked, not necessarily safe to overwrite.

Choose how to reinstall

npx ghostcn@1.4.0 add button card --skip-existing
  • Preserve existing files: use --skip-existing. Ghostcn keeps existing files and installs what’s missing.
  • Decide interactively: Enter or N keeps the component and continues; Y replaces the requested component’s files. Ctrl+C cancels remaining work without rolling back prior installs.
  • Replace deliberately: --yes overwrites the requested component. It is not a merge. Existing dependency files are preserved.

Without an interactive terminal, the CLI preserves existing files and prints directions. Reinitializing regenerates tokens, so retain your chosen palette and paths. Merge changes manually when you need to keep direct partial or CSS edits.

Edit this page on GitHub

Was this helpful?

On this page