fah0x
v1.0.2
Published
Create BoilerPlate Fivem with React using this command
Maintainers
Readme
fah0_0x CLI
A modular npm CLI generator for FiveM React UI resources, built directly on top of the workshop's source boilerplates without duplication or altering existing boilerplate integrity.
Usage
Interactive Mode
Run the generator interactively:
npx fah0_0x install_reactor (when installed / linked globally):
fah0_0x install_reactPrompt Flow
? Select language
❯ JavaScript
TypeScript
? Select state management
❯ Zustand
Redux
None
? Do you want Tailwind CSS?
❯ Yes
No
? Do you want shadcn/ui?
❯ Yes
No
? Project name: my-resourceIf shadcn/ui is selected but Tailwind CSS is not enabled, the CLI automatically prompts:
shadcn/ui requires Tailwind CSS.
? Enable Tailwind CSS?
❯ Yes
NoThen reviews your configuration:
Project configuration
Language: TypeScript
State: Zustand
Tailwind: Yes
shadcn/ui: Yes
Project: my-resource
? Continue?
❯ Yes
NoAnd executes the generator pipeline:
Creating project...
✔ Using TypeScript boilerplate
✔ Creating project
✔ Configuring state management
✔ Configuring Tailwind
✔ Configuring shadcn/ui
✔ Installing dependencies
✔ Finalizing project
🎉 Project created successfully!Non-Interactive / Scripted Flags
You can also pass arguments directly for automation:
err install_react --language typescript --state zustand --tailwind --shadcn --name my-resourceAvailable flags:
-l, --language <javascript|typescript>-s, --state <zustand|redux|none>-t, --tailwind/--no-tailwind-u, --shadcn/--no-shadcn-n, --name <name>--skip-install(Skip dependency installation and build verification)
Architecture
The CLI is structured for extensibility and modularity:
src/
├── cli.ts # CLI entrypoint with shebang
├── commands/
│ └── installReact.ts # install_react command handler
├── prompts/
│ └── reactPrompts.ts # Interactive prompt flow
├── generator/
│ ├── types.ts # Shared configurations & extensible types
│ ├── generateProject.ts # Orchestrator with step spinners
│ ├── copyBoilerplate.ts # Boilerplate copier & template resolver
│ ├── configureState.ts # Zustand / Redux / None configurator
│ ├── configureTailwind.ts # Tailwind inspector & configurator
│ ├── configureShadcn.ts # shadcn/ui & components.json configurator
│ └── installDependencies.ts # Dependency installer & build verifier
└── utils/
├── filesystem.ts # File and directory operations
├── packageJson.ts # Safe package.json dependency updater
├── shell.ts # Subprocess runner & package manager detection
└── templateResolver.ts # Template resolution & workshop locatorTemplate Reference System
The CLI never mutates or duplicates source templates. It resolves templates from:
- Workshop directories:
err_boilerPlateJSX(JavaScript boilerplate)err_boilerplate(TypeScript boilerplate)
templates/directory:templates/javascripttemplates/typescript
- Environment variables:
ERR_JS_TEMPLATEERR_TS_TEMPLATEERR_TEMPLATES_DIR
