Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Init CLI

A powerful Dart CLI to bootstrap production-ready Flutter projects with clean architecture and best practices.


Dart Flutter CLI License: MIT


OverviewFeaturesInstallationUsageConfigurationExampleProject StructureContributing


📖 Overview

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.yaml with 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 overwrites pubspec.yaml, analysis_options.yaml, and README.md.


✨ Features

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

🚀 Installation

Activate Globally

dart pub global activate flutter_init_cli

Run the CLI

flutter_init_cli --help

Or Run From Source

dart run bin/flutter_init_cli.dart --help

⚙️ Usage

Initialize the Current Flutter Project

flutter_init_cli

Initialize a Project by Path

flutter_init_cli --path ./my_app

Choose State Management (bloc | riverpod)

flutter_init_cli --path ./my_app --state riverpod

Show Help

flutter_init_cli --help

🛠 What The CLI Configures

After running the CLI, it automatically:

  • Rewrites pubspec.yaml with curated dependencies and latest versions from pub.dev
  • Generates a strict analysis_options.yaml based on flutter_lints
  • Replaces the project README.md with a ready-to-edit template
  • Generates a comprehensive Material 3 theme system (AppColors, AppTextTheme, and AppTheme)
  • Configures English and Arabic localization with l10n.yaml and .arb files
  • Sets up a scalable routing system using go_router (AppRouter, AppRoutes, and modular route files)
  • Requires internet access to fetch dependency versions

📋 Example Workflow

# 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 run

🧪 Lint & Analyzer Rules

The CLI applies a strict and clean analyzer configuration focused on:

  • Consistent code style
  • Safer APIs
  • Readability
  • Maintainability
  • Production-grade standards

🔧 Tech Stack

Tool Purpose
Dart CLI Command-line interface
YAML Editor Automatic pubspec modifications
Analyzer Static analysis & linting

📦 Project Structure

flutter_init_cli/
├── bin/
│   └── flutter_init_cli.dart
├── lib/
│   ├── services/
│   ├── utils/
│   ├── steps/
│   ├── init_context.dart
│   ├── init_step.dart
│   └── runner.dart
├── pubspec.yaml
└── README.md

🤝 Contributing

Contributions are welcome.

Development Setup

git clone https://github.com/mohamedelesawy19/flutter_init_cli.git

cd flutter_init_cli

dart pub get

Run Locally

dart run bin/flutter_init_cli.dart --path /path/to/your_flutter_app

Analyze

dart analyze

Format

dart format .

📄 License

MIT License © 2026 Mohamed Elesawy

Built with ❤️ using Dart & Flutter


Email WhatsApp LinkedIn

About

A powerful Dart CLI to bootstrap production-ready Flutter projects with clean architecture and best practices.

Resources

Stars

Watchers

Forks

Contributors

Languages