When you’re working with AWS CLI-style profiles over unstable connections, Mosh changes the game. No more losing your spot when you switch networks or your VPN blinks out. Your shell stays alive, your context stays intact, and your AWS profiles remain ready to run aws s3 sync or aws ec2 describe-instances without a hitch.
AWS CLI profiles let you manage multiple accounts and credentials without retyping keys or exporting variables every time. You define them once in ~/.aws/credentials and ~/.aws/config. Then you can call them instantly:
aws --profile staging ec2 describe-instances
aws --profile prod s3 ls
The friction starts when you’re not on a rock-solid connection. SSH drops. Your terminal resets. You log back in, re-run exports, re-navigate to your folder, and your flow dies. With Mosh, the connection survives switches from Wi-Fi to 5G, survives idle timeouts, and keeps session state without hacks.