generate-react-cli is a command-line interface tool designed to streamline the creation of React components, aiming to boost developer productivity by automating repetitive setup tasks. The current stable version is 11.0.4, released in April 2026. This package maintains a somewhat frequent release cadence, with multiple minor and patch releases occurring monthly or bi-monthly, and major versions typically updating Node.js requirements or tooling support. Its key differentiators include an initial interactive configuration that generates a `generate-react-cli.json` file, allowing project-specific defaults for TypeScript usage, CSS modules, various CSS preprocessors (like SCSS), and testing libraries (React Testing Library, Vitest, or no tests). It offers extensive customization through command-line options and support for custom component types, templates, and file structures, enabling developers to quickly scaffold components, pages, or layouts according to their project's conventions.
npm install generate-react-cliNo compatibility data collected yet for this library.
Demonstrates how to generate a new React component using `npx`, prompting for initial configuration if run for the first time, and showing how to override default settings via command-line options.
Upgrade your Node.js installation to version 22 or newer to use versions 10.0.0 and above of this CLI tool. You can use nvm to manage multiple Node.js versions.
Update your `generate-react-cli.json` configuration to use 'Testing Library', 'Vitest', or 'None' for the `testLibrary` option. Migrate any existing Enzyme tests to the new framework as needed.
Review the generated `generate-react-cli.json` to customize default paths, styling, and testing preferences according to your project's conventions. These defaults can always be overridden with command-line options for specific generations.
Upgrade your Node.js environment to version 22 or newer. Using a Node Version Manager (nvm) is recommended for easy switching: `nvm install 22 && nvm use 22`.
Run `npx generate-react-cli component MyComponent` once. This command will interactively prompt you to set up initial configurations and then create the `generate-react-cli.json` file in your project root.
Verify the `usesCssModule` and `cssPreprocessor` settings in your `generate-react-cli.json`. Ensure `withStyle` is `true` if you expect a style file. Adjust your project's Webpack/Vite configuration to correctly handle CSS modules if necessary.
No dependency data recorded yet.