Jade CLI
Jade is an interactive Dart CLI for creating Flutter apps with a reusable, layered project structure. It is designed for teams that want every new app to start with the same architecture, flavor setup, service boundaries, model conventions, shared widgets, tooling scripts, and agent-facing documentation.
Jade does not generate product-specific screens, branding, API URLs, or Firebase credentials. It generates a clean app foundation that can be reused across projects.
Requirements
- Dart SDK compatible with
^3.3.1 - Flutter SDK available on
PATH
Jade calls flutter create during project creation, so Flutter must be
installed and usable from the terminal.
Installation
dart pub global activate jade
Quick Start
jade create
The wizard asks for:
- project name, folder name, description, and organization id
- Flutter platforms:
ios,android,web,macos,windows,linux - app flavors, defaulting to
dev,production - optional Provider, GetIt, Hive, and Firebase setup
jade create is the only creation command. jade --create is intentionally
rejected with usage guidance.
Other CLI commands:
jade create --verbose
jade --help
jade --version
What Jade Does
When you run jade create, Jade:
- Runs
flutter createwith the selected project metadata and platforms. - Writes the Jade-style Flutter app structure into the new project.
- Generates flavor entrypoints and an app-local flavor configurator.
- Adds required dependencies with
flutter pub add. - Retries dependency installation with
--offlineif normal resolution fails. - Adds selected optional scaffolding for Provider, GetIt, Hive, and Firebase.
- Runs the generated build executable with
dart run <package>:build. - Runs the flavor configurator for the selected platforms.
- Writes app-local
docs/,rules/,AGENTS.md, andFLAVORS.md.
Flutter Architecture Pattern
Jade apps follow a simple downward flow. In Provider-enabled apps, the core feature path is:
ui -> state (providers) -> services
That is the main rule: screens and widgets call providers, providers coordinate services, and services return typed models or simple results.
The goal is to keep responsibilities obvious:
constantscontains app-wide configuration, route names, asset paths, and fixed values.extensionscontains small framework and value helpers.modelscontains typed data shapes. Generated models extendBaseModel,BaseModelextendsEquatable, and JSON serialization usesjson_serializable.servicescontains API, Firebase, Hive, storage, and platform integration work.providersis generated only when Provider is enabled. Providers coordinate services and expose domain state, but they should not own generic loading methods or generic loading variables.themecontains app colors andThemeData.uicontains route destinations and feature screens.utilscontains cross-cutting helpers such as validation, routes, spacing, and request helpers.widgetscontains reusable UI components grouped by role.
Screens should stay thin. Widgets compose UI. Services perform IO and platform work. Models keep transport and persistence data typed.
Generated Project Structure
Jade writes a complete starter app, but the structure is easier to understand by role than by memorizing every file.
| Area | Purpose |
|---|---|
lib/constants |
App configuration, generated asset constants, route names, and fixed values. |
lib/extensions |
Small framework and value helpers. |
lib/models |
Base models, API response models, pagination models, flavor config models, and remote config models. |
lib/services |
API and service-location code, plus optional Hive and Firebase services. |
lib/providers |
Optional Provider scaffolding when Provider is selected. |
lib/theme |
App colors and ThemeData. |
lib/ui |
Route destinations and feature screens. |
lib/utils |
Validation, routing, spacing, and cross-cutting helpers. |
lib/widgets |
Reusable UI grouped under feedback, forms, indicators, and layout. |
bin |
Generated Dart maintenance executables: build.dart and watch.dart. |
tool |
App-local automation, including configure_flavors.dart. |
docs and rules |
Generated Markdown documentation for humans and coding agents. |
<project-folder>/
assets/
fonts/
images/
bin/
build.dart
watch.dart
lib/
constants/
extensions/
models/
providers/ # populated when Provider is enabled
services/
theme/
ui/
utils/
widgets/
feedback/
forms/
indicators/
layout/
tool/
configure_flavors.dart
docs/
rules/
AGENTS.md
FLAVORS.md
preflight.sh
<project-folder>.sh
Jade also writes app-level barrels such as models.dart, theme.dart,
utils.dart, widgets.dart, and extensions.dart, plus lib/flavors.dart,
lib/main.dart, and one lib/main_<flavor>.dart entrypoint per flavor.
Optional files are factual to the wizard choices:
- Provider adds
lib/providers/base_provider.dart,lib/providers/app_provider.dart, andlib/providers/user_provider.dart. - Hive adds
lib/services/hive_service.dart. - Firebase adds
lib/services/firebase_service.dart.
Flavors
Flavor names must be lower-camel-case alphanumeric identifiers that start with a lowercase letter. The default flavors are:
dev,production
Jade generates one entrypoint per flavor:
lib/main_dev.dart
lib/main_production.dart
Run a flavor with Flutter's normal flavor flags:
flutter run --flavor dev --target lib/main_dev.dart
After changing flavors or selected platforms, rerun:
dart run tool/configure_flavors.dart --flavors=dev,production --platforms=ios,android --app-name="My App" --package-name=my_app
The configurator updates .vscode/launch.json, Android flavor blocks when
Android is selected, iOS/macOS xcconfig files when those platforms are selected,
and FLAVORS.md.
Generated Tooling
Generated apps include two Dart executables:
bin/build.dartrunsbuild_runner build, refresheslib/models.dart, refresheslib/constants/app_assets.dart, and formats the project.bin/watch.dartstartsbuild_runner watch, watcheslib/models, watchesassets, and keeps generated barrels current.
Run them through the package executable names:
dart run <package>:build
dart run <package>:watch
Generated apps also include:
<project-folder>.shfor flavor-aware Android and iOS run/build commandspreflight.shfor release-readiness checkstool/configure_flavors.dartfor flavor wiring
Use bin/watch.dart, not watch.dat.
Dependencies Added To Generated Apps
Jade always adds:
intlrecaseequatablejson_annotationpathdiocached_network_imagepackage_info_plus
Jade always adds these dev dependencies:
build_runnerjson_serializable
Optional selections add:
- Provider:
provider - GetIt:
get_it - Hive:
hive,encrypt:5.0.1,path_provider - Firebase:
firebase_core,firebase_analytics,firebase_crashlytics,firebase_messaging,firebase_remote_config
Firebase
When Firebase setup is selected, Jade generates
lib/services/firebase_service.dart with Firebase Core, Analytics,
Crashlytics, Messaging, and Remote Config hooks.
Jade does not generate Firebase credentials. Run flutterfire configure in the
generated app and pass the generated options to FirebaseService.initialize
when the Firebase project is ready.
Generated Documentation
Every generated app includes local Markdown documentation:
AGENTS.mdgives coding agents the working contract, feature flow, do/don't rules, generated-file ownership notes, and finishing checklist.docs/architecture.mdexplains the generated app layers.docs/flavors.mdexplains flavor entrypoints and configurator usage.docs/services.mdexplains generated services and optional state/storage choices.docs/tooling.mdexplains generated executable and maintenance scripts.rules/architecture.mdrecords layer placement rules.rules/bin-and-tools.mdrecords executable and tooling rules.rules/services-providers.mdrecords service/provider boundaries.FLAVORS.mdlists generated flavors and run commands.
These files are generated per app and reflect the options selected in the wizard.
Developing Jade
dart pub get
dart format bin lib test
dart analyze
dart test
dart doc --dry-run
Run the opt-in smoke test when Flutter is available:
JADE_RUN_SMOKE_TESTS=1 dart test test/generated_app_smoke_test.dart
The smoke test creates a temporary Flutter app, runs Jade's generator, runs the generated build executable, and analyzes the generated app.
Jade's public Dart API documentation is configured by dartdoc_options.yaml and
exposed through lib/jade.dart.
License
This project is licensed under the terms of the LICENSE file.
Libraries
- jade
- Testable building blocks for the Jade Flutter project generator.