DevTools
monorepo_toolkit Free
- Tier
- Freeversion 1.2.4
- Command
archipelago generate monorepo_toolkit- Generates
devtools/monorepo_toolkitdevtools/scripts/app_scaffolddevtools/scripts/build_preparedevtools/scripts/dependency_graphdevtools/scripts/dependency_managerdevtools/scripts/env_syncdevtools/scripts/flavor_managerdevtools/scripts/host_registry_generator
- Used by
- asset_generator, ui_kit_generator, changelog_generator, coverage_manager, size_guard, detect_new_library and 4 more
CLI toolkit for Flutter monorepo management. Generates the devtools/ directory with a full suite of automation scripts — build preparation, dependency management, environment sync, flavor management, and more.
Included Scripts
The monorepo_toolkit CLI (dart run devtools/monorepo_toolkit/bin/monorepo_toolkit.dart <command>) registers one top-level command per script package — all free:
| Command | Script package | Subcommands |
|---|---|---|
app | app_scaffold | create |
build-prepare | build_prepare | — |
deps | dependency_manager | add, remove, internal, external |
env | env_sync | init, sync, switch, add |
flavor | flavor_manager | add, list, list-apps, generate, sync |
graph | dependency_graph | visualize, validate, stats, cycles |
generate | host_registry_generator | host-registry, test-harness |
prepare | prepare | — |
run | run_app | — |
workspace | workspace_setup | setup, validate, fix-resolution |
shared_scripts is not a command — it's a utility library the other script packages depend on.
Extensible with Pro & Enterprise Bricks
command_runner.dart also ships a // --- Installed Free Commands --- marker (between the built-in free list and the Pro marker) where free-tier devtool bricks such as ui_kit_generator inject their commands. It ships // --- Pro Commands --- / // --- Enterprise Commands --- marker comments crediting a monorepo_toolkit_pro/monorepo_toolkit_enterprise brick — neither brick exists in this repository. In practice, each pro/enterprise devtools brick below patches its own command directly into those same markers via its own post_gen hook (confirmed for affected, coverage_manager, size_guard, asset_optimizer) — there's no separate umbrella brick:
| Brick | Tier | Description |
|---|---|---|
| asset_generator | Free | Type-safe asset enum generation |
| changelog_generator | Free | Conventional Commit changelog entries |
| ui_kit_generator | Free | CLI commands for component/theme management |
| coverage_manager | Pro | Test coverage pipeline with thresholds |
| size_guard | Pro | File size threshold enforcement |
| asset_optimizer | Pro | Image optimization (SVG, PNG, JPEG) |
| affected | Enterprise | Git-based affected package detection for CI |
| ui_kit_theme | Enterprise | Advanced theme variant management |
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| appName | string | MyApp | The name of your application |
| organization | string | MyCompany | The name of your organization |
| isForMonorepo | boolean | true | Whether this is being generated as part of a monorepo |
Usage
Interactive
archipelago generate monorepo_toolkitNon-interactive (CI)
archipelago generate monorepo_toolkit --config my_config.jsonConfig Template
{
"@appName": "The name of your application",
"appName": "MyApp",
"@organization": "The name of your organization",
"organization": "MyCompany",
"@isForMonorepo": "Whether this is being generated as part of a monorepo",
"isForMonorepo": true
}Generated Structure
devtools/
├── monorepo_toolkit/
│ ├── bin/
│ │ └── monorepo_toolkit.dart # CLI entry point
│ ├── lib/
│ │ ├── monorepo_toolkit.dart
│ │ └── src/
│ │ ├── command_runner.dart # CLI command runner
│ │ └── models/
│ │ └── config_registry.dart # Script config registry
│ └── pubspec.yaml
└── scripts/
├── app_scaffold/ # `app` command
├── build_prepare/ # `build-prepare` command
├── dependency_graph/ # `graph` command
├── dependency_manager/ # `deps` command
├── env_sync/ # `env` command
├── flavor_manager/ # `flavor` command
├── host_registry_generator/ # `generate` command
├── prepare/ # `prepare` command
├── run_app/ # `run` command
├── shared_scripts/ # Shared utilities (not a command)
└── workspace_setup/ # `workspace` commandPublic API / Usage
# Copy .env.<flavor> to .env before a build (idempotent with --if-missing)
dart run devtools/monorepo_toolkit/bin/monorepo_toolkit.dart env switch --flavor development --if-missing
# Swap debug tooling for its noop twins for a production release build;
# --mode release also swaps the debug_build_only list (Marionette) for any flavor
dart run devtools/monorepo_toolkit/bin/monorepo_toolkit.dart build-prepare --flavor production --mode release
# Visualize/validate the package dependency graph
dart run devtools/monorepo_toolkit/bin/monorepo_toolkit.dart graph validate
# Scaffold a new app into the workspace
dart run devtools/monorepo_toolkit/bin/monorepo_toolkit.dart app creategenerate host-registry rewrites the DI marker regions of an app's lib/di/injector.dart from each package's archipelago: di_modules:. It scans only the app's transitive dependencies: closure. --check exits 1 when injector.dart is out of date, and --prune drops ExternalModule entries no manifest declares (otherwise they are kept and a warning names them).
generate test-harness writes the app's test/support/composition_root_harness.dart from each package's archipelago: test_prerequisites: (see test_prereq and the testing guide). It creates the file if it is missing, and then rewrites only its two marker regions. The order is depends_on first, then declaration order, then package name. It takes the same --app, --root and --check options as host-registry, and it fails when no app has a lib/di/injector.dart. Commit the harness, because nothing regenerates it on checkout. Installing a brick does the same rewrite through shared_hooks TestHarnessWriter. Run the command yourself only after you add or remove a prerequisite package by hand. The generated melos run di:check runs it with --check.
build-prepare debug after release restores the release snapshot exactly. --mode debug|profile|release drives the debug_build_only list independently of the flavor, and --check-leaks (default --mode release) fails a release or profile build that still resolves one of its packages. See Build Prepare.
--version/-v and --verbose are global flags on the root monorepo_toolkit command itself.
DI & Wiring
Not applicable — this is a standalone Dart CLI tool run via dart run, not a Flutter package wired into the app's DI container.
Dependencies
Main CLI package: args ^2.7.0, plus workspace path dependencies on every script package listed above. Each script package has its own dependency set (not audited individually here).
Platform Setup
None required — this is a pure Dart CLI tool.
Limitations
command_runner.dart's own comments and the brick'sREADME.mdreferencemonorepo_toolkit_pro/monorepo_toolkit_enterprisebricks that don't exist in this repository — see "Extensible with Pro & Enterprise Bricks" above for what actually happens.- No CMake,
melos run:android/run:ios, or Maestro/Patrol integration-test commands — these remain unimplemented (tracked informally, not in a specific issue verified here).
Changelog
Run archipelago brick info monorepo_toolkit to see the latest published version. Enterprise customers can read the full CHANGELOG.md in the brick source repository.