What is the 'xmessage' command equivalent on macOS?
AppleScript
On macOS, displaying simple dialogs is possible with AppleScript:
/usr/bin/osascript -e &quot;display dialog \&quot;Hello world\&quot;&quot;

See Displaying Dialogs and Alerts in Apple's Mac Automation Scripting Guide.
Additional buttons, choices, and other limited interface elements can be added:
set theDialogText to &quot;An error has occurred. Would you like to continue?&quot;
display dialog theDialogText buttons {&quot;Don't Continue&quot;, &quot;Continue&quot;} default button &quot;Continue&quot; cancel button &quot;Don't Continue&quot;