Setting a default output format in AWS CLI keeps repeated commands consistent without adding --output to every invocation. That matters when one profile is mainly used for automation that expects stable machine-readable output, while another profile is used interactively and is easier to read as yaml or table.
The AWS CLI stores the profile-level output setting in the shared config file, normally ~/.aws/config. Running aws configure set output VALUE writes that preference locally without making an AWS API call, and current AWS documentation lists json, text, table, yaml, yaml-stream, and off as supported output values.
The saved value is only the profile default. AWS_DEFAULT_OUTPUT in the current environment overrides the config file, and an explicit --output flag overrides both, so unexpected formatting usually comes from a higher-precedence override rather than a failed write. The output key belongs in the shared config file instead of the shared credentials file.
| Format | Typical use |
|---|---|
| json | Structured output for automation and downstream parsers |
| yaml | Readable structured output for interactive review |
| yaml-stream | Incremental YAML documents for larger 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 or yaml while building --query expressions, and switch to text only after the command already returns the exact scalar or flat list needed.
$ aws configure set output yaml
This writes
output = yaml
under the
[default]
section in the shared config file. Replace yaml with the value chosen in the previous step when another format fits better.
$ aws configure set output table --profile work
The --profile flag writes the setting under
[profile work]
instead of changing
[default]
.
$ aws configure get output yaml $ aws configure get output --profile work table
An empty result means that profile does not have an explicit output value saved yet, so the effective format will come from a higher-precedence override or the CLI default.
$ sed -n '1,40p' ~/.aws/config [default] output = yaml [profile work] output = table
The output format belongs in the config file, not in ~/.aws/credentials. On Windows, inspect
%UserProfile%\.aws\config
instead.
Related: How to find the AWS CLI config file
$ 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 $ aws s3api list-buckets --generate-cli-skeleton output --profile work ---------------------------------------------------------------- | ListBuckets | +-----------------------------------------+--------------------+ | ContinuationToken | Prefix | +-----------------------------------------+--------------------+ | ContinuationToken | Prefix | +-----------------------------------------+--------------------+ ##### snipped #####
--generate-cli-skeleton output renders locally, so it is useful for confirming the selected format even before live credentials are configured or a service call is made.