In SSMS when I click on the database \"Tasks -> Generate Scripts\", I get an output script.
How do I do the same with a non-graphical tool?