1
0
Fork 0

feat(scripts): Add script to get a Minecraft account UUID

This commit is contained in:
Avery 2025-07-22 13:17:19 +02:00
parent deab672810
commit a380da80a1
Signed by: Avery
GPG key ID: B684FD451B692E04
3 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,16 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "get-minecraft-uuid";
runtimeInputs = with pkgs; [ curl jq gnused ];
text = ''
usage() {
echo "USAGE: get-minecraft-uuid USERNAME"
exit 1
}
test -n "$1" || usage
curl -s "https://api.mojang.com/users/profiles/minecraft/$1" | jq -r ".id" | sed -r "s/^(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})$/\1-\2-\3-\4-\5/"
'';
}