react-gen-kit
Version:
React component generator CLI
72 lines (51 loc) โข 2.29 kB
Markdown
# Hi, I'm Dewanshu! ๐
## Made with โค๏ธ for React developers.
# ๐ ๏ธ CLI for React
A powerful and flexible CLI tool to **interactively generate** React components, pages, hooks, or providers โ with full support for JavaScript or TypeScript, styles, testing, and configurable paths.
---
## โจ Features
- ๐ง Interactive CLI (like Vite!)
- โ๏ธ Generate:
- React Components
- Pages
- Hooks
- Providers
- ๐ง Supports both **JavaScript** and **TypeScript**
- ๐จ Style file support (`css`, `scss`, with optional CSS Modules)
- ๐งช Optional test file using **React Testing Library**
- ๐ Custom output path or generate in the current directory
- ๐ ๏ธ Configurable via `.componentclirc.json`
---
## ๐ฆ Installation
<!-- You can use it globally or locally โ your choice!
### ๐ Option 1: Global install
```bash
npm install -g react-gen-kit
react-generate [options] (For Custom Path and Current working directory)
Example 1: react-generate -c
Example 2: react-generate --path < your custom path >
``` -->
### ๐ Option 1: Use via npx
```bash
npm install react-gen-kit
npx react-gen-kit [options] (For Custom Path and Current working directory)
Example 1: npx react-gen-kit -c
Example 2: npx react-gen-kit --path < your custom path >
```
### ๐ Option 2: As an npm script in your project
```bash
Step 1: npm install react-gen-kit
Step 2: Add this to package.json scripts:
"scripts": {
"generate": "react-generate"
},
Step 3: Run this command in terminal "npm run generate [options]"
Example 1: npm run generate -c
Example 2: npm run generate -- --path < your custom path >
```
## ๐ ๏ธ CLI Options
| Parameter | Type | Description |
| :---------------- | :-------- | :---------------------------------------------------------------------------- |
| `--path`,`-p` | `string` | Custom relative path to place the component (e.g. `shared/ui`) |
| `--current`,`-c` | `boolean` | Generate the component inside a `components/` folder in the current directory |
<!-- | `<ComponentName>` | `string` | **Required**. Name of the React component to generate | -->