Skip to main content

NevermoreCLIManifestUtils

Reads deploy metadata baked into the running place by the nevermore CLI at deploy time.

When a place is deployed via nevermore deploy, the CLI locates this ModuleScript in the built place and writes the deployment metadata (commit, target, timestamp, etc.) as attributes onto it. Because the data lives on the package's own instance it travels with the package and replicates to clients automatically -- consumers like GameConfig, GameVersionUtils or PlayerMetrics can simply require("NevermoreCLIManifestUtils") and call NevermoreCLIManifestUtils.getGameMetadata.

When running in Studio, or in a place that was never deployed through the CLI, no attributes are present and NevermoreCLIManifestUtils.isDeployed returns false.

local metadata = NevermoreCLIManifestUtils.getGameMetadata()
if metadata.deployed then
	print(string.format("Running %s @ %s (%s)", metadata.target, metadata.commit, metadata.timestamp))
else
	print("Running an undeployed build (Studio)")
end

Types

GameMetadata

interface GameMetadata {
deployedboolean--

true only when injected by a nevermore deploy

commitstring?--

short git commit SHA the build was made from

versionstring?--

full git commit SHA the build was made from

branchstring?--

git branch the build was made from

targetstring?--

deploy target name (e.g. "test", "integration")

timestampstring?--

ISO 8601 UTC timestamp of when the deploy ran

publishedboolean?--

true if published live (--publish), false if only Saved

placeIdnumber?--

Roblox place ID the build was deployed to

universeIdnumber?--

Roblox universe ID the build was deployed to

}

Metadata describing how and when the running place was deployed. Every field other than deployed is optional -- older CLI versions may not populate all of them, and none are present in an undeployed build.

Functions

getGameMetadata

NevermoreCLIManifestUtils.getGameMetadata(instanceInstance?) → GameMetadata

Returns a snapshot of the deploy metadata for the running place.

Safe to call on both the client and the server. On the client the metadata replicates with the package, so it is available as soon as the package has replicated. Use NevermoreCLIManifestUtils.observeGameMetadata if you need to react to it becoming available.

instance defaults to the manifest module itself (where the CLI injects the data); pass an instance to parse metadata attributes off somewhere else.

isDeployed

NevermoreCLIManifestUtils.isDeployed(instanceInstance?) → boolean

Returns true if the running place was deployed through nevermore deploy. Returns false in Studio and in any place that was never deployed via the CLI.

observeGameMetadata

NevermoreCLIManifestUtils.observeGameMetadata(instanceInstance?) → Observable<GameMetadata>

Observes the deploy metadata, firing immediately with the current snapshot and again whenever any field changes (for example when the metadata first replicates to a client).

Show raw api
{
    "functions": [
        {
            "name": "getGameMetadata",
            "desc": "Returns a snapshot of the deploy metadata for the running place.\n\nSafe to call on both the client and the server. On the client the metadata\nreplicates with the package, so it is available as soon as the package has\nreplicated. Use [NevermoreCLIManifestUtils.observeGameMetadata] if you need\nto react to it becoming available.\n\n`instance` defaults to the manifest module itself (where the CLI injects the\ndata); pass an instance to parse metadata attributes off somewhere else.",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "GameMetadata"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 120,
                "path": "src/nevermore-cli-manifest/src/Shared/NevermoreCLIManifestUtils.lua"
            }
        },
        {
            "name": "isDeployed",
            "desc": "Returns true if the running place was deployed through `nevermore deploy`.\nReturns false in Studio and in any place that was never deployed via the CLI.",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 131,
                "path": "src/nevermore-cli-manifest/src/Shared/NevermoreCLIManifestUtils.lua"
            }
        },
        {
            "name": "observeGameMetadata",
            "desc": "Observes the deploy metadata, firing immediately with the current snapshot\nand again whenever any field changes (for example when the metadata first\nreplicates to a client).",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<GameMetadata>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 143,
                "path": "src/nevermore-cli-manifest/src/Shared/NevermoreCLIManifestUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "GameMetadata",
            "desc": "Metadata describing how and when the running place was deployed. Every field\nother than `deployed` is optional -- older CLI versions may not populate all\nof them, and none are present in an undeployed build.",
            "fields": [
                {
                    "name": "deployed",
                    "lua_type": "boolean",
                    "desc": "true only when injected by a `nevermore deploy`"
                },
                {
                    "name": "commit",
                    "lua_type": "string?",
                    "desc": "short git commit SHA the build was made from"
                },
                {
                    "name": "version",
                    "lua_type": "string?",
                    "desc": "full git commit SHA the build was made from"
                },
                {
                    "name": "branch",
                    "lua_type": "string?",
                    "desc": "git branch the build was made from"
                },
                {
                    "name": "target",
                    "lua_type": "string?",
                    "desc": "deploy target name (e.g. \"test\", \"integration\")"
                },
                {
                    "name": "timestamp",
                    "lua_type": "string?",
                    "desc": "ISO 8601 UTC timestamp of when the deploy ran"
                },
                {
                    "name": "published",
                    "lua_type": "boolean?",
                    "desc": "true if published live (`--publish`), false if only Saved"
                },
                {
                    "name": "placeId",
                    "lua_type": "number?",
                    "desc": "Roblox place ID the build was deployed to"
                },
                {
                    "name": "universeId",
                    "lua_type": "number?",
                    "desc": "Roblox universe ID the build was deployed to"
                }
            ],
            "source": {
                "line": 53,
                "path": "src/nevermore-cli-manifest/src/Shared/NevermoreCLIManifestUtils.lua"
            }
        }
    ],
    "name": "NevermoreCLIManifestUtils",
    "desc": "Reads deploy metadata baked into the running place by the nevermore CLI at\ndeploy time.\n\nWhen a place is deployed via `nevermore deploy`, the CLI locates this\nModuleScript in the built place and writes the deployment metadata (commit,\ntarget, timestamp, etc.) as attributes onto it. Because the data lives on\nthe package's own instance it travels with the package and replicates to\nclients automatically -- consumers like GameConfig, GameVersionUtils or\nPlayerMetrics can simply `require(\"NevermoreCLIManifestUtils\")` and call\n[NevermoreCLIManifestUtils.getGameMetadata].\n\nWhen running in Studio, or in a place that was never deployed through the\nCLI, no attributes are present and [NevermoreCLIManifestUtils.isDeployed]\nreturns false.\n\n```lua\nlocal metadata = NevermoreCLIManifestUtils.getGameMetadata()\nif metadata.deployed then\n\tprint(string.format(\"Running %s @ %s (%s)\", metadata.target, metadata.commit, metadata.timestamp))\nelse\n\tprint(\"Running an undeployed build (Studio)\")\nend\n```",
    "source": {
        "line": 29,
        "path": "src/nevermore-cli-manifest/src/Shared/NevermoreCLIManifestUtils.lua"
    }
}