mugon.net docs
CLI

Project config

The mugon.toml of a project and the global CLI config.

mugon.toml

Every project has a mugon.toml in its root. mugon init creates it; dev, publish and run read it.

id = "my-game"
version = "0.1.0"
js-sdk-version = "0.1.0"

# Optional, defaults shown
distribution-dir = "dist"
source-dir = "src"
watch-paths = ["src"]

[[command]]
name = "install"
command = "npm install"

[[command]]
name = "build"
command = "npm run build"
FieldRequiredDefaultDescription
idYesThe project ID. Must match the game name on mugon.net.
versionYesThe semver version that mugon publish publishes. Each publish needs a version that doesn't exist yet.
js-sdk-versionYesThe version of @mugon/sdk your game bundles. Its major is recorded with the published version and has to match what the game really bundles, see SDK versions.
distribution-dirNodistThe folder with the built game. Everything in it is uploaded, and it needs an index.html at its root.
source-dirNosrcYour sources. Default for watch-paths.
watch-pathsNo[source-dir]Files and folders that trigger a rebuild in mugon dev.

Command entries

[[command]] entries are matched by name, scope and os. Several entries can share a name: the CLI picks the one that fits the scope and your operating system.

FieldRequiredDefaultDescription
nameYesFor example build or install. build is what dev and publish run.
commandYesThe shell command.
scopeNodefaultA context for the command. mugon dev prefers the dev scope, mugon publish prefers default, mugon run uses default unless you pass --scope.
osNoindependentindependent, linux, darwin or windows.

A common use of scopes is a fast dev build and a slow, fully optimised default build. The bevy template does exactly that.

Global config

~/.mugon/config.toml is written by mugon login and mugon logout; you rarely need to edit it.

[credentials]
my-game = "<api key>"

# Optional: use another API, for example staging
mugon-net-api-url-override = "https://backend.stage.mugon.net/api/v1"
FieldDescription
credentialsProject ID to API key.
mugon-net-api-url-overrideReplaces the default API address https://backend.mugon.net/api/v1.

The MUGON_PROJECT_API_KEY environment variable supplies an API key without storing it, and takes precedence over the stored one.

On this page