Command Line Interface (CLI)
Run, build, package, and manage your project with the MōBrowser CLI.
Commands
To see the list of available commands, run the following command in your project directory:
npm run mobrowser -- --help
This will display the help message with the list of available commands and their descriptions.
The MōBrowser command line tool
Usage:
mobrowser [flags]
mobrowser [command]
Available Commands:
add Add a feature to an existing project
build Build and pack application for production
dev Build and run application in development mode
gen Generate TypeScript and C++ code from Protobuf definitions
help Help about any command
icon Generate the application icon
Flags:
-h, --help help for mobrowser
--version print version
Use "mobrowser [command] --help" for more information about a command.
add
npm run mobrowser add
This command adds a feature to an existing project. Features are normally chosen when the project is generated, but requirements change.
Run it without a feature name to pick one interactively.
Add a feature to an existing project.
Usage:
mobrowser add [flags]
mobrowser add [command]
Available Commands:
github-actions Add the GitHub Actions release workflow
native Add a native C++ module
Flags:
-h, --help help for add
--verbose enable verbose mode, providing additional details during execution
Use "mobrowser add [command] --help" for more information about a command.
build
npm run mobrowser build
This command will build the application, package it into a native executable, and create a native installer for the current platform.
Build and pack application for production
Usage:
mobrowser build [flags]
Flags:
-h, --help help for build
--releases string absolute path to a directory with previous releases (required for delta package generation)
--verbose enable verbose mode, providing additional details during execution
dev
npm run mobrowser dev
This command will build and run the application in development mode. In the development mode, the application frontend is running on the localhost server with Hot Module Replacement (HMR) using Vite.
It allows you to modify the frontend code and see the changes immediately in the running application without rebuilding the application.
Build and run application in development mode
Usage:
mobrowser dev [flags]
Flags:
-h, --help help for dev
--inspect int the port for debugging the main process
--remote-debugging-port int the port for debugging the renderer process
--verbose enable verbose mode, providing additional details during execution
gen
npm run mobrowser gen
This command will generate TypeScript and C++ code from Protobuf definitions. The command makes sense only if you have a native C++ module in your project.
Generate TypeScript and C++ code from Protobuf definitions
Usage:
mobrowser gen [flags]
Flags:
-h, --help help for gen
--verbose enable verbose mode, providing additional details during execution
icon
npm run mobrowser icon -- --source <path-to-directory> --out app.ico
This command will generate the application icon.
Generate the application icon
Usage:
mobrowser icon [flags]
Flags:
-h, --help help for icon
--output string the path to the output icon file (default "assets/app.ico")
--sources string the directory with the source PNG files to generate the icon from