react-isr-cli is a command-line interface inspired by the Angular CLI philosophy, tailored for React projects. Its primary goal is to facilitate the creation of structured and consistent codebases, reducing manual setup and repetitive boilerplate.
This is a community-driven project aimed at establishing a standard scaffolding workflow for React. It currently supports generating:
- Feature Structures: Scaffolds a complete module (Hooks, Services, Routes).
- React Components: Standardized components with Tailwind or CSS support.
- Services (Axios/Fetch): Dedicated layer for HTTP requests and logic.
- Interfaces (TypeScript): Data models and API contract definitions.
Commands are designed to be concise. You can use the full name or the alias:
| Alias | Full Command | Description |
|---|---|---|
| feature | feature |
Generate a complete feature structure |
| c | component |
Generate a standard React component |
| ct | componenttailwind |
Generate a component with Tailwind CSS |
| ccss | componentcss |
Generate a component with standard CSS |
| i | interface |
Generate a TypeScript interface |
| sf | servicef |
Generate a service using Fetch API |
| sa | servicea |
Generate a service using Axios |
When you run the commands, the CLI creates the files following a clean path structure:
# Example output for a user feature:
Create in: src/features/user/user.component.tsx
Create in: src/features/user/user.service.ts
Create in: src/features/user/user.hook.ts
Create in: src/features/user/user.routes.ts
Create in: src/features/user/user.interface.tsThe Goal: Speed up the development lifecycle while maintaining a 100% consistent codebase across teams and projects.
Currently, this is a minimal viable version, but it is designed to evolve to support full feature scaffolding in the future.
You can install it globally or use it directly with npx:
# Global installation
npm install -g react-isr-cli
# Use it without installing
npx react-isr-cli
- Node.js ≥ 16
- npm
We are working on making the CLI more interactive and intelligent. Future updates will include:
- Interactive Entity Generator: A guided terminal prompt (similar to Symfony) to define interfaces by asking for property names and types one by one.
- Smart Component Scaffolding: Support for generating Barrel files (
index.ts) automatically. - Custom Blueprints: Allow users to provide their own templates via a
.react-isr-configfile. - Interactive Menus: A fully interactive UI using
inquirerorpromptsto choose what to generate without remembering commands.