Aptible logoUse CasesCustomersLog In
Alex Kubacki
Alex Kubacki
December 6, 2017

The Aptible CLI now supports JSON output

We’re proud to announce that the Aptible CLI now supports JSON output. To enable JSON output, set the APTIBLE_OUTPUT_FORMAT environment variable to json when executing the Aptible CLI.

Over the past few months, and notably after the introduction of Endpoint management commands in the CLI, we have observed an uptick in customers using the Aptible CLI to automate workflows on Enclave. JSON output makes this a lot easier, since you no longer need an ad-hoc parser to process the CLI’s output.

Here’s an example:

$ export APTIBLE_OUTPUT_FORMAT=json $ aptible db:create --type redis my-db | python -m json.tool { "connection_url": "redis://:pass@db.aptible.in:123", "credentials": [ { "connection_url": "redis://:pass@db.aptible.in:123", "default": true, "type": "redis" }, { "connection_url": "rediss://:pass@db.aptible.in:456", "default": false, "type": "redis+ssl" } ], "environment": { "handle": "my-sandbox", "id": 1 }, "handle": "my-db", "id": 1, "status": "provisioned", "type": "redis" }

We’re planning further work towards enabling scriptability with the Aptible CLI. If you’re using (or would like to use) the CLI in a scripted context, we’d love to talk you. Please get in touch through support.