A lightweight and flexible command-line tool to scaffold React components, hooks, pages, and providers with ease.
- Generate ready-to-use React components, hooks, pages, and providers
- Supports nested folder paths (e.g.,
ui/Button) - Choose between JS, JSX, TS, TSX file extensions
npm install -g infy-react-cliOr using yarn:
yarn global add infy-react-cliThen you can run commands directly:
infy g component ButtonIf you prefer to install it locally (inside your project):
npm install infy-react-cli --save-devThen use npx to run commands:
npx infy g component Button💡 Note: When installed locally, always prefix commands with
npx(e.g.,npx infy info,npx infy init).
infy g component ButtonCreates:
src/components/Button.jsx
| Type | Example Command | Output Path |
|---|---|---|
component |
infy g component Card |
src/components/Card.jsx |
hook |
infy g hook useCounter |
src/hooks/useCounter.js |
page |
infy g page Home |
src/pages/Home.jsx |
provider |
infy g provider AppProvider |
src/provider/AppProvider.jsx |
You can customize where files are generated by creating a .infyrc.json file in your project root.
Run:
infy initThis command creates a .infyrc.json file with default paths:
{
"paths": {
"component": "src/components",
"hook": "src/hooks",
"page": "src/pages",
"provider": "src/provider"
},
"extension": "jsx"
}You can edit these paths anytime. For example:
{
"paths": {
"component": "app/ui",
"hook": "app/hooks",
"page": "app/pages",
"provider": "app/providers"
},
"extension": "tsx"
}Now, all generated files will follow your custom folder structure
- Add template customization (user-defined blueprints)
- Interactive prompts for config setup
- TypeScript CLI generation
- Integration with React frameworks (Next.js, Vite)
Ivan Dev
Built for fast React development.
This project is licensed under the MIT License.