AWS Developer Tools Blog
Announcing new output formats in AWS CLI v2
Amazon Web Services (AWS) is announcing two new features for the AWS Command Line Interface (AWS CLI) v2: structured error output and the “off” output format.
Structured error output
Errors returned from AWS service APIs often include useful details beyond the code and message—bucket names, validation reasons, resource IDs—that were previously hidden unless you used --debug. Now, you can see this error information directly in your error output.
Starting with AWS CLI v2 version 2.34.0, any additional error details returned from service APIs will now be shown in the stderr output. Additionally, you can configure the AWS CLI to output your errors in alternative structured formats. Control how errors are displayed using the new --cli-error-format CLI flag, the cli_error_format configuration setting, or the AWS_CLI_ERROR_FORMAT environment variable.
Supported formats for the error format parameter:
- enhanced (default) – Error message with additional details displayed inline
- json – JSON structure with all error fields
- yaml – YAML structure with all error fields
- text – Tab-delimited error fields
- table – ASCII table format
- legacy – Original error format
Accessibility enhancements
Since September 2025, AWS CLI errors started including the aws: [ERROR]: prefix for some exceptions. This prefix signals that an error has occurred and supports accessibility best practices and automation use cases. This release ensures the prefix is consistently included for all errors in the enhanced and legacy formats.
Example: Using enhanced output error format
Example: Using json output error format
Example: Using legacy output error format
Turning off CLI output
Sometimes, you might want to hide the AWS CLI command output, such as when using a command that may output sensitive information. The off format suppresses stdout while still preserving errors on stderr.
For example, you can create an AWS Secrets Manager secret without writing the secret ARN or version information to logs:
You can set this using the--output off CLI flag, setting output = off in your configuration file, or the AWS_DEFAULT_OUTPUT=off environment variable.
Next Steps
To take advantage of these new output features, upgrade your version of the AWS CLI to 2.34.0. For more information, see the Structured error output and Output format guides. Please share your questions, comments, and issues with us on GitHub.