π¨ 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 SDK installed
- Dart SDK (comes with Flutter)
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:
- β
UseCaseclass created indomain/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