AppleScript should be roughly:

tell app "Whatever" to quit

If it needs to run as a shell script, then I think it's osascript -e 'tell app "Whatever" to quit'.

// @skematica @kdfrawg