Skip to main content

remove

Remove installed components and clean up unused dependencies.

Usage


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

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

Deletes the component source files and prunes any npm dependencies that no other installed component still uses.


Options

FlagDescription
-y, --yesSkip confirmation
-c, --cwd <cwd>Working directory
-w, --workspace <path>Target workspace

Examples

# Remove specific components
npx @gentleduck/cli remove carousel resizable
 
# Remove from a workspace
npx @gentleduck/cli remove sidebar --workspace apps/dashboard
 
# Skip confirmation
npx @gentleduck/cli remove dialog -y
# Remove specific components
npx @gentleduck/cli remove carousel resizable
 
# Remove from a workspace
npx @gentleduck/cli remove sidebar --workspace apps/dashboard
 
# Skip confirmation
npx @gentleduck/cli remove dialog -y

How dependency cleanup works

  1. Resolves the component's npm deps — e.g. dialog declared @radix-ui/react-dialog.
  2. Scans other installed components — does any still need @radix-ui/react-dialog?
  3. Removes if orphaned — runs bun remove / npm uninstall on the unused packages.

The CLI never removes a dep you'd hand-installed yourself unless it's also declared by the component being removed.


What stays

  • Your custom edits to other files
  • Imports from removed components in your own code — they'll error at compile time, you fix them
  • Theme tokens written by theme add
  • duck-ui.config.json

To uninstall the CLI itself: bun remove -D @gentleduck/cli.