Sync
Pull improvements into components you've already changed, without losing your edits.
Copied components normally freeze the day you copy them. The synccn CLI remembers what you installed, so later it can tell your edits apart from upstream changes and merge the two. It never writes a file without showing you the impact first and making a backup.
How it works
A snapshot at install
When you add a component, synccn stores the file exactly as installed in
.synccn/baseand its version in.synccn/manifest.json. Versions are a hash of the component's files and dependencies, so they change exactly when the component does.Three versions of each file
Your copy, the snapshot it started from, and the latest from the registry. Comparing snapshot to yours gives your edits; snapshot to latest gives the upstream changes.
A three-way merge
Changes in different places combine. Changes to the same lines are a conflict, which synccn reports instead of guessing.
Commit .synccn/manifest.json. The snapshots and backups stay local (synccn adds a .gitignore for them).
Start tracking
Install with npx @synccn/cli add. It runs the shadcn CLI for you, so files, packages and aliases are handled the same way, then records each component and everything it pulled in.
$ pnpm dlx @synccn/cli@latest add data-viewAlready installed components with shadcn add? Track them as they are. Anything that differs from the current version counts as your edits from then on.
$ pnpm dlx @synccn/cli@latest track button dialogSee what changed
$ npx @synccn/cli@latest status badge up to date 54624d0fe6 button update available · you have edits 902dfad81f → 4a1f4a04a41 update available. Preview with npx @synccn/cli update --dry-run.npx @synccn/cli diff button prints both sides line by line: what changed upstream since you installed, and what you changed. Add --upstream or --local for just one.
Update
Preview first. The report lists every file, whether it merges cleanly, and any packages or components the new version needs.
$ npx @synccn/cli@latest update --dry-runUpdate impactbutton 902dfad81f → 4a1f4a04a4 components/ui/button.tsx merged with your editsDry run: nothing written.Then run npx @synccn/cli update (or npx @synccn/cli update button for one). Files you never edited are replaced; edited ones are merged; your edits stay. New npm packages are listed with the command to install them, never installed behind your back.
Conflicts
When your edit and the upstream change touch the same lines, that file is skipped and left exactly as it was:
components/ui/button.tsx conflict: your edits and upstream touch the same lines! Skipped 1 file with conflicts: components/ui/button.tsx. Review with synccn diff, then rerun with --force to write conflict markers.Read both sides with npx @synccn/cli diff. If you want to resolve it in your editor, npx @synccn/cli update --force writes the file with git-style markers. Keep what you want and delete the rest:
<<<<<<< yours lg: "h-11 gap-2 rounded-lg px-8 text-base",======= lg: "h-12 gap-2 rounded-xl px-7 text-[15px]",>>>>>>> upstreamUndo an update
Every update that writes files backs them up first, together with the tracking state. npx @synccn/cli restore lists backups; npx @synccn/cli restore <id> puts the files and the tracking back.
Check your setup
npx @synccn/cli doctor checks React and Tailwind versions, components.json, that each alias resolves through your tsconfig paths, the @synccn registry, the synccn styles in your CSS, and that every tracked file and package is present. --fix adds the registry and styles for you; everything else comes with the exact command to run.
Limits
What sync doesn't do
"tsx": false) status and diffs still tell you what changed; review updates with npx shadcn@latest add @synccn/name --diff. Merges are line-based like git's, so edits on neighbouring lines can conflict.Every command is listed on the CLI page. What changed in each release is in the changelog.