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.
Generate the project’s platform types for the versions its vite.config.ts names (paper.version, velocity.version), with the APIs of other plugins it names (plugins), into types/, without a server: from that build’s jars, downloaded from PaperMC once, with the generator the runtimes use. Kept in the Minekube home for every project. mk dev runs it first.
Generate the project’s platform types as mk types does, then build the bundles vite.config.ts names, install each where its platform runs on this machine (Paper bundles on the dev server, Velocity bundles on the dev proxy, client bundles in the daemon’s clients), and again on every save of a file they import, as vite dev does. The runtimes swap them in, players connected.
Build the bundles vite.config.ts names into dist/, with minekube.json naming each with its platform and SHA-256, as vite build does. mk deploy uploads what it holds.
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. Started in a project folder, it runs the Paper (and Velocity) version the project’s vite.config.ts names; else the one this CLI pins.
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 Minekube API locally in workerd on http://localhost:4776 (MINEKUBE_DEV_SLOT moves it); 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 API, 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_API_TOKEN, a token of the API’s issuer; at the local API 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_API_TOKEN, a token of the API’s issuer; at the local API 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_API_TOKEN, a token of the API’s issuer; at the local API mk is the admin.
Build the project as mk build does, upload what dist/ holds as a version of the target’s network, and deploy it to the target: every server its selector picks gets the bundles of its platform from the API and swaps them in, players connected. As the owner of the network (mk login), or an admin.
Point a target back at an earlier version: the one it ran before, or the one named. Every server its selector picks swaps it in, players connected. Rolling back twice goes forward again. After mk undeploy, which ends the target’s history, name the version.
End a target’s deployment: the servers its selector picks stop its bundles, players connected, and keep what other deployments give them. The version stays, to deploy again, but the deployment’s history goes with it: mk rollback then needs the version named.
Generate the project’s platform types for the versions its vite.config.ts names (paper.version, velocity.version), with the APIs of other plugins it names (plugins), into types/, without a server: from that build’s jars, downloaded from PaperMC once, with the generator the runtimes use. Kept in the Minekube home for every project. mk dev runs it first.
Argument
Is
<root>
The project: the directory with its vite.config.ts, as for vite. Optional.
Generate the project’s platform types as mk types does, then build the bundles vite.config.ts names, install each where its platform runs on this machine (Paper bundles on the dev server, Velocity bundles on the dev proxy, client bundles in the daemon’s clients), and again on every save of a file they import, as vite dev does. The runtimes swap them in, players connected.
Argument
Is
<root>
The project: the directory with its vite.config.ts, as for vite. Optional.
Flag
Does
--server <string>
Server directory to install Paper bundles into. Defaults to the dev server, server in the Minekube home (~/.minekube, .dev in a Minekube checkout, or MINEKUBE_HOME; server-N in dev slot N, MINEKUBE_DEV_SLOT).
--proxy <string>
Velocity directory to install Velocity bundles into. Defaults to the dev network’s proxy (mk server --network), network/velocity in the Minekube home (network-N/velocity in dev slot N).
Build the bundles vite.config.ts names into dist/, with minekube.json naming each with its platform and SHA-256, as vite build does. mk deploy uploads what it holds.
Argument
Is
<root>
The project: the directory with its vite.config.ts, as for vite. Optional.
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. Started in a project folder, it runs the Paper (and Velocity) version the project’s vite.config.ts names; else the one this CLI pins.
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 API runs in workerd (mk api). MINEKUBE_DEV_SLOT moves every port.
--join <string>
Make the dev server public in a network you own (mk login, mk network create): players join <network>.<domain> through the network’s relay, without an open port. It runs in online mode then, as anyone can reach it. Defaults to dev.join in the vite.config.ts of the current directory; without either the server is private again.
--api <string>
The Minekube API’s URL for —join; or MINEKUBE_API. Defaults to the API the current directory’s vite.config.ts names, else the local one.
--relay <string>
The relay’s iroh URL for —join. Defaults to the first relay the Minekube API knows, else the local one.
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. Defaults to the dev server, localhost:25569, moved by MINEKUBE_DEV_SLOT.
--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. Defaults to http://127.0.0.1:4775, moved by MINEKUBE_DEV_SLOT.
Run the Minekube API locally in workerd on http://localhost:4776 (MINEKUBE_DEV_SLOT moves it); it trusts tokens of this machine’s key (<home>/operator.json), which mk makes for its relay and itself.
Flag
Does
--port <integer>
The port, 4776 by default, moved by MINEKUBE_DEV_SLOT; another for a second API on this machine, which mk then reaches with —api and that port. Each slot’s API keeps its own state; one on any other port gets a throwaway state.
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 API, whose relay tokens mk makes.
Flag
Does
--listen <string>
Where Java players connect. Defaults to 127.0.0.1:25565, moved by MINEKUBE_DEV_SLOT.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Start the local one with mk api.
--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_API_TOKEN, a token of the API’s issuer; at the local API 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.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the local one (mk api), http://localhost:4776 or as MINEKUBE_DEV_SLOT moves it.
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_API_TOKEN, a token of the API’s issuer; at the local API 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).
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the local one (mk api), http://localhost:4776 or as MINEKUBE_DEV_SLOT moves it.
Take an instance out of a network: out of the network’s key set, so backends stop trusting its tokens once their cached keys expire, its control channel closed, waiting for a network again. Joining again needs a new code, invite or token.
Argument
Is
<id>
The instance id, or its first characters as mk instances shows them.
Flag
Does
--network <string>
The network’s name: players join it at <network>.<domain>, as <network>.g.minekube.net. Required.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the local one (mk api), http://localhost:4776 or as MINEKUBE_DEV_SLOT moves it.
Which token issuers let servers join a network (OpenID Connect federation). As the owner of the network (mk login), or an admin: MINEKUBE_API_TOKEN, a token of the API’s issuer; at the local API mk is the admin.
Let servers join a network with a token their environment gives them (a cluster’s service account, a CI job), instead of a claim code.
Flag
Does
--network <string>
The network’s name: players join it at <network>.<domain>, as <network>.g.minekube.net. Required.
--issuer <string>
The token issuer, exactly as its tokens’ iss claim says. Required.
--audience <string>
The audience the tokens are made for (aud claim).
--subject <string>
The subject the rule covers (sub claim). Required.
--prefix
Cover every subject that starts with —subject, like system:serviceaccount:games:.
--jwks <file>
The issuer’s public key set as a file, for an issuer the API cannot reach. Otherwise it reads it through the issuer’s OpenID discovery.
--labels <string>
Labels the registry gives each server this lets in, over its own: game=parkour,mode=solo. For the selectors of targets in vite.config.ts.
--network-issuer
The issuer is another Minekube network, https://<api>/n/<network>: its token lets in only the server whose key signed it, and the keys come from that API, so leave out —jwks.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the local one (mk api), http://localhost:4776 or as MINEKUBE_DEV_SLOT moves it.
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 the selectors of targets in vite.config.ts.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the local one (mk api), http://localhost:4776 or as MINEKUBE_DEV_SLOT moves it.
Build the project as mk build does, upload what dist/ holds as a version of the target’s network, and deploy it to the target: every server its selector picks gets the bundles of its platform from the API and swaps them in, players connected. As the owner of the network (mk login), or an admin.
Argument
Is
<target>
The target in vite.config.ts; not needed when there is only one. Optional.
Flag
Does
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--message <string>
Describes the version, up to 100 characters. Defaults to the subject of the project’s last git commit.
--tag <string>
Tags the version, up to 25 characters. Defaults to the project’s git commit: 12 characters of its hash, and -dirty with uncommitted changes.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
--strict-versions
Refuse to deploy while a server the target picks runs another version of a bundle’s platform than the bundle was built for (paper.version, velocity.version); without it mk only warns. Or strictVersions: true on the target.
Build the project and upload what dist/ holds as a version of the target’s network, without deploying it.
Flag
Does
--target <string>, -t
The target in vite.config.ts; not needed when there is only one.
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--message <string>
Describes the version, up to 100 characters. Defaults to the subject of the project’s last git commit.
--tag <string>
Tags the version, up to 25 characters. Defaults to the project’s git commit: 12 characters of its hash, and -dirty with uncommitted changes.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
The 50 newest versions of the targets’ networks, with the selectors that run them. As the owner of the network (mk login), or an admin.
Flag
Does
--target <string>, -t
The target in vite.config.ts; not needed when there is only one.
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
--full
Shows each version’s whole id rather than its first 12 characters, for a version that shares them with another.
Deploy a version uploaded before to a target: every server its selector picks swaps it in, players connected.
Argument
Is
<version>
The version: its id, or the first 12 or more characters of it, as mk versions list shows them.
Flag
Does
--target <string>, -t
The target in vite.config.ts; not needed when there is only one.
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
--strict-versions
Refuse to deploy while a server the target picks runs another version of a bundle’s platform than the bundle was built for (paper.version, velocity.version); without it mk only warns. Or strictVersions: true on the target.
What runs where in the targets’ networks: each selector and the version it points at. A server runs the bundles of every deployment whose selector picks it; for bundles of the same name the newer wins.
Flag
Does
--target <string>, -t
The target in vite.config.ts; not needed when there is only one.
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
Point a target back at an earlier version: the one it ran before, or the one named. Every server its selector picks swaps it in, players connected. Rolling back twice goes forward again. After mk undeploy, which ends the target’s history, name the version.
Argument
Is
<version>
The version to go back to, by its id or the first 12 or more characters of it; the one the target ran before by default. Optional.
Flag
Does
--target <string>, -t
The target in vite.config.ts; not needed when there is only one.
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
--strict-versions
Refuse to deploy while a server the target picks runs another version of a bundle’s platform than the bundle was built for (paper.version, velocity.version); without it mk only warns. Or strictVersions: true on the target.
End a target’s deployment: the servers its selector picks stop its bundles, players connected, and keep what other deployments give them. The version stays, to deploy again, but the deployment’s history goes with it: mk rollback then needs the version named.
Argument
Is
<target>
The target in vite.config.ts; not needed when there is only one. Optional.
Flag
Does
--root <string>
The project: the directory with its vite.config.ts. The current one by default.
--api <string>
The Minekube API’s URL; or MINEKUBE_API. Defaults to the API vite.config.ts names, else the local one (mk api, in the dev slot MINEKUBE_DEV_SLOT names).
The Effect UI devtools and their MCP server at /mcp
4775
The Minekube daemon (mk daemon)
4776
The local Minekube API (mk api, --port for another): the API every command and project uses unless --api, MINEKUBE_API or api in vite.config.ts names another
25565
The local relay (mk relay), where its players join
3340
The iroh relay server inside the local relay, which connectors reach it through
25577
The dev network’s relay, where players join (mk server --network)
25578
The dev network’s Velocity
25580, 25581
The dev network’s lobby and arena, RCON on 25590 and 25591
Where the CLI keeps the dev servers, Java, its sessions and downloads. Default ~/.minekube.
MINEKUBE_DEV_SLOT
Which dev setup on this machine this is, 0 to 99: slot N moves every port above by N×100 (the dev server, the dev network, the devtools, the daemon, the local API and relay), for a second setup next to the first. Its directories in the Minekube home end in -N (server-N, network-N, clients-N), and its API keeps its own state. Default 0.
MINEKUBE_API
The Minekube API’s URL, instead of --api; it goes before api in vite.config.ts. Default http://localhost:4776, the local API.
MINEKUBE_API_TOKEN
A token of the API’s issuer, to act as its admin instead of as your account (mk login). Unneeded at the local API, where mk is the admin.
MINEKUBE_DIST
Where a release of the CLI downloads its runtimes and SDK packages, instead of the release it came from.
MINEKUBE_RELAY
The relay’s URL for mk share, instead of --relay.
MINEKUBE_PUBLISH_KEY
The key the relay was deployed with, for mk share.