Changelog

The Aptible CLI now supports JSON output

Thomas Orozco on December 6, 2017

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ 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.