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"| Field | Required | Default | Description |
|---|---|---|---|
id | Yes | The project ID. Must match the game name on mugon.net. | |
version | Yes | The semver version that mugon publish publishes. Each publish needs a version that doesn't exist yet. | |
js-sdk-version | Yes | The 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-dir | No | dist | The folder with the built game. Everything in it is uploaded, and it needs an index.html at its root. |
source-dir | No | src | Your sources. Default for watch-paths. |
watch-paths | No | [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.
| Field | Required | Default | Description |
|---|---|---|---|
name | Yes | For example build or install. build is what dev and publish run. | |
command | Yes | The shell command. | |
scope | No | default | A context for the command. mugon dev prefers the dev scope, mugon publish prefers default, mugon run uses default unless you pass --scope. |
os | No | independent | independent, 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"| Field | Description |
|---|---|
credentials | Project ID to API key. |
mugon-net-api-url-override | Replaces 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.