Shorten the CLI command for AWS Amplify

Shorten the CLI command for AWS Amplify

Is typing "aws amplifygen3" a bit too long, use this simple alias for "amp"

Developer. Hacker. Creator.
As a developer, I like really short commands. Even though we have agents, I still type and run CLI commands a lot.
We just launched the  latest AWS Amplify  and it's awesome! The latest Amplify is part of the  AWS CLI , with the command  aws amplifygen3 .
The one thing I wanted was a shorter version of this command, something like:
amp deploy
amp rollback
# etc
Here's how I did it for my  zsh  shell.
Add this to your  ~/.zshrc :
amp() {
case "${1-}" in
dev)
shift
set -- local run "$@"
;;
status | stop)
set -- local "$@"
;;
tail)
shift
set -- local logs --follow "$@"
;;
migrate)
shift
set -- local migration apply "$@"
;;
esac
aws amplifygen3 "$@"
}
I restarted my shell and that was it! 🎉

Now I can run commands a bit more easily when I'm doing local development.
Let me know what you think, and send any feedback you have on the latest AWS Amplify.


As always, happy shipping 🫡!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article