# CLI

Install items from this registry with the shadcn CLI.

Install a registry item with the command shown on its docs page.

```sh
npx shadcn@latest add https://mwui.vercel.app/r/autosize-textarea.json
```

The command that's displayed uses the `homepage` value from `registry/config.ts` for the base URL.

Human-facing item pages also work with the shadcn CLI through content negotiation. For example, a browser can view [`/components/autosize-textarea`](/components/autosize-textarea), while the CLI receives the installable item JSON from the same URL:

```sh
npx shadcn@latest add https://mwui.vercel.app/components/autosize-textarea
```

Use the package manager selector on item pages to switch between npm, pnpm, yarn, bun, vite+, and deno commands.

## Endpoints

The registry index is served from both the root and the `/r` path, while installable item JSON lives
under `/r`:

| Route              | Serves                   |
| ------------------ | ------------------------ |
| `/registry.json`   | The registry index.      |
| `/r/registry.json` | The same registry index. |
| `/r/<name>.json`   | One installable item.    |

Authored metadata is validated against the schemas from
[`shadcn/schema`](https://github.com/shadcn-ui/ui/blob/main/packages/shadcn/src/registry/schema.ts),
so anything these routes serve is CLI-compatible.
