The CLI is able to output standard JSON for CLI commands. This makes it relatively easy to store infrastructure as code as well as to retrieve settings/status for Tower entities. jq is a great tool for this purpose. It allows you to retrieve specific entries within the JSON schema dumped by the CLI on the CLI.
For example if you use -o json for any command in the Tower CLI it will dump the output in JSON format. The command below is fetching various information about a run in the community/showcase workspace on Tower:
The CLI is able to output standard JSON for CLI commands. This makes it relatively easy to store infrastructure as code as well as to retrieve settings/status for Tower entities.
jq
is a great tool for this purpose. It allows you to retrieve specific entries within the JSON schema dumped by the CLI on the CLI.For example if you use
-o json
for any command in the Tower CLI it will dump the output in JSON format. The command below is fetching various information about a run in thecommunity/showcase
workspace on Tower:We can simply pipe this command to
jq
to get specific entries within the JSON output.Please consult the
jq
docs for more extensive patterns and usage.