You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# rn-enterprise-cli
An interactive CLI that scaffolds production-grade React Native projects: centralized
app configuration, environment management, Firebase, multi-provider authentication,
notifications, offline-first support, navigation, state management, a repository-pattern
networking layer, a themeable UI kit, localization/RTL/accessibility, security utilities,
Android/iOS native setup checklists, testing, code quality tooling, and DevOps (CI + Fastlane).
This tool was generated to satisfy the full **React Native Enterprise CLI Master Prompt
(Coverage Edition)** specification — every mandatory coverage area in that spec maps to a
generator in `src/generators/`.
## Install
This project has no network access to pre-install dependencies in this environment. To
use it yourself:
```bash
cd rn-enterprise-cli
npm install
npm link # makes the `rn-enterprise` command available globally, OR:
node bin/cli.js create # run directly without linking
```
## Usage
### Scaffold a new project
```bash
rn-enterprise create MyApp
# or fast-track with a preset:
rn-enterprise create MyApp --preset enterprise --yes
```
Presets: `minimal`, `standard`, `enterprise` (see `src/data/presets.js`).
The wizard walks through every section of the spec: project identity, language/tooling,
architecture, state management, environments, Firebase modules, auth methods,
notifications, offline-first, navigation, storage, security, localization/accessibility,
DevOps, testing, and code quality — then generates a complete project into the target
folder.
### Generate new code into an existing project
```bash
cd MyApp
rn-enterprise generate screen ProductDetails --feature catalog
rn-enterprise generate service PaymentsApi
rn-enterprise generate component PriceTag
rn-enterprise generate module Checkout
```
This is also where teams register their own generators — see the generated project's
`PLUGINS.md` for the plugin contract.
### Self-update
```bash
rn-enterprise update
```
Checks npm for a newer published version of this CLI and offers to install it.
## How this maps to the spec
| Spec area | Where it's implemented |
|---|---|
| Interactive CLI (prompts, checkboxes, validation, presets, conditional questions) | `src/prompts/index.js`, `src/data/presets.js`, `src/utils/validators.js` |
| Project Configuration / app.config.js | `src/generators/configFiles.js` |
| Language & Tooling / package manager | `src/generators/packageJsonGen.js` |
| Environment Management | `src/generators/configFiles.js` |
| Firebase (all 14 modules) | `src/generators/firebase.js` |
| Authentication (all providers) | `src/generators/auth.js` |
| Notifications | `src/generators/notifications.js` |
| Offline First | `src/generators/offline.js` |
| Navigation | `src/generators/navigation.js` |
| State (Redux Toolkit/Persist, Zustand, React Query, Context) | `src/generators/state.js` |
| Networking (Axios, interceptors, token refresh, repository pattern) | `src/generators/networking.js` |
| Architecture (Clean/MVVM/Feature-based) | `src/generators/scaffold.js` |
| UI kit | `src/generators/ui.js` |
| Localization, RTL, Accessibility | `src/generators/localization.js` |
| Storage (MMKV, Secure Storage, Keychain) | `src/generators/security.js` (tokenStorage), `packageJsonGen.js` |
| Security (all 15 features + rationale) | `src/generators/security.js` |
| Android / iOS native configuration | `src/generators/native.js` |
| DevOps (git, GitHub Actions, Fastlane) | `src/generators/devops.js` |
| Testing (Jest, Detox, RNTL) | `src/generators/testing.js` |
| Code Quality (ESLint, Prettier, Husky, lint-staged, Commitlint) | `src/generators/codeQuality.js` |
| Plugin system / custom generators | `src/generators/customGenerator.js`, generated `PLUGINS.md` |
| Update system | `src/utils/selfUpdate.js` |
| Documentation & Roadmap | `src/generators/docs.js` |
## Notes on scope decisions
- **"300–500 interactive prompts"**: a single wizard with that many fixed questions
would be unusable. Instead, the wizard covers ~60 well-organized questions across all
required categories in one run, and the `generate` command adds further prompts
per-invocation (screens, services, modules, components — repeatable indefinitely).
See the comment at the top of `src/prompts/index.js` for the full rationale.
- **Android/iOS "auto configuration"**: native projects come from the React Native
community CLI template, not from this tool, so instead of writing fragile Gradle/Xcode
files that vary by RN version, `src/generators/native.js` generates precise
checklists + copy-pasteable snippets tied to exactly what the user selected.
- All generators were tested end-to-end (both TypeScript and JavaScript output modes)
by running the full generation pipeline and syntax-checking every emitted file with
`tsc --noEmit`.
# Rn-cli