Friday, May 26, 2023
HomeSoftware Engineering Unknown choices: –cli-binary-format AWS CLI

[Solved] Unknown choices: –cli-binary-format AWS CLI

You probably have tried calling the AWS CLI and acquired the next error:

Unknown choices: --cli-binary-format

Then it’s since you are utilizing the AWS CLI v1 and ought to be utilizing the newer AWS CLI v2.

One other error that you will notice together with that is:

An error occurred (InvalidRequestContentException) when calling the Invoke operation: Couldn't parse request physique into json: Couldn't parse payload into json: Unrecognized token 'eyJwYXRoIjoiJEdMAAAAIgfQo': was anticipating (JSON String, Quantity, Array, Object or token 'null', 'true' or 'false')

An instance that fails on AWS CLI v1

aws lambda invoke --function-name YourFunction --cli-binary-format raw-in-base64-out --payload '{"yourKey":"yourValue"}'

Easy methods to repair this error on AWS CLI v1

aws lambda invoke --function-name YourFunction --region eu-west-1 --payload '{"yourKey":"yourValue"}' response.json

Easy methods to repair this error by Upgrading to AWS CLI v2

You’ll be able to observe the information on to improve your CLI from v1 to v2 right here Migrating from AWS CLI model 1 to model 2 – AWS Command Line Interface (

The directions run by way of platform particular upgrades migrations:
AWS CLI model 2 migration directions – AWS Command Line Interface (

Easy methods to verify your AWS CLI model

You’ll be able to verify the model your aws CLI is working by typing:

aws --version


Please enter your comment!
Please enter your name here

Most Popular

Recent Comments