Skip to content

dgadd add

Add Diffgazer registry items to your project.

Usage

bash
pnpm exec dgadd add <item> [item...]
Info:

npm packages: @diffgazer/add is on npm. pnpm add -D @diffgazer/add puts dgadd on pnpm exec, and npx @diffgazer/add <command> runs it without the install. Components also install without dgadd from the hosted registry: npx shadcn add https://r.b4r7.dev/r/ui/<item>.json.

Items are namespaced as <namespace>/<item>. Bare names are rejected so install paths stay explicit:

bash
pnpm exec dgadd add ui/button
pnpm exec dgadd add ui/dialog ui/tabs keys/navigation

Options

FlagDescriptionDefault
--cwd <path>Working directory.
--allAdd all public UI and keys itemsfalse
--overwriteOverwrite existing filesfalse
--dry-runPreview changes without writing filesfalse
--skip-installWrite files without installing npm dependenciesfalse
--integration <mode>Keyboard integration mode: ask | none | copy | keysask
--keys-version <version>Version/range used when --integration keys installs @diffgazer/keyscaret range of the bundled @diffgazer/keys release
--yesSkip confirmation promptsfalse

--all selects only items marked public. Hidden dependencies required by those items are still installed as transitive items, while standalone hidden add-ons are not selected by --all.

Keyboard integration

copy mode installs bundled hook source into your app.

bash
pnpm exec dgadd add ui/menu --integration copy

keys mode rewrites local hook imports to @diffgazer/keys and installs the package dependency. Use it when the target app can resolve @diffgazer/keys.

bash
pnpm exec dgadd add ui/menu --integration keys

Standalone hooks can be installed directly. They are copied as source files and have no runtime dependency on @diffgazer/keys:

bash
pnpm exec dgadd add keys/navigation keys/focus-trap keys/focus-restore keys/scroll-lock

Provider-backed hooks (useKey, useScope, useScopedNavigation, useActionRowNavigation, useFocusZone) are package-only because they depend on KeyboardProvider runtime context.

Notes

  • dgadd copies source files into your project; you own the installed code.
  • UI dependencies and internal component dependencies are resolved automatically.
  • Package-mode keys integration is separate from the diffgazer product CLI.