See below for recommended approach -or- keep reading for a fix for aws-shell.
aws-shell requires awscli version 1 to function correctly, otherwise you'll receive the cli_binary_format error. To work around this you can do the following in the cloudshell environment.
- Install awscli version 1 and aws-shell:
pip3 install --user -U awscli aws-shell boto3 --use-feature=2020-resolver --no-cache-dir
- Update your PATH to cause the awscli version 1 to be the default:
export PATH=/home/cloudshell-user/.local/bin/:$PATH
However, the better solution would be to use awscli version 2 and enable the auto prompt feature as described here https://github.com/aws/aws-cli/issues/5664
aws configure set cli_auto_prompt on
or
export AWS_CLI_AUTO_PROMPT=on
Then awscli version 2 will behave similarly to aws-shell, providing completion hints etc.