You should do this even if you want to automate ZAP from the command line, as it will help us understand which parts of the authentication process ZAP can automatically handle.
If ZAP can automatically handle things then it will make your life easier.