I would rather distribute the database as a couple of scripts to run. Distributing an .mdf file works the first time, but when you deliver updates, you need scripts. One way to do this would be with Database projects, DACPACs, sqlpackage and all that. Or just roll your own.
You don't need to run commands from SSMS, but you can use SQLCMD which is a command-line tool to run queries. Or use PowerShell from which you can use the Invoke-Sqlcmd cmdlet - or simply use ADO .NET calls directly.
Also distributing databases with .mdf files is not really the preferred way to do. BACKUP/RESTORE is better.