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 interactive merge, removes them cleanly, diffs them against the registry with syntax highlighting, and manages theme tokens.

The update command matters most. When you update a component you have modified locally, the CLI opens an interactive merge screen in your terminal. 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
diff with TUISyntax-highlighted side-by-side viewPlain text diff
update with mergeInteractive hunk-by-hunk merge TUINot available
removeClean uninstall with dep cleanupNot 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
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
removeRemove components and clean up unused dependencies
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
# 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.