Skip to main content

gentleduck/cli

CLI for initializing projects, adding components, managing themes, and updating with an interactive merge TUI.

Loading diagram...

What this CLI does

Most component CLIs only add components. gentleduck/cli also updates them with an optional interactive merge, removes installed source files, diffs them against the registry (plain text by default, or an interactive TUI), and manages theme tokens.

The update command matters most. When a component you've updated has local modifications, the CLI asks whether to overwrite, skip, or merge it; picking merge opens an interactive screen in your terminal where each change appears as a hunk and you choose per-hunk what to keep:

  • Press 1 to keep your local version
  • Press 2 to take the registry version
  • Press 3 to keep both
  • Navigate with h/l between files, j/k between hunks
  • Press N/P to jump to the next/previous unresolved hunk
  • Preview the merged result before writing
  • Press Enter to confirm, Esc to abort

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

Featuregentleduck/clishadcn CLI
initYesYes
addYesYes
diffColorized unified diff by default; --gui opens a scrollable/side-by-side TUIPlain text diff
update with mergeOptional interactive hunk-by-hunk merge TUI (opt in per component)Not available
removeDeletes installed component source (npm deps are left in place)Not available
listFilter by type, JSON outputNot available
themeList, inspect, install themes from registryNot available
Template scaffolding--template flag for full project scaffoldNot available
Monorepo support--monorepo flag, workspace-aware configNot available

Install

bun add -D @gentleduck/cli
# or
npm install -D @gentleduck/cli

Commands

CommandWhat it does
initInitialize project config, optionally install components
addInstall components from the registry
updateUpdate installed components with the interactive merge TUI
removeDelete installed component source files
diffShow diffs between local copies and registry versions
listList available components from the registry
themeManage theme tokens (list, info, add)

Each command has its own page with full options and examples.


Migration from shadcn CLI

The commands map directly:

# shadcn
npx shadcn@latest add button
npx shadcn@latest diff button

# gentleduck
npx @gentleduck/cli add button
npx @gentleduck/cli diff button

After switching, you get update, remove, list, and theme, which shadcn does not provide. update with interactive merge lets teams pull upstream changes into customized components without losing local edits.