🧱 moarch

A Dart/Flutter CLI package for scaffolding Clean Architecture apps with Riverpod, GoRouter, secure env support, and production-ready templates.

pub version license: MIT


Install

dart pub global activate moarch

Make sure the global pub cache bin folder is on your PATH:

# macOS / Linux
export PATH="$PATH:$HOME/.pub-cache/bin"

# Windows
setx PATH "%PATH%;%APPDATA%\Pub\Cache\bin"

Quick start

flutter create my_app
cd my_app
moarch init
moarch create feature auth

Common commands

moarch init             # scaffold a complete Flutter app structure
moarch init --all       # generate the default app without prompts
moarch create feature auth
moarch create feature auth --all
moarch create feature auth --no-unit --no-integration

What moarch generates

  • app structure with lib/main.dart, core/, config/, shared/widgets/, and features/
  • GoRouter routing setup
  • flutter_secure_storage wrappers
  • .env support with Envied code generation
  • GitHub Actions CI workflow scaffold
  • reusable UI widgets, loading states, and error handling
  • feature scaffolding with Clean Architecture layers
  • optional test scaffolding for notifiers, repositories, and use cases

Feature generation

moarch create feature <name> generates a feature folder with:

  • domain/ (entities, repository interfaces, optional use cases)
  • data/ (remote/local datasources, models, repository implementations)
  • presentation/ (state, notifier, view)

The CLI uses an interactive checklist so you can generate only the layers you need.


Customize templates

Templates are defined in lib/src/templates/:

  • core_templates.dart
  • config_templates.dart
  • feature_templates.dart
  • shared_templates.dart
  • test_templates.dart
  • checklist_templates.dart
  • workflow_templates.dart

To use local template changes:

git clone https://github.com/SuperMoooo/moarch.git
cd moarch
dart pub global activate --source path ./

Package details


Troubleshooting

  • If moarch is not found, confirm the global pub cache bin folder is on your PATH.
  • If a feature already exists, rename or remove the existing folder first.
  • After changing templates locally, re-activate with dart pub global activate --source path ./.

License

MIT © André Montoito

Libraries

moarch