CLI Reference
Complete reference for the @tapcn/cli command line tool.
CLI Reference
The @tapcn/cli is the command line tool for initializing tapcn in your project and adding components.
Installation
You do not need to install the CLI globally. Use npx to run it:
npx @tapcn/cli <command>Commands
init
Initialize tapcn in your project. Sets up NativeWind, global.css, tailwind.config, and creates a components.json configuration file.
npx @tapcn/cli initWhat it does:
- Detects your existing Expo project (or helps create one)
- Installs required dependencies:
nativewind,tailwindcss,class-variance-authority,clsx,tailwind-merge,react-native-reanimated - Creates
global.csswith light/dark theme CSS variables - Configures
tailwind.config.tswith theme color mappings - Updates
babel.config.jsfor NativeWind - Updates
metro.config.jsfor CSS support - Creates
lib/utils.tswith thecn()utility - Creates
components.jsonfor CLI configuration
add
Add one or more components to your project.
npx @tapcn/cli add <component...>Examples:
# Add a single component
npx @tapcn/cli add button
# Add multiple components at once
npx @tapcn/cli add button card input tabs
# Add all available components
npx @tapcn/cli add --allWhat it does:
- Reads your
components.jsonfor project configuration - Fetches the component JSON from the tapcn registry
- Resolves all
registryDependencies(transitive component deps) - Copies component files into your
components/ui/directory - Installs any required npm packages
Flags:
| Flag | Description |
|---|---|
--all | Add all available components |
--overwrite | Overwrite existing component files |
--path <path> | Custom path for component installation |
doctor
Validate your project setup and diagnose common issues.
npx @tapcn/cli doctorChecks performed:
components.jsonexists and is valid- Required dependencies are installed
- Config files exist (babel, metro, tailwind, global.css)
- Config files contain required content
- Reports issues with links to relevant documentation
Using with shadcn CLI
Since tapcn uses the same registry format as shadcn/ui, you can also use the shadcn CLI directly:
# Add a component using the tapcn registry URL
npx shadcn@latest add https://tapcn.vercel.app/r/button.json
# Add multiple components
npx shadcn@latest add https://tapcn.vercel.app/r/button.json https://tapcn.vercel.app/r/card.jsonThis is what @tapcn/cli add does under the hood -- it resolves dependencies and delegates to shadcn.
Available Components
| Component | Dependencies |
|---|---|
text | -- |
button | text |
input | -- |
textarea | -- |
card | text |
badge | text |
label | -- |
separator | -- |
avatar | -- |
switch | -- |
checkbox | icon |
progress | -- |
dialog | icon, native-only-animated-view |
alert-dialog | button, native-only-animated-view, text |
select | icon, native-only-animated-view, text |
tabs | text |
accordion | icon, text |
tooltip | native-only-animated-view, text |
popover | native-only-animated-view, text |
dropdown-menu | icon, native-only-animated-view, text |
context-menu | icon, native-only-animated-view, text |
menubar | icon, native-only-animated-view, text |
hover-card | native-only-animated-view, text |
skeleton | -- |
alert | text, icon |
toggle | icon, text |
toggle-group | icon, text, toggle |
radio-group | -- |
collapsible | -- |
aspect-ratio | -- |