🚀 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

Libraries

flutter_feature_cli
Flutter Feature CLI.