# Commands (/docs/native/cli/commands)

```bash
delacour <command> [components...] [options]
```

Every command that reads the registry also takes `--registry`, `--ref`, `--offline` and `--cwd`.
The blocks below are that command's own `--help`.

<Callout title="`--ref` will not read `main` in your terminal">
The blocks below are printed from a working tree. A published build bakes in **the commit it was
released against**, so the default your copy prints is a SHA — which is what keeps a version reading
the registry it shipped with. Pass `--ref develop` to opt into what has landed since.
</Callout>

## init [#init]

Sets the project up and writes `native-components.json`. Covered in full at
[Setting up a project](/docs/native/cli/init).

<InstallTabs commands={[{ verb: "dlx", packages: ["delacour@latest init"] }]} />

**Options**

```txt
Usage: delacour init [options] [components...]

set this project up and write native-components.json

Arguments:
  components             components to add straight away

Options:
  -y, --yes              accept every default without asking
  -d, --defaults         use the default layout without asking
  -t, --tests            also install component tests, and every later add keeps
                         them
  --no-tests             install no component tests, without asking
  --prefix <name>        what components call the library, in place of
                         DelacourUI
  -f, --force            rewrite an existing native-components.json
  -s, --src <dir>        base directory for source files
  --package-name <name>  put the components in a shared package with this name
  --package-path <dir>   where that package goes, relative to the workspace root
                         (default: "packages/ui")
  --install              install the packages the components need, without
                         asking
  --no-install           write the files and install nothing
  --silent               print nothing but errors
  --registry <url>       registry to read from: a URL, github:owner/repo, or a
                         local path
  --ref <ref>            git ref to read the registry at (default: "main")
  --offline              use only what is already cached
  -c, --cwd <path>       directory to work in (default: the current directory)
  -h, --help             display help for command
```

## add [#add]

Copies components in, with everything they need.

<InstallTabs commands={[{ verb: "dlx", packages: ["delacour@latest add button input field"] }]} />

```bash
delacour add --all
```

### It sets the project up if it has to [#it-sets-the-project-up-if-it-has-to]

A project with no `native-components.json` is not an error. `add` runs [`init`](/docs/native/cli/init)
first — writing the config, wrapping Metro, pointing Tailwind at the components, copying the theme
and the root provider in — and then adds what you asked for. That happens in a script, in CI and
over MCP as readily as in a terminal, so `add` is the only command most projects ever need.

Pass `--no-init` to be told instead. A build that should never reconfigure a checkout wants it;
almost nothing else does.

### What happens, in order [#what-happens-in-order]

The order is deliberate: resolve the dependency graph, plan every file, ask **once** about
conflicts, write, then report what the components need from npm. Installing first would leave a
project holding new native dependencies and no components if you answered "no" to the overwrite
prompt.

A file already on disk with byte-identical content is not a conflict — that is the normal state of
a utility two components share. Non-interactively, a genuine difference is an error naming the
files rather than a silent overwrite; pass `--overwrite` when you mean it.

### What it needs installed [#what-it-needs-installed]

Every `add` ends with the packages the components need, whether or not anything is missing. The install lines are printed for your project's package manager; the `npm` spelling is shown below:

```txt
●  Needs 14 external packages, 2 not here yet:
│    npx expo install react-native-teleport react-native-keyboard-controller
│    already installed — cn, react-native-reanimated, react-native-svg, tailwind-variants, …
```

The missing ones are shown as commands rather than as a list of names, because the command is the
part that is not obvious — and they are spelled for the package manager this project is actually
on.

A package the project already has at a version older than the components need counts as missing
too, and is installed again at the library's range. The report says which, and from what:

```txt
│    yarn add tailwind-variants@^4.0.0
│    tailwind-variants is 3.3.1 here; the components need ^4.0.0
```

A newer version than the range is left alone.

Then it asks which to install, one checkbox per missing package, all ticked, each naming the
command it goes through and the components that need it:

```txt
◆  Install which packages now? (space to toggle, enter to confirm)
│  ◼ react-native-teleport             (npx expo install · for bottom-sheet)
│  ◼ react-native-keyboard-controller  (npx expo install · for bottom-sheet, input)
```

Untick one and the rest are installed; the ones you left are printed as commands to run later.
`--install` installs every one without asking, `--no-install` none, and a run with nobody to ask —
a script, CI, an agent — installs nothing and prints the commands instead. Copying source into your
repository is local and reversible; running your package manager is neither.

### Tests, if you want them [#tests-if-you-want-them]

Every component's test suites ship in the registry too, and `--tests` copies them beside the
source:

```bash
delacour add button --tests
```

They land next to what they test — `button/button.variants.test.ts` beside `button.variants.ts` —
with their imports rewritten to your aliases like any other file, and they are recorded in the
[lock](/docs/native/cli/configuration#the-lock-file) under the component they test. A test that
imports another component's helper brings that helper along.

They are written for the runner your project already uses, read from its `package.json` — the
`test` script first, then a `vitest`, `jest` or `jest-expo` dependency — or from
[`tests.runner`](/docs/native/cli/configuration#tests) when you set it:

| Runner | The suites import from | Dev dependencies added |
| --- | --- | --- |
| Bun (no runner found) | `bun:test` | `@types/bun` |
| Vitest | `vitest` | `vitest`, `@types/node` |
| Jest | `@jest/globals` | `@jest/globals`, `@types/node` |

Every suite keeps to the API the three share, so nothing else in it changes, except that under Jest a
suite reading a file beside itself does so through `__dirname`.

<Callout title="Two settings your runner may need">
Vitest does not read `tsconfig` paths, so a project importing through `@/` needs the same alias in
`vitest.config.ts` (`resolve.alias`). On SDK 58, Vite also cannot follow
`extends: "expo/tsconfig.base"` — `expo`'s `exports` map does not include it — so every suite fails
to load until the config sets `esbuild: { tsconfigRaw: "{}" }`. Under Jest, `chart` and
`bottom-sheet` import engines published as TypeScript source, so `transformIgnorePatterns` has to
let `@delacour/.*` through, and for `chart` also `d3-.*` and `internmap`, which ship ES modules
only — and `d3-shape` ships them as `.mjs`, which `jest-expo`'s Babel transform does not match, so
`transform` needs `"^.+\\.mjs$": "babel-jest"` too. `add --tests` checks all of this as soon as it has copied the suites, and [`doctor`](#doctor)
checks it again — each warning names the fix.
</Callout>

#### Render tests, on Jest [#render-tests-on-jest]

Each component also ships a render test — `button/button.render.test.tsx` — that mounts it with
[React Native Testing Library](https://oss.callstack.com/react-native-testing-library) and checks
what a person or a screen reader can observe: its role and name, its disabled, checked or busy
state, its callbacks, and its controlled and uncontrolled behaviour.

They run under Jest only, so they are copied only when the project's runner is Jest. On Bun or
Vitest, `add --tests` copies the other suites and says once that the render tests were skipped.

With them comes the test kit, copied under your `lib` alias as `test/setup.ts` and `test/render.tsx`:
a Jest setup that stands in for every native module the components use — Reanimated, Gesture
Handler, Skia, the keyboard controller, the safe area and the rest — and a `renderWithProviders`
helper that mounts a component inside `DelacourProvider`. `add` then adds four things to the Jest
config, in `package.json` or a `jest.config.*` that exports an object literal:

```js
setupFiles: ["<rootDir>/src/lib/test/setup.ts"],
resolver: "react-native-reanimated/jest/resolver",
transformIgnorePatterns: [/* jest-expo's, plus the library's ES-module dependencies */],
transform: { "^.+\\.mjs$": "babel-jest" },
```

A component that installs a native module only some components bring — Skia for `chart`, MapLibre
for `map` — also brings that module's mock, under `test/mocks/`, and `add` lists it in `setupFiles`
after the setup file. A project never gets a mock for a module it does not have.

A config it cannot edit safely is left alone, and `add` prints that snippet with your paths for you
to merge. `@testing-library/react-native` and `test-renderer` are added as dev dependencies; the
project needs `jest-expo` as its preset already.

`update` keeps the tests you copied current and leaves alone the components you copied without
them; `update --tests` brings them in for everything.

#### Running them [#running-them]

Whenever tests are copied, `add` and `update` add scripts to your `package.json` that run only the
copied suites, so your own `test` script is left alone:

| Script | Runs |
| --- | --- |
| `test:ui` | every copied suite |
| `test:ui:unit` | the logic suites, without the render tests |
| `test:ui:render` | the render tests — Jest only, so Bun and Vitest projects do not get it |

A script you already have under one of those names is kept as it is, and a run that finds all of
them writes nothing.

<Callout title="Dependencies are split three ways">
`expo install` for native modules and anything pinned to the SDK, your package manager for plain
JavaScript, and `registryDependencies` — which are other components to copy, not packages to
install.
</Callout>

<Callout type="warn" title="Install into the app, not the shared package">
If your components live in a package several apps share, the packages still belong to the **app**.
A native module resolved from two places registers twice and breaks at runtime — which is why `add`
runs the install from the app root, and records the same packages as `peerDependencies` on the
shared package rather than as dependencies.
</Callout>

**Options**

```txt
Usage: delacour add [options] [components...]

copy components into this project

Arguments:
  components        components to add

Options:
  -a, --all         add every component
  -o, --overwrite   replace files that differ
  -t, --tests       copy each component's tests too, and remember the choice in
                    the config
  --no-tests        copy no tests, and remember the choice in the config
  -y, --yes         accept every default without asking
  -s, --src <dir>   base directory for source files, when setting the project up
  --prefix <name>   what components call the library, when setting the project
                    up
  --install         install the packages the components need, without asking
  --no-install      write the files and install nothing
  --no-init         error instead of writing native-components.json when this
                    project has none
  --silent          print nothing but errors
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## list [#list]

Everything the registry holds. Works before `native-components.json` exists — which is exactly when
you are deciding whether to run `init`.

```bash
delacour list
```

**Options**

```txt
Usage: delacour list|ls [options]

list what the registry holds

Options:
  --json            print JSON
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## search [#search]

```bash
delacour search sheet
```

**Options**

```txt
Usage: delacour search [options] <query>

search the registry

Options:
  --json            print JSON
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## view [#view]

Prints an item's files, the components it copies in, and the packages it installs.

```bash
delacour view button
```

```txt
Button  button
A pressable action composed from parts, with variants, sizes and a loading state.

files      ui/button/button.tsx
           ui/button/index.ts
           …
copies in  styles, cn, tv, color, use-theme-color, icon, compose-refs, merge-props, pressable, spinner, text

needs installing
  npx expo install react-native-gesture-handler react-native-pulsar react-native-reanimated react-native-svg react-native-worklets uniwind
  npm install cn tailwind-variants tailwindcss
```

The install lines cover the **whole closure**, not the item's own dependencies. `button` declares
only `tailwind-variants`; it renders `icon`, which needs `react-native-svg`, and `pressable`, which
needs Gesture Handler. Listing an item's own packages would under-report what `add` installs by
exactly the ones you are deciding about.

**Options**

```txt
Usage: delacour view [options] <name>

show one item and what it pulls in

Options:
  --json            print JSON
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## info [#info]

The resolved config and what was detected: package manager, Expo and React Native versions, whether
Uniwind and Tailwind are installed, the workspace and app roots, and the path aliases found in
`tsconfig.json`. Start here when the CLI is writing files somewhere you did not expect.

```bash
delacour info
```

**Options**

```txt
Usage: delacour info [options]

show the resolved config and what was detected

Options:
  --json            print JSON
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## update [#update]

Brings the components you copied up to what the registry holds now, and keeps your edits.

```bash
# npx, pnpm dlx, yarn dlx or bunx
npx delacour@latest update
npx delacour@latest update button
npx delacour@latest update --dry-run
```

`add` records where each file came from in [`native-components.lock.json`](/docs/native/cli/configuration#the-lock-file):
the registry ref, and a hash of the text as the registry served it. That is what lets `update` tell
the two histories apart — the registry's, which may have fixed something, and yours, which may have
changed something.

| The file | What `update` does |
| --- | --- |
| Changed in the registry only | Replaces it |
| Changed by you only | Leaves it alone |
| Changed by both, on different lines | Merges the two |
| Changed by both, on the same lines | Writes both sides between conflict markers, and exits `1` |
| New to the component | Writes it |
| Dropped from the component | Leaves it and says so. `--prune` deletes it, if you never edited it |

An edit is never overwritten. A conflict looks the way git's do, because your editor already knows
what to do with one:

```tsx
<<<<<<< local
	const padding = 12;
=======
	const padding = 6;
>>>>>>> registry@3ac4ac4
```

Keep the side you want, delete the markers, and that file is done.

### Choosing what to take [#choosing-what-to-take]

Run with no names at a terminal, `update` lists every component it would change before it writes
anything — each file, what happens to it, and how far the registry moved it — then asks which to
take:

```txt
●  icon  1 updated, 1 added, 1 merged with your edits · +14 −3
│    update  src/components/ui/icon/icon.tsx           +9 −2
│    add     src/components/ui/icon/icon.types.ts      +4 −0
│    merge   src/components/ui/icon/icon.variants.ts   +1 −1
│
│  spinner  new · 1 added · needed by button · +40 −0
│    add     src/components/ui/spinner/spinner.tsx     +40 −0
│
◆  Update which components?
│  ◼ icon
│  ◼ spinner
```

A component the project's components need but it does not hold — one you deleted, say, after
swapping the icon set for another — is listed too, unticked, as *not in this project*. `update`
never adds one on its own; tick it to add it. A dependency the registry introduced since you copied
the component is the exception: that one is new, so it is offered ticked like any other change.
Tests follow the same rule: a suite that renders a component you do not hold is left out, not given
that component.

Everything else is ticked. A component you untick is reported as skipped and is not recorded in the
lock, so the next `update` offers it again. `delacour diff <name>` prints the lines themselves.
Naming components (`update icon`), `--yes`, `--json` and a run with nobody to ask take every change
without the list; packages a taken component needs are then offered the same way `add` offers them.

**It updates to the ref your CLI was published from**, so `npx delacour@latest update` is the
whole upgrade: the newest CLI, and the registry it shipped against.

The walkthrough — commit, `diff`, update, resolve, `doctor` — is the [Updating](/docs/native/cli/updating) guide.

### Your config [#your-config]

Before it reads a component, `update` brings [`native-components.json`](/docs/native/cli/configuration#version)
up to the shape this CLI writes. At a terminal it asks about each option the file predates, once,
then records the answers and the new `version`. `--yes` keeps every default; `--json`, a pipe or CI
leaves the file alone and names what is still to choose; `--dry-run` says what it would ask. See
[Updating `native-components.json`](/docs/native/cli/updating#updating-native-componentsjson).

### Your formatter [#your-formatter]

A project with a formatter will have run it over the copied files, and after that every line
differs from the registry's. So before comparing anything, `update` runs **your** formatter over
the registry's side — Biome or Prettier, whichever the project configures, from your own
`node_modules` and with your own config. A file you only reformatted counts as untouched, and an
update arrives already in your style.

It only ever runs a formatter you have installed. With none, it falls back to ignoring layout —
whitespace, quotes, semicolons, trailing commas — when deciding whether a file was edited.
`--no-format` skips the formatter.

### Uncommitted changes [#uncommitted-changes]

A merge rewrites a file you edited. If that edit was never committed there is no way back to it, so
`update` asks before merging into a file with uncommitted changes — and with no one to ask, skips
it and names it. `--force` merges anyway. Replacing a file you never touched needs no such care.

### Components copied before the lock existed [#components-copied-before-the-lock-existed]

They have no entry to merge from. `update` records every such file that still matches the registry,
and leaves the rest alone. If you know the ref they were copied from, name it and they merge like
any other:

```bash
delacour update --base v0.1.0
```

At a terminal you do not have to know that in advance. When a run skips files for this reason it
finishes, shows what it did, and then asks what to do with them: leave them, merge them from a ref
you type in, or replace them with the registry's copy. Replacing drops your edits to those files,
so it asks again before touching one with uncommitted changes. Under `--yes`, `--json`, in CI and
over MCP nothing is asked and the files stay skipped.

**Options**

```txt
Usage: delacour update [options] [components...]

bring copied components up to the registry, merging with your edits

Arguments:
  components        components to update, or every one in this project

Options:
  -n, --dry-run     show what would change and write nothing
  --base <ref>      the ref to merge from, for files copied before the lock
                    existed
  --prune           delete untouched files their component no longer has
  -f, --force       merge into files with uncommitted changes
  -t, --tests       bring every component's tests, not only those already copied
  --no-format       compare without running the project's formatter
  -y, --yes         accept every default without asking
  --install         install any packages the updated components need, without
                    asking
  --no-install      write the files and install nothing
  --json            print JSON
  --silent          print nothing but errors
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## diff [#diff]

Shows what `update` would change, and changes nothing.

```bash
delacour diff
delacour diff button
```

It prints the plan `update` applies rather than a comparison of its own, so the two cannot disagree.
For a file the lock knows, that is the registry's change by itself — your edits are not in the
diff, because they are not what moved. For a file with no lock entry there is nothing to tell the
two apart, so both sides are printed and no winner is picked.

**Options**

```txt
Usage: delacour diff [options] [name]

show what an update would change in the files you copied

Arguments:
  name              one component, or every installed one

Options:
  -t, --tests       compare every component's tests, not only those already
                    copied
  --silent          print nothing but errors
  --registry <url>  registry to read from: a URL, github:owner/repo, or a local
                    path
  --ref <ref>       git ref to read the registry at (default: "main")
  --offline         use only what is already cached
  -c, --cwd <path>  directory to work in (default: the current directory)
  -h, --help        display help for command
```

## theme [#theme]

Brings a theme across from a web app. Paste a shadcn or tweakcn `globals.css` over `theme.css`
and run it with nothing else:

```bash
delacour theme
```

Or name the source and it writes `theme.css` for you:

```bash
delacour theme ./src/app/globals.css
delacour theme https://tweakcn.com/r/themes/<id>
pbpaste | delacour theme -
```

With no source the command reads `theme.css` where it sits. A file already in the shape Uniwind
reads is left alone, so running it twice is safe; a file in neither shape is named rather than
guessed at. `delacour doctor` fails on a `theme.css` still in shadcn's shape, so a forgotten run is
caught before a build.

The palette these components paint from is shadcn's, name for name, so a `globals.css` or a tweakcn
export is already almost the right file. What it is not is *readable*. Uniwind takes a theme only
from `@variant light` / `@variant dark`; a literal `.dark { … }` is registered as a **utility class
named `dark`** and contributes nothing — no error, no warning, and a dark theme that never arrives.

So the command rewrites the wrapper, and three other things besides:

- **Fills the gaps.** shadcn has no `elevated`, `tertiary`, `success` / `warning` / `info`, the
  `-soft` pairs or `overlay`, and components here paint with all of them. Each is written as an
  expression over a token your theme *does* define, so it follows your palette instead of falling
  back to the library's. shadcn v4 also stopped declaring `destructive-foreground`, which every
  destructive control here paints its label with; that and the shadow scale are filled in too.
- **Balances the two themes.** A shadcn theme routinely sets something in `:root` and omits it from
  `.dark`. Uniwind refuses to build that — "All themes must have the same variables" — so anything
  declared once is copied across.
- **Keeps one family name per font.** React Native's `fontFamily` takes a single name with no
  fallback list, so `"Inter, ui-sans-serif, system-ui"` resolves to nothing and quietly falls back
  to the system sans. The first real family is kept and the rest reported.

It writes `theme.css` in your configured styles directory, asking first. `--dry-run` prints the CSS
instead and needs no project at all, so you can see what a theme becomes before adopting it.

<Callout>
A derived corner step in the source — `--radius-sm`, `--radius-lg` — is dropped and reported. Here
every corner is a multiple of one `--radius`, so carrying your own steps would pin them at one size
and fight the scale. Setting `--radius` alone retunes them all. See
[Theming](/docs/native/getting-started/theming).
</Callout>

**Options**

```txt
Usage: delacour theme [options] [source]

convert theme.css in place, or bring a shadcn or tweakcn theme across from a web
app

Arguments:
  source            a CSS file, a URL, or `-` to read stdin — optional; with no
                    source, theme.css is converted where it sits

Options:
  -c, --cwd <path>  directory to work in (default: the current directory)
  --dry-run         print the CSS instead of writing it
  -y, --yes         replace theme.css without asking
  --silent          print nothing but errors
  -h, --help        display help for command
```

## doctor [#doctor]

Checks that the app is wired up for these components. Every check is a failure mode that produces no
error on its own — see [Troubleshooting](/docs/native/cli/troubleshooting). Exits non-zero when a
check fails, so it works in CI.

```bash
delacour doctor
```

**Options**

```txt
Usage: delacour doctor [options]

check that this Expo app is wired up for these components

Options:
  -c, --cwd <path>  directory to work in (default: the current directory)
  --json            print JSON
  --fast            skip the checks that shell out to the Expo CLI
  --silent          print nothing but errors
  -h, --help        display help for command
```

## mcp [#mcp]

Runs as an MCP server over stdio so a coding agent can browse and add components. See
[Agents](/docs/native/cli/mcp).

**Options**

```txt
Usage: delacour mcp [options]

run as an MCP server, so an agent can browse and add components

Options:
  -c, --cwd <path>  directory to work in (default: the current directory)
  --registry <url>  registry to read from
  --ref <ref>       git ref to read the registry at
  -h, --help        display help for command
```

## skills [#skills]

Installs the agent skill into whichever coding assistants this project uses. See
[Agent skills](/docs/native/getting-started/skills).

<InstallTabs commands={[{ verb: "dlx", packages: ["delacour@latest skills"] }]} />

Nothing is fetched — the files are bundled into the binary, so a run works offline and installs the
skill that matches the version of the CLI this project is pinned to.

**Options**

```txt
Usage: delacour skills [options] [skills...]

install the agent skill, so a coding assistant uses the real components

Arguments:
  skills              which skills to install — all of them by default

Options:
  --agent <agent...>  which assistants to install for; detected from the project
                      by default (choices: "claude", "cursor", "opencode",
                      "codex", "all")
  --scope <scope>     where to install (choices: "project", "user", default:
                      "project")
  --list              print what is available and where it would go
  -f, --force         replace a skill that is already there
  -c, --cwd <path>    directory to work in (default: the current directory)
  --silent            print nothing but errors
  -h, --help          display help for command
```

## telemetry [#telemetry]

Shows whether anonymous usage telemetry is on and why, and switches it. What is collected, and every
way to turn it off, is on the [overview](/docs/native/cli#telemetry).

```bash
delacour telemetry disable
```

**Options**

```txt
Usage: delacour telemetry [options] [action]

see, enable or disable anonymous usage telemetry

Arguments:
  action      show the current setting, or switch telemetry on or off (choices:
              "status", "enable", "disable", default: "status")

Options:
  --json      print JSON
  -h, --help  display help for command
```

## Shared options [#shared-options]

`--cwd` decides which `native-components.json` applies: the nearest one, walking upwards. The walk
stops at the repository root — past it lie your other projects.

See [The registry](/docs/native/cli/registry) for pinning a ref and pointing at a fork.
