mor CLI is the primary interface for compiling, composing, scaffolding, and analyzing mini-programs with MorJS. Install it globally with:
Available commands
compile
Compile a mini-program project to one or more target platforms. Supports bundle and transform modes, watch mode, production builds, and
--mock for development mocking.compose
Integrate multiple subpackages and host apps into a single mini-program output directory.
generate
Scaffold new pages or components using built-in or custom templates. Usage:
mor generate <type> [...args]. Alias: mor g.init / create
Initialize a new MorJS project from a template. Usage:
mor init [projectDir]. Alias: mor create. You can also use npx create-mor.analyze
Analyze bundle size using
webpack-bundle-analyzer. Usage: mor analyze.There is no standalone
mor mock command. Mocking is enabled by passing --mock to mor compile during development. See the compile reference for details.Global flags
Display help information for the current command. Run
mor --help for the top-level help, or mor <command> --help for command-specific help.Print the installed version of
@morjs/cli and exit.Enable detailed framework debug logging. Equivalent to setting the
DEBUG=mor,mor:* environment variable.Exploring help
Run any command with--help to see all accepted flags and their descriptions:
Configuration file
All commands read configuration frommor.config.ts (or .js, .mjs, .json) in your project root. You can export a single config object or an array of configs when targeting multiple platforms simultaneously.
mor.config.ts
Configuration reference →
Full documentation for
mor.config.ts, including all supported fields and export formats.