we want to automate the process of publishing Tableau workbooks to Tableau server. can anyone advice on how to proceed? Is there any script for Doing autopublish or any REST API that can solve my Concern?

You need to provide the username and password when you publish a view. If you want to avoid this then you can first publish data sources with embedded credentials so as to avoid passing the usernames and passwords via tabcmd.