๐Ÿš€ 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. 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. ๐Ÿ—‘๏ธ Removes entire feature folders safely
  3. ๐Ÿ”ง Saves architecture and path preferences to reduce prompts
  4. ๐Ÿ› ๏ธ 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:

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 tool will remember your choice.

Architecture type:

1: MVC

2: MVVM

Note: You must configure the state management 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.

Confirms and deletes the feature directory based on previously saved config.

๐Ÿ”„ 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 Details

๐Ÿ“ MVC Folder Structure

lib/src/features/<feature_name>/
โ”œโ”€โ”€ controllers/
โ”‚   โ””โ”€โ”€ <feature_name>_controller.dart
โ”œโ”€โ”€ model/
โ”‚   โ””โ”€โ”€ <feature_name>_model.dart
โ””โ”€โ”€ views/
    โ”œโ”€โ”€ screen/
    โ”‚   โ””โ”€โ”€ <feature_name>_screen.dart
    โ””โ”€โ”€ widget/

๐Ÿ“ MVVM Folder Structure

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/

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

Raihan Sikdar

Website: raihansikdar.com
Email: [email protected]
GitHub: raihansikdar
LinkedIn: raihansikdar

๐Ÿ“œ License

This package is licensed under the MIT License.

Libraries

raihan_cli