SSMS leverages SMO for that, which is installed with the client tools. I do these types of tasks with PowerShell referencing SMO. To my knowledge there is no command-line access to the "Generate And Publish Scripts" functionality in SSMS, and that is a shame.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato