The HUD service is available as a service on DBus, so if you'd just like to poll it for information you can do that with a gdbus command, like this.
gdbus call --session --dest com.canonical.hud --object-path /com/canonical/hud --method com.canonical.hud.StartQuery "my query" 5
If you're trying to get Unity to show the HUD prompt you can do that with the XTest extension using xdotool like this:
xdotool key alt
If you're interested in playing with HUD it's probably best to use the hud-gtk tool which is in the indicator-appmenu-tools package.