From 0ef2d34f5884f26b7b958002f86eeaf122eb7bf9 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Sat, 28 Nov 2026 19:57:27 +0300 Subject: [PATCH] Describe installing the command line tool with mise mise's github backend already installs the native binary from the GitHub release and verifies its digest and build attestation, so the Command line page gets a mise section next to Homebrew, with the per-project pin in mise.toml and the platforms where it picks the wrong file. --- docs/get-started/command-line.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/get-started/command-line.md b/docs/get-started/command-line.md index e11f465..60ccca8 100644 --- a/docs/get-started/command-line.md +++ b/docs/get-started/command-line.md @@ -1,7 +1,8 @@ # Command line The formatter comes as a native binary that needs no Java, and as a runnable jar for every platform -the binaries do not cover. On macOS and Linux, Homebrew installs the binary and keeps it current. +the binaries do not cover. On macOS and Linux, Homebrew installs the binary and keeps it current; +mise installs it on Windows too, and pins its version per project. ## Homebrew @@ -20,6 +21,31 @@ the file with `curl`, so macOS does not quarantine it. version can change the output (see [Versions](../about.md#versions)): `brew pin open-java-format` holds the installed one. +## mise + +``` sh +mise use github:openjavaformat/open-java-format@{{ ojf_version }} +open-java-format --version +``` + +[mise](https://mise.jdx.dev) installs the tool from the GitHub release with its +[github backend](https://mise.jdx.dev/dev-tools/backends/github.html): it picks the native binary for +your platform, checks it against the digest GitHub publishes and the release's build attestation, and +puts `open-java-format` on your `PATH`. That works on macOS, on Linux with glibc and on Windows +x86-64. On Windows on ARM and on musl-based Linux it would pick the wrong file, so use the jar there. + +`mise use` writes the version into the project's `mise.toml`, so everyone on the project formats with +the same one: + +``` toml title="mise.toml" +[tools] +"github:openjavaformat/open-java-format" = "{{ ojf_version }}" +``` + +Add `-g` to install it for your user instead of one project. Without a version, `mise use` writes +`latest`, and `mise upgrade` then takes each new release. A new minor version can change the output +(see [Versions](../about.md#versions)), which is why the example pins one. + ## Download Pick the file for your platform from the