>>107633044
You can just do this in Bash:
#!/bin/bash
key_id="$1"
set -- $(gpg --with-colons -k "$key_id" | awk -F: '$1=="uid" {print $10; exit}')
git_user_name="${@:1:$#-1}"
git_user_email="${@: -1}"
echo git config user.name="$git_user_name"
echo git config user.email="$git_user_email"
I had to look up the negative indexing stuff because that's really annoying to do in Bash though. You're right that JSON would be way easier to deal with from a parsing perspective.