add command helps you quickly add new resources, providers, and integrations to your Refine application.
Usage
Subcommands
refine add resource- Add new resources (CRUD pages)refine add provider- Add provider implementationsrefine add integration- Add UI framework integrations
Interactive Mode
Run without arguments to enter interactive mode:Output
Add Resource
Generate CRUD pages for a new resource.Usage
Arguments
Names of resources to create. You can specify multiple resources at once.
Options
Path to generate resource files
Only generate specified resource actions. Provide as comma-separated list.
Examples
Create a Single Resource
src/pages/products/list.tsx- List pagesrc/pages/products/create.tsx- Create pagesrc/pages/products/edit.tsx- Edit pagesrc/pages/products/show.tsx- Show page
Create Multiple Resources
Create Specific Actions Only
src/pages/products/list.tsxsrc/pages/products/create.tsx
Custom Output Path
Interactive Mode
Output
Add Provider
Add provider implementations to your project.Usage
Arguments
Provider types to add. Available providers:
auth- Authentication providerdata- Data providerlive- Live/realtime provideraccess-control- Access control providernotification- Notification provideri18n- Internationalization provideraudit-log- Audit log provider
Options
Path to generate provider files
Available Providers
Auth Provider
Manage user authentication and authorization:src/providers/auth-provider.tsx
Data Provider
Communicate with your API:src/providers/data-provider.tsx
Live Provider
Enable real-time updates and synchronization:src/providers/live-provider.tsx
Access Control Provider
Manage user permissions and roles:src/providers/access-control-provider.tsx
Notification Provider
Display in-app alerts and messages:src/providers/notification-provider.tsx
i18n Provider
Support multiple languages and locales:src/providers/i18n-provider.tsx
Audit Log Provider
Display audit logs for your resources:src/providers/audit-log-provider.tsx
Examples
Add Single Provider
Output
Add Multiple Providers
Output
Custom Output Path
Interactive Mode
Output
Add Integration
Add UI framework and router integrations to your project.Usage
Arguments
Name of the integration to add. Available integrations:
ant-design- Ant Design UI frameworkreact-router- React Router integration
Available Integrations
Ant Design
Add Ant Design UI framework to your project:- Install
@refinedev/antdpackage - Add necessary imports to your app
- Configure Ant Design theme
- Set up required components
React Router
Add React Router integration:- Install
@refinedev/react-router-v6package - Set up routing configuration
- Add necessary providers
- Configure route definitions
Examples
Add Ant Design
Output
Add React Router
Output
Interactive Mode
Output
Common Workflows
Setting Up a New Project
-
Add authentication:
-
Add your first resource:
-
Configure data provider:
Adding a Complete Feature
Migrating to a New UI Framework
Generated File Structure
After running add commands, your project structure might look like:Next Steps
After adding resources and providers:- Update your App.tsx to register new resources
- Configure providers with your API endpoints
- Customize generated pages to match your requirements
- Add validation and business logic
- Test your changes with
refine dev