Vai can be scripted using Lua.
A comprehensive list of available command can be retrieved using the help() command in the lua console.
help()
To monitor which commands are being used by buttons and menu items, use the Lua History panel.