Skip to content

CLI Reference

mfe-forge init [name]

Initialize a new MFE Forge project.

Options

OptionDescriptionDefault
-t, --template <template>Project templatedefault
-pm, --package-manager <pm>Package managerbun
--skip-installSkip dependency installationfalse
--skip-gitSkip git initializationfalse

Examples

bash
# Interactive mode
mfe-forge init

# With options
mfe-forge init my-project --package-manager pnpm

mfe-forge generate <type> [name]

Generate applications, hosts, or packages.

Types

TypeDescription
appMicro Frontend application
hostHost/shell application
packageShared package
libraryComponent library
design-systemDesign system with Storybook

Options

OptionDescription
--port <port>Development server port
--host <host>Target host for registration
--scope <scope>Scope/team for the app
--features <features>Comma-separated features
--skip-hostSkip host auto-generation
--dry-runPreview generated files without writing to disk

Examples

Note: Apps and hosts must use scope/name format (e.g., platform/auth). Inside a monorepo containing MFE Forge packages, runtime dependencies are linked as workspace:*.

bash
# Scoped app (required format)
mfe-forge generate app platform/auth

# With explicit port
mfe-forge generate app platform/auth --port 3005

# Override host
mfe-forge generate app marketing/landing --host platform/host

# Package (no scope required)
mfe-forge generate package ui

# Preview without writing
mfe-forge generate app platform/dashboard --dry-run

mfe-forge dev

Start development servers.

Options

OptionDescription
-s, --scope <scope>Run only apps in scope
-a, --app <app>Run specific app
-p, --parallel <n>Max parallel processes
--host-onlyRun only hosts
--build-watchUse build --watch + preview

Examples

bash
# Run all
mfe-forge dev

# Run scope
mfe-forge dev --scope appname

# Run single app
mfe-forge dev --app appname/auth

mfe-forge build [app]

Build for production.

Options

OptionDescription
-s, --scope <scope>Build all apps in scope
--analyzeAnalyze bundle size
--parallelBuild in parallel

mfe-forge sync

Synchronize configurations across MFEs.

Options

OptionDescription
--typesSync TypeScript declarations
--hostsSync host configurations
--routesSync route registrations

Without options, runs all sync operations.

mfe-forge test

Run tests.

Options

OptionDescription
-u, --unitUnit tests only
-e, --e2eE2E tests only
-c, --coverageCoverage report
-w, --watchWatch mode

mfe-forge doctor

Diagnose common issues:

  • Node version compatibility
  • Port conflicts
  • Missing hosts
  • Workspace configuration

mfe-forge config

Manage configuration interactively or view settings.

Released under the MIT License.