Updating
There is no update command, and no version to bump. Components were copied into your repository, so adopting a change means copying the newer file over the one you have — and deciding what to do about any edits you made in between.
Re-running add is safe by default
Running the same command again does not silently replace anything. The CLI asks, once per file:
? The file money-input.tsx already exists. Would you like to overwrite? › (y/N)The default is No. Answering n, or pressing enter, leaves your file exactly as it is — which also means you do not get the new version.
| Command | Prompts | Your local edits | New version applied |
|---|---|---|---|
shadcn add <url> | yes, per file | kept | no |
answer n at the prompt | — | kept | no |
shadcn add <url> --overwrite | no | replaced | yes |
--yes does not answer the overwrite prompt — it only skips the initial confirmation. Running
shadcn add <url> --yes against a file that already exists blocks on stdin and hangs indefinitely in CI, a git hook,
or any non-interactive shell. When scripting, pass --overwrite explicitly.
See what changed before you overwrite
Items are plain JSON, so the current published source is one request away:
# Print the file as it is published right now
curl -s https://kiotapay-ui-staging.staging.kiotapay.com/r/money-input.json | jq -r '.files[0].content'
# Or diff it against your copy
curl -s https://kiotapay-ui-staging.staging.kiotapay.com/r/money-input.json | jq -r '.files[0].content' \
| diff components/custom/money-input.tsx - shadcn view prints the same thing in a friendlier form once you have the namespace registered:
npx shadcn@latest view @kiota/money-inputThe workflow
Let git do the merge rather than your memory.
-
Commit or stash everything first.
--overwriteis not undoable except through git. -
Overwrite the item.
npx shadcn@latest add https://kiotapay-ui-staging.staging.kiotapay.com/r/money-input.json --overwrite -
Read the diff.
git diff components/custom/money-input.tsxnow shows the upstream change and the loss of any local edit, together. -
Re-apply your edits from that diff, or
git checkoutthe file if the update is not worth it. -
Run typecheck. A component's props can change between versions; nothing warns you.
Overwriting an item also re-runs its dependencies, so copy-field pulls use-copy and kiota-theme along with it. Expect more files to move than the one you named.
Design tokens do not reliably update
A fresh install always writes the current token values. Re-installing into a project that already has those variables is not dependable: in testing, the same token updated on one run and stayed stale on another depending on which item pulled it in.
Treat tokens as install-time only. To adopt a palette change, edit the variables in your stylesheet directly — the values are listed on Theming — or delete them and re-add the item into a clean state.
Make updates cheap in the first place
Every edit you make inside an installed file is an edit you re-apply on every update. The fix is to keep customisation outside the file:
- Pass
className. Every component here merges it throughcn, so spacing, width and colour overrides belong at the call site, not in the component. - Wrap rather than edit. A local
PayoutAmountthat renders<MoneyInput align="right" currency="KES" />survives any upstream change toMoneyInput. - Override tokens, not markup. Restyling
StatusBadgefor your surface is a--success/--dangerchange in your stylesheet, not a change to the component.
Files you never edit can be overwritten without thinking. That is the pattern to aim for — reserve real edits for the cases where behaviour genuinely has to differ, and expect to maintain those by hand.