edit-icon download-icon

Command output format

Last Updated: Dec 21, 2017

Output format

To meet different output format requirements of different users, Alibaba Cloud CLI supports three output formats.

  • JSON (json)

    JSON format is the default output format of Alibaba Cloud CLI. Most languages have the internal function or open JSON parser library to parse JSON strings easily. JSON format is mainly used with other scripts or any programming language to facilitate developers’ parsing and use. An example is shown as follows.

    json format

  • Text separated by Tab (text)

    In text format, outputs of Alibaba Cloud CLI are arranged into lines separated by Tab. This format is appropriate for traditional UNIX text tools (such as sed, grep, and awk) and Windows PowerShell. The text output format complies with the basic structure shown in the following example. The columns are sorted alphabetically by key names of bottom-layer JSON objects.

    text format

  • ASCII table (table)

    In table format, data is arranged in an easy-to-read manner. An example is shown as follows.

    table format

Set the output format

The output format can be specified in two ways.

Method 1: Modify the config file.

Use the output option in the config file. The following example shows how to set the output format to text.

  1. [default] output=text

Method 2: Use command line.

Use the output option in Alibaba Cloud CLI. The following example shows how to set the output format to table.

  1. $ aliyuncli ecs DescribeInstanceAttribute --InstanceId i-23rjh06vf --output table
Thank you! We've received your feedback.