Skip to main content

update

Update installed components with the interactive merge TUI. Hunk-by-hunk conflict resolution without git markers.

Usage


npx @gentleduck/cli update [components...]

npx @gentleduck/cli update [components...]

Updates installed components to the latest registry versions. For each component whose local content differs from the current registry version, you're asked to Overwrite, Skip, or Merge; only "Merge" opens the interactive hunk-by-hunk TUI. Passing -y/--yes skips this entirely and force-overwrites every selected component - including ones with local edits.


Options

FlagDescription
-a, --allUpdate all installed components
-y, --yesSkip confirmation prompts
-c, --cwd <cwd>Working directory
-w, --workspace <path>Target workspace

The merge TUI

Opens when you pick Merge for a component. For a modified file, hunks are presented one at a time; a deleted file (registry removed it) gets its own two-way choice instead:

KeyAction
1Modified file: keep your local hunk · Deleted file: keep it
2Modified file: take the registry hunk · Deleted file: remove it
3Modified file only: keep both
h / lNavigate between files
j / k (or n / p)Navigate between hunks
N / PJump to the previous/next unresolved hunk - swapped from what you'd expect; verify against your installed CLI version before relying on it
EnterOnce every hunk is resolved: show a preview. Pressed again from the preview: write to disk
EscFrom the hunk view: abort, leave files untouched. From the preview: go back to the hunk view

No git merge markers. No manual conflict resolution. No diff tool required.


Examples

# Update a specific component
npx @gentleduck/cli update button

# Update all components
npx @gentleduck/cli update --all

# Update inside a workspace
npx @gentleduck/cli update --all --workspace packages/ui

When you're not prompted at all

  • -y/--yes passed: every selected component is force-overwritten with the registry version, no diff check, no prompt - local edits are lost silently.
  • Local content already matches the current registry version: nothing to resolve, it's just updated.

Otherwise, any component whose local files differ at all from the current registry version triggers the Overwrite/Skip/Merge prompt - including one you never edited yourself, if the registry has simply moved on since you installed it. The CLI diffs your local copy against the latest registry content; it keeps no record of what you originally installed, so it can't distinguish "you changed this" from "upstream changed since you installed it."


Diff first, update second

To preview changes before running update, use diff:


npx @gentleduck/cli diff button   # see what would change

npx @gentleduck/cli diff button   # see what would change