CLI

BoardCN has no CLI of its own. It is a registry, so the standard shadcn CLI does the work.

Adding items

npx shadcn@latest add https://boardcn.dev/r/button.json
npx shadcn@latest add https://boardcn.dev/r/button.json

Several at once:

npx shadcn@latest add https://boardcn.dev/r/button.json https://boardcn.dev/r/input.json https://boardcn.dev/r/select.json
npx shadcn@latest add https://boardcn.dev/r/button.json https://boardcn.dev/r/input.json https://boardcn.dev/r/select.json

Or the whole foundation, which is what you want on a fresh project:

npx shadcn@latest add https://boardcn.dev/r/boardcn.json
npx shadcn@latest add https://boardcn.dev/r/boardcn.json

Useful flags

  • --overwrite — replace files that already exist. Needed when you re-add an item after local edits.
  • --yes — skip confirmation prompts, for scripts and CI.
  • --silent — suppress output; pairs well with --yes.
  • --path — write to a directory other than the configured alias.

The registry endpoint

Every item is a plain JSON document served from this site. Nothing is authenticated and nothing is rate limited, so you can fetch or mirror it freely.

bash
# One item
curl https://boardcn.dev/r/button.json

# The full index of 85 items
curl https://boardcn.dev/r/registry.json
# One item
curl https://boardcn.dev/r/button.json

# The full index of 85 items
curl https://boardcn.dev/r/registry.json

To vendor the registry — pinning it for an air-gapped build, say — clone the repository, run npm run registry:build, and serve public/r from anywhere. Then pass that host's item URLs to shadcn add.

How dependencies resolve

Items declare their BoardCN dependencies as absolute registry URLs, so the CLI walks the graph for you. Adding data-table (https://boardcn.dev/r/data-table.json) installs the checkbox, dropdown, pagination, select, table, and tooltip it imports — each written once, even when several items share it.

Third-party packages are declared the same way and handed to your package manager, so recharts only lands in your package.json if you install something that charts.