πŸ”¨ Archit CLI

A powerful command-line tool that scaffolds Flutter projects following Clean Architecture principles β€” with automatic feature generation, usecase wiring, routing, and dependency injection.


βœ… Prerequisites

flutter --version
dart --version

πŸ“¦ Installation

dart pub global activate archit

export PATH="$PATH:$HOME/.pub-cache/bin"
source ~/.zshrc

πŸš€ Usage

Create a new Flutter project

cd ~/projects
archit

Use inside an existing Flutter project

cd my_flutter_app
archit

When run inside an existing Flutter project root, Archit skips project creation and goes straight to the Feature Manager.


🎬 Interactive Flow


β–‘β–’β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘

  β–‘β–’β–“  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—     β–ˆβ–ˆβ•—  β–“β–’β–‘
  β–‘β–’β–“ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•    β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–“β–’β–‘
  β–‘β–’β–“ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–“β–’β–‘
  β–‘β–’β–“ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–“β–’β–‘
  β–‘β–’β–“ β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–“β–’β–‘
  β–‘β–’β–“ β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•šβ•β•   β•šβ•β•        β•šβ•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β–“β–’β–‘

β–‘β–’β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘
╔────────────────────────────────────────────────────────────────────────────────────╗
β•‘  ARCHIT CLI  β”‚  v0.1.0  β”‚  ARCH-GEN  β”‚  DART                                       β•‘
β•šβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•
β–‘β–’β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘

  > INITIALIZING SCAFFOLD ENGINE .......... OK
  > LOADING ARCHITECTURE MODULES .......... OK
  > MOUNTING FEATURE REGISTRY    .......... OK
  > SYSTEM READY                 .......... OK

  [ >> ]  No Flutter project found in current directory.

  $ Enter project name (snake_case) β€Ί hello_archit

  β”Œβ”€[ πŸ“± Select project type: ]
βœ”  Β· Application (app)                                                                                                                                                                        

  β”Œβ”€[ πŸ–₯️  Select target platforms: ]
βœ”  Β· Android, iOS, Web, Windows, macOS, Linux                                                                                                                                                 

  β”Œβ”€[ ⚑ Select state management: ]
βœ”  Β· BLoC                                                                                                                                                                                     
  ───────────────────────────────────────────────────────────────────────────

  β–Ά  Creating Flutter project...
  [ >> ]  Running: flutter create hello_archit

  [ OK ]  Flutter project created!
  [ >> ]  Writing pubspec.yaml with pre-configured packages...
  [ >> ]  Generating core architecture...
  [ >> ]  Generating app entry points...
  [ >> ]  Running flutter pub get...

  [ OK ]  Dependencies installed!
  ───────────────────────────────────────────────────────────────────────────

  [ OK ]  Project "hello_archit" created successfully!
  [ >> ]  State Management: BLoC
  [ >> ]  Platforms: android, ios, web, windows, macos, linux
  ───────────────────────────────────────────────────────────────────────────

β”Œβ”€[ FEATURE REGISTRY ]──────────────────────────────────────────────────────┐
β”‚    [ no features registered yet ]                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature Manager
  ❯ βž•  Add new feature
    πŸšͺ  Exit

  $ Feature name  (e.g. user_profile, auth) β€Ί auth

  β–Ά  Generating feature: auth...

  [ OK ]  Feature "auth" created and registered in routes & DI!

β”Œβ”€[ FEATURE REGISTRY ]──────────────────────────────────────────────────────┐
β”‚  01  β”‚  auth                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature Manager
    πŸ“  auth
  ❯ βž•  Add new feature
    πŸšͺ  Exit

  $ Feature name  (e.g. user_profile, auth) β€Ί home

  β–Ά  Generating feature: home...

  [ OK ]  Feature "home" created and registered in routes & DI!

β”Œβ”€[ FEATURE REGISTRY ]──────────────────────────────────────────────────────┐
β”‚  01  β”‚  auth                                                              β”‚
β”‚  02  β”‚  home                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature Manager
  ❯ πŸ“  auth
    πŸ“  home
    βž•  Add new feature
    πŸšͺ  Exit


β”Œβ”€[ USECASES  β€Ί  auth ]─────────────────────────────────────────────────────┐
β”‚    [ no usecases registered yet ]                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature: auth
  ❯ βž•  Add new usecase
    ⬅️   Back

  $ Usecase name  (e.g. get_user, login, fetch_products) β€Ί login

  β–Ά  Generating usecase: login...

  [ OK ]  UseCase "login" wired to datasource, repository & DI!

β”Œβ”€[ USECASES  β€Ί  auth ]─────────────────────────────────────────────────────┐
β”‚  01  β”‚  login                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature: auth
    🧩  login
  ❯ βž•  Add new usecase
    ⬅️   Back

  $ Usecase name  (e.g. get_user, login, fetch_products) β€Ί sign_up

  β–Ά  Generating usecase: sign_up...

  [ OK ]  UseCase "sign_up" wired to datasource, repository & DI!

β”Œβ”€[ USECASES  β€Ί  auth ]─────────────────────────────────────────────────────┐
β”‚  01  β”‚  login                                                             β”‚
β”‚  02  β”‚  sign_up                                                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature: auth
    🧩  login
    🧩  sign_up
    βž•  Add new usecase
  ❯ ⬅️   Back


β”Œβ”€[ FEATURE REGISTRY ]──────────────────────────────────────────────────────┐
β”‚  01  β”‚  auth                                                              β”‚
β”‚  02  β”‚  home                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  Feature Manager
    πŸ“  auth
    πŸ“  home
    βž•  Add new feature
  ❯ πŸšͺ  Exit

  [ >> ]  Goodbye! Happy coding πŸš€

πŸ“ Generated Project Structure

Provider / Riverpod / BLoC

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ app_constants.dart       # Base URL, timeouts, app name
β”‚   β”‚   β”œβ”€β”€ app_strings.dart         # Reusable text strings
β”‚   β”‚   └── app_sizes.dart           # Padding, radius, icon size tokens
β”‚   β”œβ”€β”€ di/
β”‚   β”‚   └── injection_container.dart # GetIt DI β€” auto-updated on feature/usecase add
β”‚   β”œβ”€β”€ errors/
β”‚   β”‚   β”œβ”€β”€ failures.dart            # ServerFailure, CacheFailure, NetworkFailure
β”‚   β”‚   └── exceptions.dart          # ServerException, CacheException
β”‚   β”œβ”€β”€ network/
β”‚   β”‚   β”œβ”€β”€ api_client.dart          # Dio client with interceptors & auth token support
β”‚   β”‚   └── network_info.dart        # Internet connectivity check
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   └── app_router.dart          # GoRouter β€” auto-updated when features are added
β”‚   β”œβ”€β”€ theme/
β”‚   β”‚   β”œβ”€β”€ app_colors.dart          # Full color palette (light/dark/gradients)
β”‚   β”‚   β”œβ”€β”€ app_theme.dart           # Material 3 light & dark ThemeData
β”‚   β”‚   └── app_text_styles.dart     # Responsive text styles (ScreenUtil)
β”‚   β”œβ”€β”€ usecases/
β”‚   β”‚   └── usecase.dart             # Abstract UseCase<Type, Params> base class
β”‚   └── utils/
β”‚       β”œβ”€β”€ extensions.dart          # Context, DateTime, String, Number extensions
β”‚       β”œβ”€β”€ validators.dart          # Email, password, phone, required validators
β”‚       └── logger.dart              # Pretty Logger instance
β”œβ”€β”€ features/
β”‚   └── product/                     # Example feature
β”‚       β”œβ”€β”€ data/
β”‚       β”‚   β”œβ”€β”€ datasources/
β”‚       β”‚   β”‚   └── product_remote_datasource.dart
β”‚       β”‚   β”œβ”€β”€ models/
β”‚       β”‚   β”‚   └── product_model.dart     # JSON serialization + fromEntity
β”‚       β”‚   └── repositories/
β”‚       β”‚       └── product_repository_impl.dart
β”‚       β”œβ”€β”€ domain/
β”‚       β”‚   β”œβ”€β”€ entities/
β”‚       β”‚   β”‚   └── product_entity.dart    # Pure Dart, Equatable
β”‚       β”‚   β”œβ”€β”€ repositories/
β”‚       β”‚   β”‚   └── product_repository.dart  # Abstract contract
β”‚       β”‚   └── usecases/
β”‚       β”‚       └── get_products_usecase.dart  # Auto-generated ✨
β”‚       └── presentation/
β”‚           β”œβ”€β”€ providers/           # ChangeNotifier (Provider) or StateNotifier (Riverpod)
β”‚           β”œβ”€β”€ screens/             # product_screen.dart
β”‚           └── widgets/
β”œβ”€β”€ main.dart                        # Configured per state management
└── app.dart                         # MaterialApp.router + ScreenUtil + Theme

GetX

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ app_routes.dart          # Route name constants
β”‚   β”‚   └── app_pages.dart           # GetPage list β€” auto-updated
β”‚   └── ...same as above
β”œβ”€β”€ features/
β”‚   └── product/
β”‚       β”œβ”€β”€ data/ / domain/          # Same as above
β”‚       β”œβ”€β”€ presentation/
β”‚       β”‚   β”œβ”€β”€ controllers/
β”‚       β”‚   β”‚   └── product_controller.dart   # GetxController with Rx state
β”‚       β”‚   β”œβ”€β”€ screens/
β”‚       β”‚   └── widgets/
β”‚       └── bindings/
β”‚           └── product_binding.dart   # Auto-generated & registered ✨

πŸ“¦ Pre-installed Packages

Category Packages
State Management provider / flutter_riverpod / get / flutter_bloc + bloc
Routing go_router (or GetX built-in)
Network dio
Storage hive, hive_flutter, flutter_secure_storage
UI Utilities flutter_screenutil, google_fonts, flutter_svg, cached_network_image
Animations flutter_animate, shimmer, loading_animation_widget
Components flutter_staggered_grid_view, flutter_rating_bar, google_nav_bar, badges, awesome_dialog
Media image_picker, url_launcher
Data equatable, dartz, intl
DI get_it
Logging logger

✨ What Gets Auto-Wired

When you add a feature:

  • βœ… Full Clean Architecture folder structure created
  • βœ… Route registered in GoRouter / GetX AppPages
  • βœ… DataSource, Repository contract & implementation scaffolded
  • βœ… Presentation layer generated (Provider / Riverpod / GetxController / BLoC)
  • βœ… GetX Binding created and registered (GetX only)
  • βœ… GetIt DI entries added automatically

When you add a usecase:

  • βœ… UseCase class created in domain/usecases/
  • βœ… Method signature added to repository interface
  • βœ… Method implementation added to repository impl
  • βœ… Method stub added to remote data source
  • βœ… UseCase registered in GetIt injection container

πŸ—ΊοΈ Roadmap

  • Local datasource generation
  • Unit test file scaffolding
  • Model field definition during generation
  • Remove command