KKiotaPay UI
Browse documentation

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.

CommandPromptsYour local editsNew version applied
shadcn add <url>yes, per filekeptno
answer n at the prompt—keptno
shadcn add <url> --overwritenoreplacedyes

--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-input

The workflow

Let git do the merge rather than your memory.

  1. Commit or stash everything first. --overwrite is not undoable except through git.

  2. Overwrite the item.

    npx shadcn@latest add https://kiotapay-ui-staging.staging.kiotapay.com/r/money-input.json --overwrite
  3. Read the diff. git diff components/custom/money-input.tsx now shows the upstream change and the loss of any local edit, together.

  4. Re-apply your edits from that diff, or git checkout the file if the update is not worth it.

  5. 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:

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.