Install mm on macOS
In one line (Apple Silicon; the latest release, checked against its SHA256SUMS and its Developer ID signature, installed as /usr/local/bin/mm — sudo only when needed):
curl -fsSL https://rickub.com/bots-garden/mini-me/raw/main/install-mm.sh | bash
# a given version, without sudo, into ~/.local/bin:
curl -fsSL https://rickub.com/bots-garden/mini-me/raw/main/install-mm.sh | bash -s -- --version 2.1.1 --prefix ~/.local
--uninstall removes it, --dry-run downloads and checks without installing, --help lists the options; versions before 2.1.1 are not signed and need --no-verify. The steps below do the same by hand.
By hand
Short version:
VERSION=2.2.2
curl -fsSLO "https://rickub.com/bots-garden/mini-me/releases/download/v${VERSION}/mm-${VERSION}-darwin-arm64"
chmod +x ./mm-${VERSION}-darwin-arm64
sudo rm -f /usr/local/bin/mm
sudo cp ./mm-${VERSION}-darwin-arm64 /usr/local/bin/mm
mm --version
From v1.0.5, the macOS binary is signed with a Developer ID and notarized by Apple. You can check who signed it before you install it, and there is no quarantine attribute to remove.
# download the binary release in https://rickub.com/bots-garden/mini-me/releases
VERSION=2.2.2
curl -fsSLO "https://rickub.com/bots-garden/mini-me/releases/download/v${VERSION}/mm-${VERSION}-darwin-arm64"
# optional: check the download against the release's checksums
curl -fsSLO "https://rickub.com/bots-garden/mini-me/releases/download/v${VERSION}/SHA256SUMS"
shasum -a 256 -c --ignore-missing SHA256SUMS
# check the signature: valid, and made by the mini-me Developer ID
codesign --verify --strict --verbose=2 ./mm-${VERSION}-darwin-arm64
codesign -dv --verbose=4 ./mm-${VERSION}-darwin-arm64 2>&1 | grep -E "^Identifier|^Authority=Developer ID Application|^TeamIdentifier"
chmod +x ./mm-${VERSION}-darwin-arm64
sudo rm -f /usr/local/bin/mm
sudo cp ./mm-${VERSION}-darwin-arm64 /usr/local/bin/mm
mm --version
The signature check should print:
./mm-2.2.2-darwin-arm64: valid on disk
./mm-2.2.2-darwin-arm64: satisfies its Designated Requirement
Identifier=com.bots-garden.mm
Authority=Developer ID Application: Philippe Charriere (SNLLBZP9V9)
TeamIdentifier=SNLLBZP9V9
Downloaded with a browser instead of curl, the file carries the quarantine attribute: macOS checks the notarization online the first time you run it (so that first run needs the network), then runs it without asking. There is no need for xattr.
Versions up to v1.0.4 (not signed)
Up to v1.0.4, the macOS binary was not signed with a Developer ID: it only had the ad hoc signature the Go linker gives every darwin/arm64 binary. A copy that macOS had put in quarantine (a browser download, for example) was blocked at its first run, with "Apple could not verify…". The xattr -cr line removed the quarantine attribute so that the binary could run. There is nothing to check with codesign for these versions.
Use this block only to install one of these older versions:
VERSION=1.0.4
curl -fsSLO "https://rickub.com/bots-garden/mini-me/releases/download/v${VERSION}/mm-${VERSION}-darwin-arm64"
chmod +x ./mm-${VERSION}-darwin-arm64
xattr -cr ./mm-${VERSION}-darwin-arm64
sudo rm -f /usr/local/bin/mm
sudo cp ./mm-${VERSION}-darwin-arm64 /usr/local/bin/mm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|