CLI
Use the Lunar Kit CLI to manage components and modules in your project
The Lunar Kit CLI (lunar) helps you add and manage components, modules, and localization in your React Native project.
Installation
Available Commands
| Command | Description |
|---|---|
| lunar init | Initialize Lunar Kit in your project |
| lunar add | Add a UI component or locale to your project |
| lunar generate (g) | Generate a Lunar Kit element (module, component, etc.) |
init
Initialize Lunar Kit in your existing React Native project.
What it does
- Creates src/components/ui directory
- Sets up lib/utils.ts with helper functions
- Installs required dependencies (clsx, tailwind-merge)
- Creates kit.config.json configuration file
Interactive Prompts
add
Add components from the Lunar Kit registry or setup localization entries.
UI Components
Localization
Add a translation entry to all locale files:
generate (gen, g)
Generate a Lunar Kit element using schematics. This powerful command allows you to scaffold modules, components, stores, hooks, and localization files.
Available Schematics
Module
| Schematic | Alias | Description |
|---|---|---|
| mod | mod | Generate a module |
| tabs | tabs | Generate a tabs module |
Module-Scoped
Generate elements within a specific module:
| Schematic | Alias | Description |
|---|---|---|
| mod:view | mod:vi | Generate a view in module |
| mod:component | mod:co | Generate a component in module |
| mod:store | mod:st | Generate a store in module |
| mod:hook | mod:ho | Generate a hook in module |
Global
Create elements in the global src/ directory (e.g. src/components/, src/hooks/, src/stores/):
| Schematic | Alias | Description |
|---|---|---|
| component | co | Generate a global component |
| hook | ho | Generate a global hook |
| store | st | Generate a global store |
Localization
Manage translation files:
| Schematic | Alias | Description |
|---|---|---|
| locale | lo | Generate a new locale file |
Configuration
Lunar Kit stores configuration in kit.config.json at the root of your project:
Options
| Option | Default | Description |
|---|---|---|
| typescript | true | Use TypeScript for components |
| componentsPath | src/components | Where to store components |
| packageManager | pnpm | Package manager to use |
Workflow Examples
Starting a New Feature
Adding Components to Existing Project
Output Examples
When using the generate schema for modules and components, the CLI will log its progress and actions:
Now explore the Components documentation to learn how to use each component!