Skip to content
Back to archipelago.banuacoder.com

DevTools

monorepo_toolkit Free ​

Tier
Freeversion 1.2.4
Command
archipelago generate monorepo_toolkit
Generates
  • devtools/monorepo_toolkit
  • devtools/scripts/app_scaffold
  • devtools/scripts/build_prepare
  • devtools/scripts/dependency_graph
  • devtools/scripts/dependency_manager
  • devtools/scripts/env_sync
  • devtools/scripts/flavor_manager
  • devtools/scripts/host_registry_generator
and 4 more packages

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:

CommandScript packageSubcommands
appapp_scaffoldcreate
build-preparebuild_prepare—
depsdependency_manageradd, remove, internal, external
envenv_syncinit, sync, switch, add
flavorflavor_manageradd, list, list-apps, generate, sync
graphdependency_graphvisualize, validate, stats, cycles
generatehost_registry_generatorhost-registry, test-harness
prepareprepare—
runrun_app—
workspaceworkspace_setupsetup, 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:

BrickTierDescription
asset_generatorFreeType-safe asset enum generation
changelog_generatorFreeConventional Commit changelog entries
ui_kit_generatorFreeCLI commands for component/theme management
coverage_managerProTest coverage pipeline with thresholds
size_guardProFile size threshold enforcement
asset_optimizerProImage optimization (SVG, PNG, JPEG)
affectedEnterpriseGit-based affected package detection for CI
ui_kit_themeEnterpriseAdvanced theme variant management

Variables ​

VariableTypeDefaultDescription
appNamestringMyAppThe name of your application
organizationstringMyCompanyThe name of your organization
isForMonorepobooleantrueWhether this is being generated as part of a monorepo

Usage ​

Interactive ​

bash
archipelago generate monorepo_toolkit

Non-interactive (CI) ​

bash
archipelago generate monorepo_toolkit --config my_config.json

Config Template ​

json
{
  "@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 ​

text
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` command

Public API / Usage ​

bash
# 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 create

generate 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's README.md reference monorepo_toolkit_pro/monorepo_toolkit_enterprise bricks 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.