A simple CLI tool to quickly set up Redux Toolkit in your Next.js 13+ App Router projects.
Installation
npx @1hirak/rtk-setup-next
pnpm dlx @1hirak/rtk-setup-next
What it does
This tool automatically:
* Installs Redux Toolkit and React Redux
* Creates a basic store configuration
* Sets up a demo counter slice
* Creates an optimized Redux provider
* Integrates everything into your Next.js layout
Generated files
src/app/
├── layout.js (modified to include Redux provider)
└── redux/
├── store.js
├── provider.jsx
└── features/
└── demo/
└── demoSlice.js
Usage example
After running the setup, you can use Redux in any client component:
'use client';
import { useSelector, useDispatch } from 'react-redux';
import { increment, decrement } from './app/redux/features/demo/demoSlice';