# Overview (/docs/native/cli)

`delacour` copies the library's source into your repository. You end up owning
`button.tsx` — you can read it, edit it, and delete the parts you do not want. There is no
package to upgrade and no release cadence to wait on.

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

That is the whole install — on a project it has not seen before, `add` does the setup below first.
It writes real files into your app:

```txt
src/
├── components/ui/button/     button.tsx, button.variants.ts, index.ts, AGENTS.md, …
├── lib/                      cn.ts, tv.ts
└── styles/                   tokens.css, theme.css, base.css, index.css
```

## Which delivery should you use? [#which-delivery-should-you-use]

Both are supported and both deliver the same files — the registry names the library's own source
rather than carrying a copy of it, so the two cannot drift. The choice is about who owns the code.

| | [Install the package](/docs/native/getting-started/installation) | This CLI |
| --- | --- | --- |
| Upgrades | Your package manager's update | `delacour update` — merged with your edits |
| Editing a component | Fork or wrap it | Edit the file |
| Import path | `@delacour/react-native-ui/button` | `@/components/ui/button` |
| New components | Arrive with the package | `delacour add` when you want one |
| Bundle | Only the subpaths you import | Only the files you added |

<Callout title="You can start with one and move to the other">
The components are identical — the CLI copies the same source the package ships. Running
`delacour add button` in a project that already installs `@delacour/react-native-ui` gives you a local
copy to edit; delete the package import and point at the new path.
</Callout>

## Why this is not just shadcn for React Native [#why-this-is-not-just-shadcn-for-react-native]

The copy-in model is shadcn's. What is different is everything Expo makes different, and each of
these is a failure that produces **no error at all** when it goes wrong:

<Cards>
  <Card title="Native modules go through expo install" href="/docs/native/cli/commands">
    `npm install react-native-reanimated` (or any package manager's add) fetches the newest release, which on any older SDK does not
    compile. The CLI asks the SDK what it supports.
  </Card>
  <Card title="Metro is wrapped, outermost" href="/docs/native/cli/init">
    `withUniwindConfig` installs the transform that compiles `className`. A wrapper applied after
    it can replace the transformer and leave every component unstyled.
  </Card>
  <Card title="@source globs use real paths" href="/docs/native/cli/monorepo">
    Tailwind's scanner does not follow the symlink a monorepo creates, and a glob that misses your
    components strips their classes from the release build.
  </Card>
  <Card title="doctor checks all of it" href="/docs/native/cli/troubleshooting">
    New Architecture, `tsconfigPaths`, the gesture root, a competing Tailwind transform, duplicate
    native modules. Every check names its own fix.
  </Card>
</Cards>

## What the setup will and will not touch [#what-the-setup-will-and-will-not-touch]

`add` runs this itself the first time. [`init`](/docs/native/cli/init) is the same thing on its own,
for when the layout has to be chosen rather than inferred.

<Steps>
<Step>
### Writes `native-components.json` [#writes-native-componentsjson]

Where components go, and how they should import each other. See
[Configuration](/docs/native/cli/configuration).
</Step>

<Step>
### Wires Metro and your Tailwind entry [#wires-metro-and-your-tailwind-entry]

`metro.config.js` gets the Uniwind wrapper; `global.css` gets an `@import` and the `@source`
globs, inside a marked block it is safe to re-run over.
</Step>

<Step>
### Copies the theme and the root provider [#copies-the-theme-and-the-root-provider]

The `styles` item — tokens, palette, and the Uniwind type shim — so a fresh project renders before
you have chosen a single component, and `provider`, so the gesture root every press needs is one
import away rather than a second command. Of those, `theme.css` is the file that is yours to
replace; see [Theming](/docs/native/getting-started/theming).
</Step>

<Step>
### Prints what it will not do [#prints-what-it-will-not-do]

`tsconfig.json` and `app.config.ts` are read, never written. Three things need a human, and
`delacour doctor` re-checks every one of them.
</Step>
</Steps>

## Telemetry [#telemetry]

`delacour` sends anonymous usage data so we can see which commands and components get used, on which
Expo SDKs and package managers, and which commands fail. It is **on by default** and takes one
command to turn off. The first time it would send anything, it prints a notice to stderr saying so;
under `--silent` the notice waits for a run that is not.

```bash
delacour telemetry            # is it on, and why
delacour telemetry disable    # turn it off, for every project on this machine
delacour telemetry enable
```

### What is sent [#what-is-sent]

One `command` event per run, in one request made as the command ends:

| | |
| --- | --- |
| The run | The command (`add`), the **names** of the flags you typed (`--yes`, `--no-install`), how it ended (success, error or cancelled), how long it took, the exit code if it returned one, and the **class name** of an error, such as `RegistryFetchError` |
| Components | The names you asked for (`button`, `dialog`), only for `add`, `update`, `view`, `diff` and `init`, only when the registry is ours, and only names shaped like a registry item |
| The registry | Whether it was `official`, `custom` or `local` — never its address |
| Your project | The package manager (`bun`, `pnpm`, `yarn`, `npm`) and the Expo SDK's major version |
| This machine | The operating system family and kernel release, the CPU architecture, and the Node or Bun version |
| How it ran | The CLI's version and channel (`latest` or `alpha`), whether stdin and stdout are terminals, and whether it was started by `npx`, `bunx`, `pnpm dlx`, `yarn dlx` or an installed `delacour` |
| Identity | A random machine ID, made the first time and kept in `~/.config/delacour/telemetry.json`; a random ID for this run; and a project ID |

The project ID is a SHA-256 hash of your repository's `origin` remote with the scheme, credentials
and `.git` removed, so the same project has the same ID on a laptop and in CI. A folder with no
remote is hashed with a random salt that stays in that same file. It cannot be reversed into a
URL or a path, and it is how we count projects instead of runs.

Events go to `telemetry.delacour.co.nz`, our own server. It works out a country from the request,
discards the IP address, and forwards the event to PostHog for dashboards.

### CI and coding agents [#ci-and-coding-agents]

The CLI notes whether it is running in CI, and in which one, from the variables that CI sets
(`GITHUB_ACTIONS`, `EAS_BUILD`, …) — only whether they are set, never their values. It does the same
for a coding agent, from the variable the agent documents (`CLAUDECODE`, `CURSOR_AGENT`,
`GEMINI_CLI`, `CODEX_SANDBOX`, `OPENCODE`) or an `AI_AGENT` you set yourself. That is what lets us
tell a person at a terminal from a pipeline or an assistant running `delacour mcp`.

### What is never sent [#what-is-never-sent]

Source code, file contents, file names and paths, the URL of your git remote, environment variable
values, flag values, search queries, usernames, hostnames, error messages, and your IP address.
`delacour telemetry` itself is never counted.

### Turning it off [#turning-it-off]

Any one of these does it. The environment variables win over the stored choice, and over
`delacour telemetry enable`.

| | |
| --- | --- |
| `delacour telemetry disable` | Stored in `~/.config/delacour/telemetry.json` and kept until you run `enable` |
| `DO_NOT_TRACK=1` | The [Console Do Not Track](https://consoledonottrack.com) convention, honoured by every Delacour tool |
| `DELACOUR_TELEMETRY_DISABLED=1` | Every Delacour command-line tool |
| `DELACOUR_CLI_TELEMETRY_DISABLED=1` | This CLI only |

It is also off when `NODE_ENV=test` and in a development build of the CLI. `DELACOUR_CONFIG_DIR` and
`XDG_CONFIG_HOME` move the config file.

### See exactly what would be sent [#see-exactly-what-would-be-sent]

```bash
DELACOUR_TELEMETRY_DEBUG=1 delacour list
```

prints the request body to stderr and sends nothing. Anything else about how this is handled is on
the [privacy policy](/privacy#the-cli).

## Next [#next]

<Cards>
  <Card title="Set up a project" href="/docs/native/cli/init" />
  <Card title="Every command" href="/docs/native/cli/commands" />
  <Card title="native-components.json" href="/docs/native/cli/configuration" />
  <Card title="Use it from an agent" href="/docs/native/cli/mcp" />
</Cards>
