Flutter GetX CLI

A Dart CLI tool that generates production-ready Flutter + GetX Clean Architecture projects and modules with a single command.

πŸ“ Generated Project Structure

lib/
β”œβ”€β”€ main.dart
└── app/
    β”œβ”€β”€ di.dart                      # Dependency injection setup
    β”œβ”€β”€ core/
    β”‚   β”œβ”€β”€ constants/
    β”‚   β”‚   └── app_constants.dart
    β”‚   β”œβ”€β”€ theme/
    β”‚   β”‚   └── app_theme.dart
    β”‚   β”œβ”€β”€ utils/
    β”‚   β”‚   └── extensions.dart
    β”‚   └── widgets/                 # Shared widgets (Loading, Error, Empty)
    β”œβ”€β”€ data/
    β”‚   β”œβ”€β”€ entities/
    β”‚   β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ providers/
    β”‚   β”‚   └── base_provider.dart   # Dio-based HTTP base class
    β”‚   β”œβ”€β”€ repositories/
    β”‚   β”‚   └── base_repository.dart
    β”‚   β”œβ”€β”€ services/
    β”‚   β”‚   └── network_service.dart # Configured Dio instance
    β”‚   └── usecases/
    β”œβ”€β”€ modules/
    β”‚   └── splash/                  # Generated with every project
    β”‚       β”œβ”€β”€ bindings/
    β”‚       β”œβ”€β”€ controllers/
    β”‚       └── views/
    └── routes/
        β”œβ”€β”€ app_routes.dart          # Route name constants
        β”œβ”€β”€ app_pages.dart           # GetPage definitions
        └── routes.dart              # Barrel export

πŸš€ Installation

Option 1: Install globally via dart pub global activate

dart pub global activate clean_arch_getx_cli

Option 2: Install from GitHub source

dart pub global activate --source git https://github.com/yusufkrrt/clean_arch_getx_cli

πŸ›  Usage

Create a new Flutter project

getx_cli create my_app

With custom organization:

getx_cli create my_app --org com.mycompany

Apply to an existing Flutter project (skip flutter create):

getx_cli create my_app --no-flutter

Add a module to an existing project

Run from inside your Flutter project root:

cd my_app
getx_cli module home
getx_cli module user_profile
getx_cli module product_detail

Each module generates:

lib/app/modules/<module_name>/
β”œβ”€β”€ bindings/<module_name>_binding.dart
β”œβ”€β”€ controllers/<module_name>_controller.dart
└── views/<module_name>_view.dart

Routes in app_routes.dart and app_pages.dart are automatically updated.

πŸ“¦ Dependencies added to generated projects

Package Purpose
get State management, routing, DI
dio HTTP client
get_storage Local key-value storage
flutter_dotenv Environment variables

πŸ”§ Development

# Run from source
dart run bin/getx_cli.dart create my_app

# Compile to exe
dart compile exe bin/getx_cli.dart -o bin/getx_cli.exe

# Analyze
dart analyze

Libraries