Command Line Interface
This page lists every proton_cli command and its options. Application IPC commands are documented separately in Commands. Configuration file fields are defined in project configuration.
Invocation and global options
proton_cli [--cwd <directory>] <command> [options]
| Option | Meaning |
|---|---|
-C, --cwd <directory> | Working directory; default .; available to subcommands |
-h, --help | Help for the selected command |
-V, --version | CLI version; equivalent in purpose to version |
--config, --moon-target-dir and the doctor report path are resolved from the selected working directory. dev --frontend-path and package icon/output paths are resolved from the project configuration directory. Paths in a project configuration are resolved from that file; frontend.dist uses the frontend directory. Explicit command options override the corresponding configuration values.
Command index
| Command | Purpose |
|---|---|
help | Show command help |
version | Print CLI version |
new | Create an application project |
dev | Build and run an application in development mode |
build | Build frontend assets and the native backend |
package | Build and assemble distribution artifacts |
doctor | Report environment and project diagnostics |
setup | Install the release-matched runtime and subprocess executable |
cef requirements | Print the embedded CEF requirement |
help
proton_cli help [command] [subcommand]
Displays help without executing the selected command. For example, proton_cli help setup describes runtime installation; it does not install anything. proton_cli <command> --help is the equivalent option form.
version
proton_cli version
Prints proton_cli <version>. It accepts no command-specific options and does not perform the update check.
new
Since 0.7.0: the interface below replaces the project generator in 0.6.0.
proton_cli new [path] [options]
Creates a project with moon-new@0.1.0, using templates/minimal or
templates/isomorphic from the Proton repository's main branch. Network access
is required. Template contents can evolve independently of the installed CLI;
templates reference published dependencies.
You can invoke moon-new directly without installing the Proton CLI.
For the default isomorphic template:
moonx moonbit-community/moon-new my-app \
--template moonbit-community/proton --branch main \
--subdir templates/isomorphic
Use --subdir templates/minimal for the minimal template. With direct invocation,
--template specifies the repository, --subdir selects the Proton template,
and --user <name> corresponds to proton_cli new --author <name>. Pass the
destination path explicitly; to replace proton_cli -C <dir> new <name>, pass
<dir>/<name> as that path. The remaining dev, build and package commands
still belong to proton_cli.
| Argument / option | Default and meaning |
|---|---|
[path] | todo; destination directory, which must be absent or empty |
--template <name> | isomorphic; accepts minimal or isomorphic |
--author <name> | Passed as moon-new's --user; if omitted, moon-new uses the Moon account username or username |
minimal creates a native module with inline HTML. isomorphic creates shared,
frontend and backend modules. The project name is inferred from the destination
directory. Creation is non-interactive. moon-new initializes Git unless the
project is already inside a Git repository.
Both templates start with the title Proton App, a 960 × 640 window and the
identifier com.example.proton-app. Change identifier and package.product_name
in proton.project.json, and the title and dimensions in app/main.mbt
(minimal) or backend/app/main.mbt (isomorphic). Change frontend titles separately
when applicable. Set a unique application identifier before distribution.
Creation does not run compilation. Run moon check --target native for minimal,
or moon check --target js,native for isomorphic.
Migration from 0.6.0: remove --title, --identifier, --width, --height,
--check/--no-check, --git/--no-git, --dry-run and -y/--yes from
new invocations. These options are no longer accepted. Edit the generated
project and run checks explicitly instead.
dev
proton_cli dev [options] [-- <application-arguments>...]
Prepares the release-matched runtime and subprocess executable automatically, then builds and runs the native backend. When a frontend command is configured, it starts that command, waits for readiness and supplies the development URL to the application. Backend changes require a rebuild/restart; frontend refresh is owned by the frontend tool.
Readiness checks use the same host and port normalization as the browser. For
example, a frontend URL using 127.1 probes the same endpoint as 127.0.0.1.
| Option | Default and meaning |
|---|---|
--config <path> | Project configuration; defaults to proton.project.json in the working directory |
--package <selector> | Overrides the configured backend package; fallback app |
--moon-target-dir <path> | Override the internal Moon invocation's output directory |
--url <url> | Override frontend.dev_url |
--command <program> | Override the frontend executable and clear its configured arguments (0.11.0+) |
--command-arg <arg> | One literal frontend argument. Repeat in order with --command |
--frontend-path <path> | Override the frontend command's working directory |
--timeout-ms <milliseconds> | 30000; frontend readiness timeout |
--ready-path <path> | Use an HTTP readiness probe at this path; otherwise checks TCP connectivity |
--no-frontend | Do not start a frontend command; use an externally managed server |
-- <arguments>... | Arguments for the application, not for Moon |
A CLI-managed frontend requires a command and rejects an already occupied development endpoint. HTTP probing requires curl. A readiness timeout prevents application launch. The CLI owns the frontend process it starts; an external server has a separate lifetime.
build
proton_cli build [options] [-- <moon-build-arguments>...]
Runs the configured frontend build, validates frontend output, then builds the native backend. A failed frontend command prevents the backend build. The result is build output, not a complete distribution.
| Option | Default and meaning |
|---|---|
--config <path> | Project configuration; defaults to proton.project.json in the working directory |
--package <selector> | Overrides the configured backend package; fallback app |
--moon-target-dir <path> | Override the internal Moon build's output directory |
--no-frontend | Skip the frontend build command; does not generate missing frontend assets |
-- <arguments>... | Forward to moon build, e.g. -- --release |
The backend target is always native. A forwarded --target override is rejected.
package
proton_cli package [options]
Builds and assembles the application, frontend assets, CEF runtime, matching subprocess executable and declared resources for the host platform. A project configuration is required. This command does not accept trailing Moon arguments.
| Option | Default and meaning |
|---|---|
--config <path> | Project configuration; defaults to proton.project.json |
--package <selector> | Override backend package |
--release | Use release build output; otherwise debug |
--dry-run | Resolve and print the plan without executing the full build/package flow |
--product-name <name> | Override package.product_name |
--version <version> | Override application version; does not select a Proton version |
--format <format> | Repeatable; app, zip, dmg, nsis, appimage, subject to host support |
--output <directory> | Override output directory |
--icon <path> | Repeatable; override configured icons |
--url-scheme <scheme> | Repeatable; override configured URL schemes |
--nsis-install-mode <mode> | currentUser, perMachine or both; overrides Windows configuration |
--macos-minimum-system-version <version> | Override platforms.macos.package.minimum_system_version |
--sign | Sign the application; disabled by default |
--notarize | macOS signing, notarization and stapling; implies --sign |
--updater-base-url <https-url> | Emit update metadata using this artifact base URL; requires publication instant; uses package.version, overridden by --version |
--updater-published-at <instant> | Publication instant in YYYY-MM-DDTHH:MM:SSZ; requires base URL |
CLI lists such as --format override configured lists. Application identity comes from the top-level configuration identifier; package has no --identifier option. --release does not imply signing. A successful dry run does not verify artifact creation or runtime behavior. See packaging for platform formats, configuration defaults and resource rules.
The updater options emit an unsigned manifest fragment for the platform-specific self-update artifact. Supported formats, generated files, and publisher signing responsibilities are defined in Update artifacts and metadata.
Signing environment
Credentials are environment configuration, not command options.
| Variable | Meaning |
|---|---|
PROTON_MACOS_SIGNING_IDENTITY | Required identity for macOS signing |
PROTON_MACOS_ENTITLEMENTS | Optional entitlements file |
PROTON_MACOS_NOTARY_PROFILE | macOS notary credential profile; PROTON_NOTARY_PROFILE is the fallback |
PROTON_MACOS_BUILD_NUMBER | Optional bundle version override; one to three numeric components |
PROTON_MACOS_ALLOW_ADHOC | 1 permits ad-hoc signing for local diagnostics |
PROTON_WINDOWS_CERTIFICATE | Required certificate path for Windows signing |
PROTON_WINDOWS_CERTIFICATE_PASSWORD | Certificate password; defaults to empty |
PROTON_WINDOWS_TIMESTAMP_URL | Timestamp service; defaults to http://timestamp.digicert.com; none disables it |
doctor
proton_cli doctor [options]
Inspects the environment and current project without installing dependencies or repairing project files. It returns failure when diagnostics fail.
| Option | Meaning |
|---|---|
--verbose | Include detailed project diagnostics |
--json | Render one JSON document; conflicts with --quiet |
--quiet | Render only failing diagnostics; conflicts with --json |
--output <path> | Write the report to a file |
setup
proton_cli setup
Prepares the runtime and subprocess executable required by this CLI release in the
shared user-level store, then prints the runtime directory. It is independent
of the current project and working directory, so -C does not change the
installation. There are no command-specific options.
This is an optional prewarming command. dev, build, and package prepare
the same installation automatically before building or launching an app.
Complete cached installations are reused. A missing installation requires
network access, curl, tar, MoonBit and the native compiler toolchain; the
subprocess executable is built from source. Installation failure stops the requesting command.
doctor and package --dry-run do not install anything.
Migration from 0.6.0: replace cef setup with setup. Remove dev --setup
and dev --no-setup; automatic preparation is the default. Direct moon
build/run commands still require a prepared environment. CLI and application
Proton dependencies must use the same release.
cef requirements
proton_cli cef requirements
Prints the release's embedded CEF requirement as JSON. It does not install the runtime or inspect an application's running browser. No command-specific options.
Exit status and update checks
| Status | Meaning |
|---|---|
0 | Command succeeded |
1 | Execution failed, or diagnostics reported failure |
2 | Argument parsing failed |
Commands other than version perform a best-effort CLI update check. PROTON_NO_UPDATE_CHECK=1 disables it. An unavailable update service does not prevent the command from running.