flutter_feature_cli 1.1.0
flutter_feature_cli: ^1.1.0 copied to clipboard
A Flutter CLI for generating feature modules using Partial Clean Architecture, Clean Architecture, MVC, and MVVM templates.
π Flutter Feature CLI #
Generate Flutter feature architecture in seconds.
A lightweight CLI tool that scaffolds feature modules using popular architectural patterns such as Partial Clean Architecture, Clean Architecture, MVC, and MVVM.
β¨ Features #
-
Generate complete feature structures instantly
-
Supports multiple architecture templates:
- Partial Clean Architecture
- Clean Architecture
- MVC
- MVVM
-
Configurable output path via
pubspec.yaml -
Supports command-level path overrides
-
Auto-generates barrel exports (
index.dart) -
Reduces repetitive boilerplate code
-
Fully tested and production-ready
π¦ Installation #
Add the package to your Flutter project:
dev_dependencies:
flutter_feature_cli: ^1.1.0
Install dependencies:
flutter pub get
βοΈ Configuration (Optional) #
Configure a default feature generation path in your project's pubspec.yaml.
flutter_feature_cli:
path: lib/src/features
If omitted, the package falls back to:
lib/features
π Create a Feature #
Generate a feature using the default template (partial_clean):
dart run flutter_feature_cli create authentication
π Templates #
Partial Clean Architecture (Default) #
dart run flutter_feature_cli create authentication
Generated structure:
authentication/
βββ data/
β βββ data_sources/
β βββ entities/
β βββ repository/
β
βββ presentation/
β βββ view_models/
β βββ widgets/
β
βββ index.dart
Clean Architecture #
dart run flutter_feature_cli create authentication \
--template clean_architecture
or
dart run flutter_feature_cli create authentication \
-t clean_architecture
Generated structure:
authentication/
βββ data/
β βββ data_sources/
β βββ models/
β βββ repositories/
β
βββ domain/
β βββ entities/
β βββ repositories/
β βββ use_cases/
β
βββ presentation/
β βββ pages/
β βββ view_models/
β βββ widgets/
β
βββ index.dart
MVC #
dart run flutter_feature_cli create authentication \
-t mvc
Generated structure:
authentication/
βββ models/
βββ controllers/
βββ views/
βββ widgets/
βββ index.dart
MVVM #
dart run flutter_feature_cli create authentication \
-t mvvm
Generated structure:
authentication/
βββ models/
βββ view_models/
βββ views/
βββ widgets/
βββ index.dart
π― Custom Output Path #
Override the configured path directly from the command:
dart run flutter_feature_cli create authentication \
--path lib/src/features
or
dart run flutter_feature_cli create authentication \
-p lib/src/features
You can combine both options:
dart run flutter_feature_cli create authentication \
-t clean_architecture \
-p lib/src/features
The command-line path always takes precedence over the path configured in pubspec.yaml.
π» Commands #
Generate a feature:
dart run flutter_feature_cli create <feature_name>
Generate a feature using a specific template:
dart run flutter_feature_cli create <feature_name> \
--template <template>
Generate a feature in a custom location:
dart run flutter_feature_cli create <feature_name> \
--path <path>
Available templates:
partial_clean
clean_architecture
mvc
mvvm
π£ Roadmap #
- Custom templates via
pubspec.yaml - Entity generation
- CRUD scaffolding
- Project setup command
- Bulk feature generation
- Architecture validation
- Feature merge utilities
π€ Contributing #
Contributions, issues, and feature requests are welcome.
π License #
MIT License
Copyright (c) 2026 Hasan Shaikh - HasneticLabs