raihan_cli 2.1.0
raihan_cli: ^2.1.0 copied to clipboard
raihan_cli generates clean Flutter feature folders with Clean Architecture principles, supporting MVC and MVVM patterns, and integrates seamlessly with GetX, Provider, Riverpod, and BLoC state management.
๐ raihan_cli โ Flutter Feature Scaffolding CLI Tool #
raihan_cli is a Dart-based command-line tool designed to automate feature creation and deletion in Flutter projects using the MVC or MVVM architectural patterns and Clean Architecture with GetX, Provider, Riverpod and BLoC state management. It helps developers maintain a clean and consistent project structure while saving time on repetitive boilerplate setup.
๐ฆ Installation #
To install globally from the Pub.dev package:
dart pub global activate raihan_cli
Alternatively, to install from the Git repository:
dart pub global activate --source git https://github.com/raihansikdar/raihan_cli.git
๐ What It Does #
-
โ Scaffolds folders and files for new features (Clean Architecture, MVC and MVVM)
-
๐ ๏ธ Supports GetX, Provider, Riverpod and BLoC state management
-
๐๏ธ Removes entire feature folders safely
-
๐ง Saves architecture and path preferences to reduce prompts
-
๐ ๏ธ Supports custom folder paths (e.g., lib/core/feature_name) or default feature-based structure (lib/src/features/feature_name)
๐งช Basic Usage #
โถ๏ธ Create a New Feature #
raihan_cli <feature_name>
Example: raihan_cli product
Youโll be prompted to choose:
1๏ธโฃ Folder Structure Type: #
1: Default (lib/src/features/<feature_name>)
2: Custom (lib/<custom_path>/<feature_name>)
Note: You must configure the path type on the first run. The package will remember your choice.
2๏ธโฃ State Management: #
-
getx
-
provider
-
riverpod
-
bloc
-
others
Note: You must configure the state management on the first run. The package will remember your choice.
3๏ธโฃ Architecture type: #
-
mvc
-
mvvm
-
clean architecture
Note: You must configure Architecture on the first run. The tool will remember your choice.
Then your feature folder will create successfully. #
If folder is not showing then collapse your parent folder like this #

๐๏ธ Remove an Existing Feature #
raihan_cli remove <feature_name>
Example: raihan_cli remove product
Note: If folder is still showing then collapse your parent folder.
This confirms and deletes the feature directory based on your saved configuration..
๐ Reset Configuration (if did mistake) #
# Windows
del tool\.cli_architecture_config
# macOS/Linux
rm tool/.cli_architecture_config
โ Deactivating the CLI Package: #
dart pub global deactivate raihan_cli
๐ก Architecture + State Management Examples #
๐ MVC Folder Structure #
๐ MVC + GetX #
lib/src/features/<feature_name>/ # if custom path is "features"
โโโ controllers/
โ โโโ <feature_name>_controller.dart
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVC + Provider #
lib/src/features/<feature_name>/ # if custom path is "features"
โโโ provider/
โ โโโ <feature_name>_provider.dart
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVC + Riverpod #
lib/src/features/<feature_name>/
โโโ riverpod/
โ โโโ <feature_name>_notifier.dart # StateNotifier / AsyncNotifier class
โ โโโ <feature_name>_provider.dart # Riverpod provider exposing the notifier
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVC + BLoC #
lib/src/features/<feature_name>/ # if custom path is "features"
โโโ bloc/
โ โโโ <feature_name>_bloc.dart
โ โโโ <feature_name>_event.dart
โ โโโ <feature_name>_state.dart
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVVM Folder Structure #
๐ MVVM + GetX #
lib/features/<feature_name>/ # if custom path is "features"
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ view_model/
โ โโโ <feature_name>_view_model.dart
โโโ repository/
โ โโโ <feature_name>_repository.dart
โ โโโ <feature_name>_repository_impl.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVVM + Provider #
lib/features/<feature_name>/ # if custom path is "features"
โโโ view_model_provider/
โ โโโ <feature_name>_view_model_provider.dart
โโโ repository/
โ โโโ <feature_name>_repository.dart
โ โโโ <feature_name>_repository_impl.dart
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVVM + Riverpod #
lib/features/<feature_name>/
โโโ view_model_riverpod/
โ โโโ <feature_name>_notifier.dart # StateNotifier / AsyncNotifier class
โ โโโ <feature_name>_provider.dart # Riverpod provider exposing the notifier
โโโ repository/
โ โโโ <feature_name>_repository.dart
โ โโโ <feature_name>_repository_impl.dart
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ MVVM + BLoC #
lib/features/<feature_name>/ # if custom path is "features"
โโโ bloc/
โ โโโ <feature_name>_bloc.dart
โ โโโ <feature_name>_event.dart
โ โโโ <feature_name>_state.dart
โโโ repository/
โ โโโ <feature_name>_repository.dart
โ โโโ <feature_name>_repository_impl.dart
โโโ model/
โ โโโ <feature_name>_model.dart
โโโ views/
โโโ screen/
โ โโโ <feature_name>_screen.dart
โโโ widgets/
๐ Clean Architecture Folder Structure #
๐ Clean Architecture + GetX #
lib/features/<feature_name>/ # if custom path is "features"/
โโโ data/
โ โโโ data_source/
โ โ โโโ <feature_name>_remote_data_source.dart
โ โ โโโ <feature_name>_remote_data_source_impl.dart
โ โโโ model/
โ โ โโโ <feature_name>_model.dart
โ โโโ repository/
โ โโโ <feature_name>_repository_impl.dart
โโโ domain/
โ โโโ entities/
โ โ โโโ <feature_name>_entities.dart
โ โโโ repository/
โ โ โโโ <feature_name>_repository.dart
โ โโโ use_case/
โ โโโ <feature_name>_use_case.dart
โโโ presentation/
โ โโโ controller/
โ โ โโโ <feature_name>_controller.dart
โ โโโ views/
โ โโโ screen/
โ โ โโโ <feature_name>_screen.dart
โ โโโ widgets
โโโ <feature_name>_dependency_injection.dart
๐ Clean Architecture + Provider #
lib/features/<feature_name>/ # if custom path is "features"/
โโโ data/
โ โโโ data_source/
โ โ โโโ <feature_name>_remote_data_source.dart
โ โ โโโ <feature_name>_remote_data_source_impl.dart
โ โโโ model/
โ โ โโโ <feature_name>_model.dart
โ โโโ repository/
โ โโโ <feature_name>_repository_impl.dart
โโโ domain/
โ โโโ entities/
โ โ โโโ <feature_name>_entities.dart
โ โโโ repository/
โ โ โโโ <feature_name>_repository.dart
โ โโโ use_case/
โ โโโ <feature_name>_use_case.dart
โโโ presentation/
โ โโโ provider/
โ โ โโโ <feature_name>_provider.dart
โ โโโ views/
โ โโโ screen/
โ โ โโโ <feature_name>_screen.dart
โ โโโ widgets
โโโ <feature_name>_dependency_injection.dart
๐ Clean Architecture + Riverpod #
lib/features/<feature_name>/ # if custom path is "features"/
โโโ data/
โ โโโ data_source/
โ โ โโโ <feature_name>_remote_data_source.dart
โ โ โโโ <feature_name>_remote_data_source_impl.dart
โ โโโ model/
โ โ โโโ <feature_name>_model.dart
โ โโโ repository/
โ โโโ <feature_name>_repository_impl.dart
โโโ domain/
โ โโโ entities/
โ โ โโโ <feature_name>_entities.dart
โ โโโ repository/
โ โ โโโ <feature_name>_repository.dart
โ โโโ use_case/
โ โโโ <feature_name>_use_case.dart
โโโ presentation/
โ โโโ riverpod/
โ โ โโโ <feature_name>_notifier.dart
โ โ โโโ <feature_name>_provider.dart
โ โโโ views/
โ โโโ screen/
โ โ โโโ <feature_name>_screen.dart
โ โโโ widgets
โโโ <feature_name>_dependency_injection.dart
๐ Clean Architecture + BLoC #
lib/features/<feature_name>/ # if custom path is "features"/
โโโ data/
โ โโโ data_source/
โ โ โโโ <feature_name>_remote_data_source.dart
โ โ โโโ <feature_name>_remote_data_source_impl.dart
โ โโโ model/
โ โ โโโ <feature_name>_model.dart
โ โโโ repository/
โ โโโ <feature_name>_repository_impl.dart
โโโ domain/
โ โโโ entities/
โ โ โโโ <feature_name>_entities.dart
โ โโโ repository/
โ โ โโโ <feature_name>_repository.dart
โ โโโ use_case/
โ โโโ <feature_name>_use_case.dart
โโโ presentation/
โ โโโ bloc/
โ โ โโโ <feature_name>_bloc.dart
โ โ โโโ <feature_name>_event.dart
โ โ โโโ <feature_name>_state.dart
โ โโโ views/
โ โโโ screen/
โ โ โโโ <feature_name>_screen.dart
โ โโโ widgets
โโโ <feature_name>_dependency_injection.dart
๐จโ๐ป Author #
Raihan Sikdar
Website: raihansikdar.com
Email: [email protected]
GitHub: raihansikdar
LinkedIn: raihansikdar
๐ License #
This package is licensed under the MIT License.