In SQLCMD is there any way of shelling out to run arbitrary programs?
The !! &lt;command&gt; syntax lets you shell out.

The external command is handled synchronously (i.e. the next line of the SQL script will not execute until this command finishes). This is why the documentation has a note in a few places stating:


  When you use the Query Editor in SQLCMD Mode, you must be careful not to execute interactive statements. The Query Editor cannot respond to operating system prompts.


and:


  ...because the Query Editor does not have the ability to respond to operating system prompts, you must be careful not to execute interactive statements.


You can test this rather easily by creating a SQL script of nothing more than:

!!pause


If you run this in SSMS, you will have to cancel the query else it will just keep running. Once it is canceled, you will see the following in the "Messages" tab:


  Press any key to continue . . . Query was cancelled by user.


Please see this MSDN page for more information. 

However, this introduces an external dependency on your build process, not to mention that SQLCMD mode is not enabled by default in SSMS and cannot be programmatically enabled (though it is possible to change the default setting to always be enabled). Hence you might be better off encapsulating the JSON functionality in a SQLCLR function or stored procedure.