I found a script that sends messages from the command line, but It won't work with my group chat with spacing and capitalization in the name.
#!/bin/sh
recipient="${1}"
message="${*:2}"
echo "$recipient"
cat<<EOF | osascript - "${recipient}" "${message}"
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
EOF
when I run ./sendmessage "GROUP CHAT" "test"
it gives me
228:261: execution error: Messages got an error: Can’t get buddy id "7087805D-ED73-4DB9-81AB-7C964B98AB34:group chat". (-1728)