Rust CLI for Flutter

Your whole modular Flutter app, one command.

Scaffold a Clean Architecture project, then run pub get, build_runner, routes, localization, assets, clean and APK/IPA builds across every module from one fast, interactive CLI.

brew install gm-cli
No Homebrew? curl -fsSL https://ghozimahdi.github.io/GM_CLI/install.sh | sh
First time with Homebrew? Run brew tap ghozimahdi/gm-cli https://github.com/ghozimahdi/GM_CLI and brew trust ghozimahdi/gm-cli before installing. The command is gm.
Written in RustClean ArchitectureMulti-modulemacOS · Homebrew
Commands

Everything you run daily.

Run inside your Flutter project: gm [OPTIONS] [COMMAND]. Commands that touch modules let you pick one, several or all of them.

create project

New Flutter project with a Clean Architecture, modular structure.

create module

Add a data, domain or feature module for modularization.

build-b

Run build_runner for the modules you select.

get-g

flutter pub get for selected modules.

clear-c

flutter clean and remove pubspec.lock for selected modules.

app

Interactively build APK or IPA files.

route

Generate route files for your Flutter project.

flutter · dart

Pass-through commands such as pub add <package>.

info · help · donate

Prerequisites, usage and ways to support the project.

OptionWhat it does
-b --buildRun build_runner after module selection
-l --localizeGenerate easy_localization files
-a --assetsGenerate assets with flutter gen
-c --flutter_cleanFlutter clean for a single module
-g --flutter_getflutter pub get for a single module
--allbuild_runner, easy_localization and assets in one go
-V --versionPrint version information
gm create project

Clean Architecture,
already wired.

Every feature lives in its own data, domain and presentation module, so the app stays scalable as it grows.

app/
packages/
  ├── library/
  │   └── library_common/
  ├── data/
  │   ├── data_common/
  │   ├── data_auth/
  │   └── data_analytic/
  │       ├── di/  config/  model/
  │       └── mapper/  repository/
  ├── domain/
  │   ├── domain_common/
  │   ├── domain_auth/
  │   └── domain_analytic/
  │       ├── di/  config/  model/
  │       └── use_case/  repository/
  └── presentation/
      ├── feature_common/
      ├── feature_dashboard/
      └── feature_auth/
          └── bloc/  config/  di/  page/

Library

Shared utilities, components and resources reused across modules.

Data

Data sources, models, mappers and repository implementations.

Domain

Business logic: use cases and repository interfaces per module.

Presentation

Features, pages and BLoC state management.

ModularitySeparation of concernsReusable components
Install

Up and running in a minute.

Requires Flutter. Prebuilt macOS binaries ship with every release.

Homebrew

Recommended on macOS.

brew tap ghozimahdi/gm-cli https://github.com/ghozimahdi/GM_CLI
brew trust ghozimahdi/gm-cli
brew install gm-cli
Homebrew 7+ only loads third-party taps you trust. The formula is gm-cli; the command it installs is gm.

Install script

No Homebrew needed. Downloads the binary for your Mac and verifies its checksum.

curl -fsSL https://ghozimahdi.github.io/GM_CLI/install.sh | sh

Installs to /usr/local/bin or ~/.local/bin. Pin a version with GM_VERSION=v4.0.1, pick a folder with GM_INSTALL_DIR. Re-run to update.

Update

Pull the latest formula and upgrade.

brew update
brew upgrade gm-cli

Build from source

Requires Rust.

git clone https://github.com/ghozimahdi/GM_CLI.git
cd GM_CLI && cargo build --release
./target/release/gm help
Support us

Help gm level up.

This project is maintained by an independent developer. Your donations help to:

  • Add new features
  • Fix bugs faster
  • Improve documentation
QRIS donation code (GoPay, BCA, Mandiri, BNI, BRI and other Indonesian banks)

QRIS · GoPay, BCA, Mandiri, BNI, BRI and more