The Minekube CLI is minekube, and mk for short; use minekube if mk already means something else in your shell. Install it once from the Minekube distribution, which puts both names on your PATH:
It keeps the dev servers, the Java it runs them on, your sessions and its downloads in ~/.minekube; MINEKUBE_HOME moves it. mk <command> --help prints what this page shows.
Build a game (src/game.ts) and a network bundle (network/velocity.ts), install them on the dev server and the dev proxy, and reinstall on every change.
Run a Minecraft client with Fabric and the Minekube client runtime in the daemon (mk daemon); it joins the dev server as an offline player and its log and recordings stream here.
Run the registry locally in workerd on http://localhost:4776; it trusts tokens of this machine’s key (<home>/operator.json), which mk makes for its relay and itself.
Run a Minekube relay locally: Java players connect to it, and it passes them to the instances the registry names over iroh. Against the local registry, whose relay tokens mk makes.
Add a new instance to a network with the code it logs. As the owner of the network (mk login), or an admin: MINEKUBE_REGISTRY_TOKEN, a token of the registry’s issuer; at the local registry mk is the admin.
List a network’s instances, with their labels, players and whether they are online. As the owner of the network (mk login), or an admin: MINEKUBE_REGISTRY_TOKEN, a token of the registry’s issuer; at the local registry mk is the admin.
Which token issuers let servers join a network (OpenID Connect federation). As the owner of the network (mk login), or an admin: MINEKUBE_REGISTRY_TOKEN, a token of the registry’s issuer; at the local registry mk is the admin.
Build the project as mk dev does and roll it out to a network’s instances: each instance the selector picks gets the bundles for its platform from the registry and swaps them in, players connected. As the owner of the network (mk login), or an admin.
End what mk publish assigned to a selector: the instances it picked stop those bundles, players connected, and keep what other selectors give them. The revision stays, to assign again with mk publish —revision. As the owner of the network (mk login), or an admin.
Build a game (src/game.ts) and a network bundle (network/velocity.ts), install them on the dev server and the dev proxy, and reinstall on every change.
Argument
Is
<directory>
Optional.
Flag
Does
--server <string>
Server directory to install a game into. Defaults to the dev server, server in the Minekube home (~/.minekube, .dev in a Minekube checkout, or MINEKUBE_HOME).
--proxy <string>
Velocity directory to install a network bundle into. Defaults to the dev network’s proxy (mk server --network), network/velocity in the Minekube home.
Set up and run the single local Paper dev server (or with —network, the dev network) with the Minekube runtimes and the Effect UI devtools.
Flag
Does
--server <string>
Server directory. Defaults to server in the Minekube home: ~/.minekube (MINEKUBE_HOME), or .dev in a Minekube checkout.
--java <string>
Java executable. Defaults to the pinned Oracle GraalVM, downloaded once into the Minekube home (in a checkout: java from the PATH); GraalVM JIT-compiles game code.
Run the dev network in the Minekube home’s network directory instead (from a Minekube checkout only, for now): players join the relay on port 25577, which passes them over iroh to Velocity with the Minekube plugin, in front of lobby (25580) and arena (25581), Paper servers that only accept players through it (modern forwarding). Everything listens on loopback only; the registry runs in workerd (mk registry).
--join <string>
Make the dev server public in a network you own (mk login, mk network create): players join <network>.<domain> through Minekube’s relay, without an open port. It runs in online mode then, as anyone can reach it. Without it the server is private again.
Run a Minecraft client with Fabric and the Minekube client runtime in the daemon (mk daemon); it joins the dev server as an offline player and its log and recordings stream here.
Flag
Does
--name <string>
Offline player name; also the client’s directory in clients in the Minekube home.
--server <string>
Server to join on start.
--show-window
Show the client’s window. Hidden by default; the client plays the same.
--minecraft <string>
Run this Minecraft version as Mojang ships it instead: no Fabric, no client runtime, no bundles, its window shown.
--daemon <string>
The Minekube daemon (mk daemon) that runs the client.
Run the registry locally in workerd on http://localhost:4776; it trusts tokens of this machine’s key (<home>/operator.json), which mk makes for its relay and itself.
Run a Minekube relay locally: Java players connect to it, and it passes them to the instances the registry names over iroh. Against the local registry, whose relay tokens mk makes.
Flag
Does
--listen <string>
Where Java players connect.
--registry <string>
The registry’s URL; or MINEKUBE_REGISTRY. Start the local one with mk registry.
--default-network<string>
Development: players who type a host that names no network (localhost, an IP) join this network.
Add a new instance to a network with the code it logs. As the owner of the network (mk login), or an admin: MINEKUBE_REGISTRY_TOKEN, a token of the registry’s issuer; at the local registry mk is the admin.
Argument
Is
<code>
The code the instance logs while it belongs to no network.
Flag
Does
--network <string>
The network’s name: players join it at <network>.<domain>, as <network>.g.minekube.net. Required.
List a network’s instances, with their labels, players and whether they are online. As the owner of the network (mk login), or an admin: MINEKUBE_REGISTRY_TOKEN, a token of the registry’s issuer; at the local registry mk is the admin.
Flag
Does
--network <string>
The network’s name: players join it at <network>.<domain>, as <network>.g.minekube.net. Required.
--selector <string>, -l
A label selector, as kubectl’s -l: stage=lobby,region in (eu,us).
Which token issuers let servers join a network (OpenID Connect federation). As the owner of the network (mk login), or an admin: MINEKUBE_REGISTRY_TOKEN, a token of the registry’s issuer; at the local registry mk is the admin.
Make a one-time invite for a server whose environment issues no token a trust rule covers (a cluster without a public issuer, a plain VPS). The server shows it once to join; from then on its key is its identity. As the owner of the network, or an admin.
Argument
Is
<name>
The network.
Flag
Does
--hours <integer>
How long the invite works, 1 to 168 hours.
--labels <string>
Labels the registry gives each server this lets in, over its own: game=parkour,mode=solo. For selectors, as in mk publish -l.
Build the project as mk dev does and roll it out to a network’s instances: each instance the selector picks gets the bundles for its platform from the registry and swaps them in, players connected. As the owner of the network (mk login), or an admin.
Argument
Is
<directory>
The project, as for mk dev. Optional.
Flag
Does
--network <string>
The network’s name: players join it at <network>.<domain>, as <network>.g.minekube.net. Required.
--selector <string>, -l
The instances that run it, as a label selector like kubectl’s -l: channel=canary. Every instance of the network without one.
--revision <string>
Assign an earlier revision instead of building the project: rolls back (mk revisions lists them).
End what mk publish assigned to a selector: the instances it picked stop those bundles, players connected, and keep what other selectors give them. The revision stays, to assign again with mk publish —revision. As the owner of the network (mk login), or an admin.
Flag
Does
--network <string>
The network’s name: players join it at <network>.<domain>, as <network>.g.minekube.net. Required.
--selector <string>, -l
The instances that run it, as a label selector like kubectl’s -l: channel=canary. Every instance of the network without one.