A powerful Dart CLI to bootstrap production-ready Flutter projects with clean architecture and best practices.
Overview • Features • Installation • Usage • Configuration • Example • Project Structure • Contributing
flutter_init_cli is a Dart CLI tool that standardizes setup for existing Flutter projects.
Instead of manually configuring every project after flutter create, the CLI applies a consistent baseline with:
- Rewritten
pubspec.yamlwith curated dependencies - Strict
analysis_options.yaml - A ready-to-edit README template
- Built-in localization setup (English & Arabic)
- Pre-configured Material 3 Theme (Colors, Text Theme, and Theme Data)
The goal is to eliminate repetitive setup work and standardize Flutter project configuration across teams and personal projects.
Note: This CLI expects a Flutter project directory (a folder that already contains
pubspec.yaml). It overwritespubspec.yaml,analysis_options.yaml, andREADME.md.
| Feature | Description |
|---|---|
| 🏗 Opinionated Setup | Applies a curated dependency and tooling baseline |
| 📦 Pubspec Setup | Rewrites pubspec.yaml using the latest versions from pub.dev |
| 🔧 State Management | Adds bloc or riverpod dependencies based on --state |
| 📏 Lint Rules | Generates a strict analysis_options.yaml on top of flutter_lints |
| 🌍 Localization | Initializes l10n support with English and Arabic ARB files |
| 🎨 Theme | Generates a complete Material 3 theme (Colors, TextTheme, AppTheme) |
| 📍 Routing | Sets up go_router with a scalable routing structure |
| 📄 README Generator | Creates a clean, editable README.md template |
| 🧹 Safe Validation | Stops if pubspec.yaml is missing |
| ⚡ Fast Setup | Runs in seconds |
| 🖥 Pure Dart CLI | Lightweight and fast without Flutter runtime dependency |
dart pub global activate flutter_init_cliflutter_init_cli --helpdart run bin/flutter_init_cli.dart --helpflutter_init_cliflutter_init_cli --path ./my_appflutter_init_cli --path ./my_app --state riverpodflutter_init_cli --helpAfter running the CLI, it automatically:
- Rewrites
pubspec.yamlwith curated dependencies and latest versions from pub.dev - Generates a strict
analysis_options.yamlbased onflutter_lints - Replaces the project
README.mdwith a ready-to-edit template - Generates a comprehensive Material 3 theme system (AppColors, AppTextTheme, and AppTheme)
- Configures English and Arabic localization with
l10n.yamland.arbfiles - Sets up a scalable routing system using
go_router(AppRouter, AppRoutes, and modular route files) - Requires internet access to fetch dependency versions
# Create project
flutter create ecommerce_app
# Move into project
cd ecommerce_app
# Initialize configuration
flutter_init_cli --state bloc
# Install dependencies
flutter pub get
# Run app
flutter runThe CLI applies a strict and clean analyzer configuration focused on:
- Consistent code style
- Safer APIs
- Readability
- Maintainability
- Production-grade standards
| Tool | Purpose |
|---|---|
| Dart CLI | Command-line interface |
| YAML Editor | Automatic pubspec modifications |
| Analyzer | Static analysis & linting |
flutter_init_cli/
├── bin/
│ └── flutter_init_cli.dart
├── lib/
│ ├── services/
│ ├── utils/
│ ├── steps/
│ ├── init_context.dart
│ ├── init_step.dart
│ └── runner.dart
├── pubspec.yaml
└── README.mdContributions are welcome.
git clone https://github.com/mohamedelesawy19/flutter_init_cli.git
cd flutter_init_cli
dart pub getdart run bin/flutter_init_cli.dart --path /path/to/your_flutter_appdart analyzedart format .MIT License © 2026 Mohamed Elesawy