How to set the default output format in AWS CLI

Setting a default output format in AWS CLI keeps repeated commands consistent without adding --output every time. That is useful when one profile is mainly used in scripts that expect json, while another profile is used interactively and is easier to read as yaml or table.

The saved output setting lives in the shared config file, which is ~/.aws/config on Linux and macOS and %UserProfile%\.aws\config on Windows. Current AWS CLI v2 documentation lists json, yaml, yaml-stream, text, table, and off as supported output formats, and json remains the default when no override is active.

This page is about saving the profile default. AWS_DEFAULT_OUTPUT can override that value for one shell, and --output can override it for one command. aws configure get output reads only the saved config entry, so finish with a normal aws command when you need to confirm the effective formatter.

Steps to set the default output format in AWS CLI:

  1. Choose the format that matches how the profile is normally used.
    Format Typical use
    json Default machine-readable output for scripts, API responses, and later parsing
    yaml Readable structured output for interactive review
    yaml-stream Streamed YAML for large responses
    text Flat tab-delimited output after the command already returns the exact fields needed
    table Human-readable terminal output for quick inspection
    off No stdout output when only the exit status matters

    Prefer json, yaml, or yaml-stream while building --query expressions, then switch to text only after the query already returns the exact value or flat list you need. Related: How to use JMESPath queries in AWS CLI

  2. Save the preferred format for the default profile.
    $ aws configure set output yaml

    This writes

    output = yaml

    under the

    [default]

    section in the shared config file.

  3. Save a different format for a named profile when another account or workflow needs its own default.
    $ aws configure set output table --profile work

    This writes

    output = table

    under

    [profile work]

    instead of changing the unnamed default profile. Related: How to configure multiple AWS CLI profiles

  4. Read the saved value back from the profile that was changed.
    $ aws configure get output
    yaml
    $ aws configure get output --profile work
    table

    aws configure get reads the config file only. If AWS_DEFAULT_OUTPUT or --output is overriding the shell, this command still shows the saved profile value.

  5. Inspect the shared config file when you need to confirm which profile section was updated.
    $ cat ~/.aws/config
    [default]
    output = yaml
    [profile work]
    output = table

    On Windows, inspect

    %UserProfile%\.aws\config

    instead. Related: How to find the AWS CLI config file location

  6. Run a normal AWS CLI command without --output and confirm that the response already uses the saved format.
    $ aws s3api list-buckets --generate-cli-skeleton output
    Buckets:
    - BucketArn: BucketArn
      BucketRegion: BucketRegion
      CreationDate: 1970-01-01 00:00:00
      Name: Name
    ContinuationToken: ContinuationToken
    Owner:
      DisplayName: DisplayName
      ID: ID
    Prefix: Prefix

    This local sample is enough to prove that the saved formatter is shaping ordinary aws output. Use --profile work on the same command when you want to verify a named profile instead of the default one.

    --generate-cli-skeleton output renders without live credentials or an AWS API call, but AWS notes that generated skeleton output is not stable across CLI versions.