Installation
Create a new Expo app with nativecn, or add nativecn to an existing one.
Requirements
- Expo SDK 57 or newer, with Expo Router. nativecn supports every SDK from 57 to the latest.
- Bare React Native apps are not supported.
The CLI checks this first, before it creates or writes anything. On an older SDK it stops with:
nativecn supports Expo SDK 57 and newer; SDK <57 is not supported. Upgrade with `npx expo install expo@latest --fix`.
Create a new app
npx nativecn-cli@latest create my-app
The CLI asks for the app name, the Preset, the folder structure and which AI agents you use. Then it:
- fetches the nativecn Starter, a base Expo app pinned to the current Expo SDK with no Expo default theming;
- renames the app (
package.json, andnameandsluginapp.json); - installs dependencies with your package manager;
- applies the Preset: writes the Theme's colours, radius and fonts, downloads only the chosen fonts into
assets/fonts/and adds theexpo-fontConfig Plugin; - adds the Starter's promo Screen and the Registry Items it uses, plus any items you named;
- writes
components.json; - writes the Agent Kit for your agents;
- runs
git initand makes one commit,feat: initial commit.
Name items after the app name to install them straight away:
npx nativecn-cli@latest create my-app button card
create is an alias of init: in a folder with no app, or with --name, init creates one.
Add to an existing app
Inside an Expo app, run:
npx nativecn-cli@latest init
Init asks for the Preset, structure and agents, then writes the Theme, components.json and the Agent Kit, plus any items you named. It never rewrites your existing files and never commits. Instead it prints two things:
- The root Layout snippet to paste into
src/app/_layout.tsx(orapp/_layout.tsx). - Existing files that overlap with the nativecn Theme, such as Expo's
constants/theme.tsorthemed-text. Keep them for now; thenativecn-themeSkill can migrate them later.
The root Layout snippet has this shape:
<ThemeProvider>
<KeyboardProvider>
<Stack />
<Toaster />
</KeyboardProvider>
</ThemeProvider>
ThemeProvider(from@/theme) wraps the whole app.useTheme()throws outside it. It also keeps the native window background on the Scheme's background (withexpo-system-ui, installed with the Theme), so the strips behind the status bar and the Android navigation bar are dark in dark mode and light in light mode.KeyboardProvidercomes fromreact-native-keyboard-controller.<Toaster />renders once, after the navigator, so Toasts appear above every Screen.
With --yes, an agent applies the snippet itself, guided by the nativecn-setup Skill.
Apps without src/
- Init points the aliases at root folders (
@/components→components/) and setsroutestoapp. - If
tsconfig.jsonhas no@/*path alias, Init shows the change and asks before adding it (--yesaccepts it). - Init never moves existing files.
Without a terminal
When there is no terminal to prompt in (for example, an agent running the CLI), the CLI behaves as if you passed --yes: it uses your flags, falls back to the defaults for anything missing, and prints every choice it made. Agents should always pass explicit flags.
Flags
Both create and init take these flags. See the CLI reference for details.
| Flag | What it does |
|---|---|
-p, --preset <code> | Use a Preset short code from the builder, such as a1Q17B. |
--style --base --accent --radius --font --heading-font | Set the Preset with long flags. |
--folder-feat | Use the feature Structure. |
--agents <list> | Agents to set up: any of claude,codex,cursor,antigravity. |
--qa-permissions | Write opt-in auto-approve rules for the Visual QA Loop's commands. |
-n, --name <name> | The app name; creates a new app. |
-y, --yes | Skip prompts and use defaults for anything not given. |
-d, --defaults | Use the default Preset. |
-f, --force | Overwrite existing configuration. |
-c, --cwd <dir> | The working directory. |
-s, --silent | Print less output. |
After installing
- Fonts are embedded by a Config Plugin, so a development build needs a native rebuild (
npx expo run:iosornpx expo run:android). Expo Go works without one. - Keep
"userInterfaceStyle": "automatic"inapp.json(Expo's default, and the Starter's), so the system's dark mode reaches the app and the Scheme can follow it. - Add Components with
nativecn-cli add. - Ask your agent to build something: it already has the Rules, Skills and MCP server.

