content query --uri content://contacts/phones/
Well I found shell commands that would output a list of contacts, but they don't work without root. You will get an error because MacroDroid doesn't request permission android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY.
Bash:content query --uri content://contacts/phones/