Amplify CLI Cheatsheet

Search for a command to run...

No comments yet. Be the first to comment.
A quick cheatsheet for TMUX commands that I can never remember. tmux yum -y install tmux Out of tmux new session tmux new new session with name tmux new -s sessionname show sessions tmux ls attach to session tmux attach-session -t 0 Go to last sessi...
Here's a fun error: "not syncing vfs unable to mount root fs on unknown block" I'm running CentOS7 on Linode and happened to run into this error on one of my systems. Quite unusual, so I did the quick and dirty method and restored a backup of my VM....
I discovered a fun git command that I wasn't aware of before. git switch -c <new-branch> Using git switch, you can take existing, uncommitted files and move them to a new branch. Say you're working in the master branch and want to move those changes...
Well, maybe not so hidden, but definitely not advertised. Vudu has an API that, for the life of me, I could not find advertised anywhere, even with an advanced Google search. So, I'll take it upon myself to scrape their webpage and dissect their ho...
I didn't realize until recently that you can run DynamoDB on a local machine on either Windows, Mac, or Linux. This obviously can be hugely benefitial for learning and dabbling in DynamoDB, without racking up a large AWS bill. Let's see if we can get...
A list of common commands for using Amplify CLI. Full Docs
curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd
curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL
npm install -g @aws-amplify/clinpm install -g @aws-amplify/cli
amplify configure
Initialize a new Amplify project
amplify init
Clone an Amplify project from github
amplify init --app <github url>
amplify <command> <subcommand>
init Initializes a new project, sets up deployment resources in the cloud, and makes your project ready for Amplify.
configure Configures the attributes of your project for amplify-cli, such as switching front-end framework and adding/removing cloud-provider plugins.
push Provisions cloud resources with the latest local developments.
pull Fetch upstream backend environment definition changes from the cloud and updates the local environment to match that definition.
publish Executes amplify push, and then builds and publishes client-side application for hosting.
serve Executes amplify push, and then executes the projects start command to test run the client-side application locally.
status Shows the state of local resources not yet pushed to the cloud (Create/Update/Delete).
delete Deletes all of the resources tied to the project from the cloud.
<category> add Adds a resource for an Amplify category in your local backend
<category> update Update resource for an Amplify category in your local backend.
<category> push Provisions all cloud resources in a category with the latest local developments.
<category> remove Removes a resource for an Amplify category in your local backend.
<category> Displays subcommands of the specified Amplify category.
mock Run mock server for testing categories locally.
codegen Generates GraphQL statements(queries, mutations and eventHandlers) and type annotations.
env Displays and manages environment related information for your Amplify project.
console Opens the web console for the selected cloud resource.
logout If using temporary cloud provider credentials, this logs out of the account.
List of Categories
analytics
api
auth
function
hosting
interactions
notifications
predictions
storage
xr
All categories use these common commands. If they have additional commands, they are listed under "Unique Commands":
amplify <category> <subcommand>
add Takes you through a CLI flow to add an resource to your local backend
update Takes you through steps in the CLI to update a resource
push Provisions cloud resources with the latest local developments
remove Removes resource from your local backend. The resource is removed from the cloud on the next push command.
console Opens the web console for the category
amplify api <subcommands>
gql-compile Compiles your GraphQL schema and generates a corresponding cloudformation template
add-graphql-datasource Provisions the AppSync resources and its dependencies for the provided Aurora Serverless data source
amplify auth <subcommands>
import Takes you through a CLI flow to import an existing auth resource to your local backend
amplify function <subcommands>
build Builds all the functions in the project (does an npm install on the functions src directory)
(Managed hosting with custom domains, Continuous deployment)
amplify hosting serve: Opens your deployed site
amplify hosting configure: Set up custom domains, redirects, password protection, and more via the Amplify Console.
amplify publish: Publishes changes to manually deployed apps. For continuous deployment, please push to your git branch to deploy updates.
amplify hosting remove: Remove hosting from you app.
import Takes you through a CLI flow to import an existing storage resource to your local backend
amplify env <subcommands>
add Adds a new environment to your Amplify Project
pull [--restore] Pulls your environment with the current cloud environment. Use the restore flag to overwrite your local backend configs with that of the cloud.
checkout <env-name> [--restore] Moves your environment to the environment specified in the command. Use the restore flag to overwrite your local backend configs with the backend configs of the environment specified.
list [--details] [--json] Displays a list of all the environments in your Amplify project
get --name <env-name> [--json] Displays the details of the environment specified in the command
import --name <env-name> --config <provider-configs> [--awsInfo <aws-configs>] Imports an already existing Amplify project environment stack to your local backend
remove <env-name> Removes an environment from the Amplify project