ARCLE CLI
A production-ready Flutter CLI that scaffolds Clean Architecture projects with BLoC, GetX, or Riverpod.
Why ARCLE
ARCLE removes repetitive setup work for scalable Flutter apps.
- Create a project with Clean Architecture structure
- Choose BLoC, GetX, or Riverpod
- Generate full feature modules
- Keep DI and route wiring consistent
- API client ready with Dio
- Session management & token handling
- Multi-language support
- Environment configuration (local, staging, production)
- Working demo feature with login & API integration
- Auto-generated documentation
- Production-ready code structure
- Build APKs from the CLI
What's New In 1.0.4
- Redesigned localization commands β locale management is now per-locale and composable:
arcle add locale <code>β add any locale (e.g.en,my,fr); first call bootstraps the dart infrastructure, subsequent calls append the localearcle delete locale <code>β remove a specific locale; cleans up JSON, dart files, and pubspec automatically- Short forms:
arcle add loc --my/arcle del loc --my delis a new alias fordelete
- Any ISO 639-1 code is accepted; country codes for 60+ languages are built in
- Feature localization injection now covers all locales automatically (not just
en/bn) - Added
arcle verify --check-features,--check-assets,--check-l10n, and--fullfor whole-project structural analysis
π¦ Installation
Option 1: Activate globally (Recommended)
dart pub global activate arcle
Then use the arcle command directly from anywhere in your terminal.
Make sure your pub cache bin folder is in your PATH:
- Linux/macOS:
$HOME/.pub-cache/bin - Windows:
%APPDATA%\Pub\Cache\bin
Add to your PATH if not already present:
- Linux/macOS: Add to
~/.bashrcor~/.zshrc:export PATH="$PATH:$HOME/.pub-cache/bin" - Windows: Use System Properties β Environment Variables β Add
%APPDATA%\Pub\Cache\bin
Option 2: Run from pub
dart pub global activate arcle
arcle --help
Or use without activating:
dart pub global run arcle:arcle --help
π Quick Start
# Create with interactive state selection
arcle create my_app
# Optional alias
arcle new my_app
# Create with explicit state
arcle create my_app --state bloc
arcle create my_app --state getx
arcle create my_app --state riverpod
# Add a feature
arcle feature auth
# Optional alias
arcle feat auth
# Build APK
arcle build apk --debug
arcle build apk --release
arcle br
# Persist version + environment before build
arcle build apk --release --env prod --version-name 1.2.0 --version-code 12
# Validate and verify an ARCLE project
arcle doctor
arcle doctor --fix
arcle verify
arcle verify --check-16kb
# Localization β add / remove individual locales
arcle add locale en # Add English (sets up infra on first run)
arcle add locale bn # Add Bengali
arcle add locale my # Add Myanmar / Burmese
arcle add loc --fr # Short form β add French
arcle delete locale bn # Remove Bengali locale
arcle del loc --my # Short form remove
arcle del locale en --force # Skip confirmation prompt
# Deep project analysis
arcle verify --check-features # Check feature layer completeness
arcle verify --check-assets # Check pubspec asset paths exist
arcle verify --check-l10n # Check feature translation key coverage
arcle verify --full # Run all checks at once
π Commands
arcle create <name>: Create a new Flutter project with Clean Architecture- Alias:
arcle new <name> arcle init: Scaffold Clean Architecture in an existing project- Alias:
arcle setup arcle feature <name>: Generate feature data/domain/presentation layers- Alias:
arcle feat <name> arcle doctor: Validate ARCLE project health and safe repairs- Alias:
arcle health arcle auto-gen-di: Regenerate DI and refresh dependencies (BLoC)- Alias:
arcle autodi arcle gen-di: Regenerate DI files only (BLoC)- Alias:
arcle di arcle build apk: Build APK in debug or release mode, with optional persistent--env,--version-name, and--version-code- Aliases:
arcle b,arcle br,arcle bd arcle gen-doc: Generate project documentation- Alias:
arcle docs arcle verify: Run analyze/test/codegen verification- Alias:
arcle ver arcle verify --check-16kb: Build a release APK and run static 16 KB page-size compatibility checksarcle verify --check-features: Check every feature module has all required ARCLE layer filesarcle verify --check-assets: Check every pubspec.yaml asset path exists on diskarcle verify --check-l10n: Check every feature has its translation key in the localization filearcle verify --full: Run all structural checks in a single passarcle add locale <code>: Add a locale to the project (e.g.en,my,fr)- Short form:
arcle add loc --<code> arcle delete locale <code>: Remove a locale from the project- Alias:
arcle del locale <code>| Short:arcle del loc --<code>
State Management
ARCLE includes templates and generators for three state management solutions:
BLoC (Business Logic Component)
- Event-driven architecture
- Predictable state management with clear separation of concerns
- Automatic DI generation using
GetItandInjectable - Best for: Complex apps with multiple features and events
GetX
- Lightweight and simple to use
- Reactive state management with bindings
- No build_runner needed
- Best for: Quick prototyping and small to medium apps
Riverpod
- Type-safe provider-based state management
- No context needed, functional approach
- Excellent for state composition
- Best for: Apps requiring strong typing and immutability
β Requirements
- Dart SDK: 3.5.4 or higher
- Flutter: Latest stable channel (3.24.5+)
- Operating System: macOS, Linux, or Windows
- Terminal: bash, sh, zsh, or PowerShell
Platform Notes
- Android: ARCLE automatically configures Gradle build files with SDK versions (minSdk 21, compileSdk 35) and desugaring support for modern Java features. APK building is fully supported via
arcle build apk. - iOS: ARCLE automatically configures the iOS deployment target (13.0+) in Podfile and generates essential permission descriptions in Info.plist for camera, photos, microphone, location, calendar, and contacts access. Projects are ready for iOS development after creation.
- Generated notification and permission services include platform guards so unsupported platforms fail safely instead of crashing.
- Android and iOS are the primary supported mobile targets for the generated permission and local notification setup.
- iOS Release Builds: Remember to configure Apple signing in Xcode, set your Team ID, and manage provisioning profiles before building for distribution.
- Web is safe for shared app code, but local notifications and runtime permissions are intentionally treated as unsupported by default.
- macOS support is available in the generated code structure and is platform-safe, though features like permissions default to graceful failure.
Build Behavior
arcle build apk --version-name ... --version-code ...rewrites the target project'spubspec.yamlversion field before buildingarcle build apk --env prod|stag|localrewrites the target project'slib/core/env/env_factory.dartdefault environment before building- These build changes are persistent in the target Flutter project
- Existing command forms remain fully supported; aliases are optional shortcuts only
π§ͺ Troubleshooting
Command Not Found: arcle
If you get "command not found: arcle" after global activation, ensure the pub cache bin is in your PATH:
# Check if dart is properly installed
dart --version
# Re-activate arcle
dart pub global activate arcle
# On Linux/macOS, add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export PATH="$PATH:$HOME/.pub-cache/bin"
# On Windows, use System Environment Variables
%APPDATA%\Pub\Cache\bin
Flutter SDK Not Found
ARCLE requires Flutter to be installed and available in PATH:
flutter --version
which flutter # or 'where flutter' on Windows
Build Failures
Ensure you're using a compatible Flutter version:
flutter channel stable
flutter upgrade
ποΈ Project Structure
my_awesome_app/
βββ lib/
β βββ main.dart # App entry point
β βββ bootstrap.dart # Bootstrap configuration
β βββ app/
β β βββ app.dart # App widget setup
β βββ core/ # Shared infrastructure
β β βββ api_client/
β β β βββ api_service.dart # HTTP client wrapper
β β β βββ base_response.dart # API response model
β β β βββ dio_client.dart # Dio configuration
β β βββ di/
β β β βββ app_di.dart # DI setup
β β β βββ injection.dart # DI setup (BLoC only)
β β β βββ injectable_module.dart # Module registration (BLoC only)
β β β βββ injection.config.dart # Generated config (BLoC only)
β β β βββ providers.dart # Riverpod providers (Riverpod only)
β β βββ env/
β β β βββ env.dart # Environment interface
β β β βββ local_env.dart # Local config
β β β βββ prod_env.dart # Production config
β β β βββ stag_env.dart # Staging config
β β β βββ env_factory.dart # Environment factory
β β βββ error_handler/
β β β βββ error_handler.dart # Error handling
β β βββ response_handler/
β β β βββ response_handler.dart # Response handling
β β β βββ api_failure.dart # Failure classes
β β βββ localization/
β β β βββ app_strings.dart # Localization keys
β β β βββ getx_localization.dart # GetX localization (GetX only)
β β βββ route_handler/
β β β βββ app_routes.dart # Route definitions
β β β βββ app_router.dart # Router configuration
β β β βββ app_route_observer.dart # Route observer
β β βββ session_manager/
β β β βββ pref_manager.dart # SharedPreferences wrapper
β β β βββ session_manager.dart # Session handling
β β βββ theme_handler/
β β β βββ app_theme.dart # Theme configuration
β β βββ notifications/
β β β βββ notification_service.dart # Notification handling
β β βββ permissions/
β β β βββ permission_service.dart # Permission handling
β β βββ utils/
β β β βββ constants.dart # App constants
β β β βββ endpoints.dart # API endpoints
β β β βββ enums.dart # Enumerations
β β β βββ app_assets.dart # Asset constants
β β β βββ app_colors.dart # Color constants
β β β βββ dimensions.dart # Dimension constants
β β β βββ dialogs.dart # Dialog utilities
β β β βββ logger.dart # Logging utility
β β β βββ result.dart # Either pattern
β β β βββ app_validators.dart # Custom validators
β β β βββ validators.dart # Validation utilities
β β βββ common_widgets/
β β βββ svg_icon.dart # SVG icon widget
β β βββ common_loader.dart # Loading widget
β β βββ common_button.dart # Button widget
β β βββ common_text_field.dart # Text input widget
β β βββ common_dropdown.dart # Dropdown widget
β β βββ common_checkbox.dart # Checkbox widget
β β βββ common_snackbar.dart # Snackbar widget
β β βββ common_app_bar.dart # App bar widget
β β βββ common_bottom_sheet.dart # Bottom sheet widget
β β βββ common_dialog.dart # Dialog widget
β β βββ common_image_container.dart # Image container widget
β βββ features/ # Feature modules
β βββ demo/ # Demo feature (included!)
β β βββ data/
β β β βββ models/
β β β βββ sources/
β β β βββ repositories/
β β βββ domain/
β β β βββ entities/
β β β βββ repositories/
β β β βββ usecases/
β β βββ presentation/
β β βββ pages/ # Feature screens
β β βββ widgets/ # Feature widgets
β β βββ bloc/ (BLoC) # BLoC files (if using BLoC)
β β β βββ *_bloc.dart
β β β βββ *_event.dart
β β β βββ *_state.dart
β β βββ controller/ (GetX) # Controllers (if using GetX)
β β β βββ *_controller.dart
β β βββ bindings/ (GetX) # Bindings (if using GetX)
β β β βββ *_binding.dart
β β βββ providers/ (Riverpod) # Providers (if using Riverpod)
β β βββ *_providers.dart
β βββ settings/ # Settings feature (included!)
βββ assets/
β βββ images/
β βββ icons/
β βββ langs/
β βββ en.json # English translations
β βββ bn.json # Bengali translations (BLoC & Riverpod only)
βββ docs/ # Auto-generated documentation
βββ test/ # Tests
β βββ features/
β β βββ */
β β βββ *_test.dart
β βββ widget_test.dart
βββ pubspec.yaml # Dependencies
ποΈ State Management Details
ARCLE generates different structures and setup requirements based on your chosen state management:
BLoC/Cubit Architecture
- Event-based state management with predictable patterns
- DI Setup: Uses GetIt + Injectable library
- Files Created:
lib/core/di/injection.dart- Service locator initializationlib/core/di/injectable_module.dart- Dependency registration modulelib/core/di/injection.config.dart- Auto-generated dependencies (generated by build_runner)lib/core/di/bloc_providers.dart- BLoC provider instances
- Localization: Creates
assets/langs/en.jsonandassets/langs/bn.json - Best For: Complex apps with multiple features and events
- Code Generation: Requires
build_runner- runarcle auto-gen-diafter adding features
GetX
- Lightweight and simple reactive state management
- Controller-based: Uses controller + binding pattern
- DI Setup: Service locator is built into GetX
- Files Created:
lib/core/localization/getx_localization.dart- GetX localization wrapper- Feature controller:
lib/features/*/presentation/controller/*_controller.dart - Feature binding:
lib/features/*/presentation/bindings/*_binding.dart
- Localization: Creates
.gitkeepplaceholder (you manage translations) - Best For: Quick prototyping and small to medium apps
- Build Step: No additional build step required
Riverpod
- Type-safe provider-based state management
- Functional approach: Providers instead of classes
- DI Setup: Built into Riverpod providers
- Files Created:
lib/core/di/providers.dart- Core provider definitions- Feature providers:
lib/features/*/presentation/providers/*_providers.dart - Feature state:
lib/features/*/presentation/state/*_state.dart
- Localization: Creates
assets/langs/en.jsonandassets/langs/bn.json - Best For: Apps requiring strong typing and immutability
- Code Generation: Uses code generation for some features
π Feature Structure by State Management
Generated features have different presentation structure depending on state management:
BLoC:
lib/features/feature_name/presentation/
βββ pages/
β βββ feature_name_screen.dart
βββ widgets/
β βββ feature_name_card.dart
βββ bloc/
βββ feature_name_bloc.dart
βββ feature_name_event.dart
βββ feature_name_state.dart
GetX:
lib/features/feature_name/presentation/
βββ pages/
β βββ feature_name_screen.dart
βββ widgets/
β βββ feature_name_card.dart
βββ controller/
β βββ feature_name_controller.dart
βββ bindings/
βββ feature_name_binding.dart
Riverpod:
lib/features/feature_name/presentation/
βββ pages/
β βββ feature_name_screen.dart
βββ widgets/
β βββ feature_name_card.dart
βββ providers/
β βββ feature_name_providers.dart
βββ state/
βββ feature_name_state.dart
π Features
- π¦ Full project scaffolding with chosen architecture
- π§© Feature generation (data/domain/presentation layers)
- π Automatic DI wiring
- π± Build APK (debug and release modes)
- π Documentation generation
- π¨ Pre-configured theming system
- π API client setup with error handling
- β Comprehensive code templates
- Localization: per-locale management with
arcle add localeandarcle delete locale - π Deep project analysis with
arcle verify --full
π Toolchain
- Dart SDK:
^3.5.4 - Flutter: stable channel recommended
See TOOLCHAIN.md for release-specific versions and environment setup details.
πΊοΈ Roadmap
Add support for more state management options (Provider, Redux)Generate unit tests automaticallyAdd GraphQL supportGenerate widget testsAdd Firebase integration optionGenerate CI/CD configurationAdd more demo featuresSupport for custom templates
π€ Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Open a pull request
π License
MIT License. See LICENSE.
π Acknowledgments
- Flutter team for the amazing framework
- BLoC, Getx, Riverpod library maintainers
- Clean Architecture community
- All contributors
β Star History
If ARCLE helps you, consider giving it a star! β
π Stats
- Lines of Code Generated: ~5,000+ per project
- Time Saved: Hours of setup work
- Architecture: Production-ready from day one
- Best Practices: Baked in by default
Happy Coding! π