Script to publish modules utilizing the API https://www.terraform.io/docs/cloud/api/modules.html. Uses native OS python json library, but the alt. jq lines are included feel free to amend.
> git clone https://gist.github.com/abuxton/ea5f37767af44a710020ee2fbe97a7f3 publish-pmr-module && cd publish-pmr-module
export TFE_ORG=# your TFE/C organisation name
export TFE_ADDR=app.terraform.io #set your internal TFE DNS