Contents

Command Line Interface (CLI)

The framework comes with CLI that allows you to perform various tasks related to the project. The CLI provides commands for building, packaging, running the application, etc.

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:
  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.

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