# Platform updates

> Planned: mk update installs the newest CLI after checking its hash against the release manifest, and /minekube update fetches the newest Minekube plugin into the server's update folder, on any setup.

> **Planned:**
> This page describes a design that is not built yet. Today you publish with `mk publish`, `mk revisions` and `mk unpublish`; see [Publish a revision](https://minekube.com/games/versions-and-deployments/publish).

The native parts of Minekube, the CLI and the Minekube plugin with its connector, change rarely. Every build of `main` that passes CI is a GitHub release with a `manifest.json` that names every file with its SHA-256. Two planned commands install them.

## `mk update`

- It finds the newest release from the redirect of `releases/latest`.
- It downloads `manifest.json` and `minekube-cli.tgz` of that build, checks the SHA-256 against the manifest, and installs the checked file with `bun add -g`.
- In a checkout of the repository it refuses: there, the update is `git pull`.
- A note about a new version appears at most every 20 hours, can be turned off with an environment variable, and never appears in CI.

## `/minekube update` on a server

- In the console or in the game, it downloads the plugin jar of the newest release, checks it against the manifest and puts it in `plugins/update/`. Every Bukkit server knows this folder: on the next start it replaces the plugin with it.
- `/minekube update --restart` restarts the server once the games' holds are released. A supervisor starts it again: Docker with a restart policy, systemd, Kubernetes or `mk server`. Without a supervisor the server stops, and the next start takes the new jar.
- There is no reload without a restart. The plugin brings native libraries, and a JVM loads a native library only once per process.

## Related

- [Controlled updates](https://minekube.com/games/versions-and-deployments/controlled-updates): the holds a restart waits for.
- [Open source](https://minekube.com/games/platform/open-source): where releases come from.
