raihan_cli 2.0.0 copy "raihan_cli: ^2.0.0" to clipboard
raihan_cli: ^2.0.0 copied to clipboard

raihan_cli generates clean Flutter feature folders with MVC or MVVM architecture, supporting 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 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 #

  1. โœ… Scaffolds folders and files for new features (MVC or MVVM)

  2. ๐Ÿ› ๏ธ Supports GetX, Provider, Riverpod and BLoC state management

  3. ๐Ÿ—‘๏ธ Removes entire feature folders safely

  4. ๐Ÿ”ง Saves architecture and path preferences to reduce prompts

  5. ๐Ÿ› ๏ธ 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: #

  1. getx

  2. provider

  3. riverpod

  4. bloc

  5. others

Note: You must configure the state management on the first run. The package will remember your choice.

3๏ธโƒฃ Architecture type: #

  1. mvc

  2. mvvm

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 #

raihan_cli

๐Ÿ—‘๏ธ 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
    โ””โ”€โ”€ widget/

๐Ÿ“ 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
    โ””โ”€โ”€ widget/

๐Ÿ“ MVC + Riverpod #

lib/src/features/<feature_name>/      
โ”œโ”€โ”€ provider/
โ”‚   โ”œโ”€โ”€ <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
    โ””โ”€โ”€ widget/
    

๐Ÿ“ 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
    โ””โ”€โ”€ widget/

๐Ÿ“ 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
    โ””โ”€โ”€ widget/

๐Ÿ“ 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
    โ””โ”€โ”€ widget/

๐Ÿ“ MVVM + Riverpod #

lib/features/<feature_name>/           
โ”œโ”€โ”€ view_model_provider/
โ”‚   โ”œโ”€โ”€ <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
    โ””โ”€โ”€ widget/

๐Ÿ“ 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
    โ””โ”€โ”€ widget/

๐Ÿ‘จโ€๐Ÿ’ป Author #

Raihan Sikdar

Website: raihansikdar.com
Email: raihansikdar10@gmail.com
GitHub: raihansikdar
LinkedIn: raihansikdar

๐Ÿ“œ License #

This package is licensed under the MIT License.

8
likes
150
points
8
downloads

Publisher

verified publisherraihansikdar.com

Weekly Downloads

raihan_cli generates clean Flutter feature folders with MVC or MVVM architecture, supporting GetX, Provider, Riverpod, and BLoC state management.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on raihan_cli