Deploy with AI coding agents
AWS Amplify has a skill for AI coding agents, such as Kiro CLI and Claude Code. The skill teaches the agent the Amplify CLI commands to create, deploy, and manage your app. You describe what you want, and the agent runs the commands. This page lists the exact commands, so you or your agent can follow them.
Prerequisites
Before you start, make sure that you have the following:
-
AWS credentials for your AWS account
-
Node.js 22.12 or later, and npm 10 or later
-
The latest version of the AWS Command Line Interface (AWS CLI) v2
-
Permissions for Amplify
For how to set up each item and give your account permissions, see Tutorial: Deploy a website.
To check your AWS credentials, run the following AWS CLI command:
aws sts get-caller-identity
If the command prints your account ID and Amazon Resource Name (ARN), your credentials are valid. If it fails, your credentials are missing or expired. Sign in again, as described in Tutorial: Deploy a website.
Step 1: Install the AWS CLI
If your agent installs the CLI for you, skip this step.
Install or update to the latest AWS CLI v2 by following the Installing or updating to the latest version of the AWS CLI in the AWS CLI User Guide. The AWS CLI includes the aws amplifygen3 subcommand for creating, deploying, and managing Amplify apps.
Run the following command to verify the installation:
aws amplifygen3 help
You should see a list of commands that includes create and deploy.
Step 2: Install the Amplify skill
Run the following AWS Agent Toolkit command to install the skill:
aws agent-toolkit add-skill --skill-name aws-amplify
After you install the skill, restart your agent.
Step 3: Ask your agent to deploy your app
In your app folder, give your agent a prompt such as the following:
Deploy my app to Amplify and give me the preview URL.
The agent runs Amplify CLI commands such as the following:
-
To create your app:
Replace
my-appwith the name of your app.aws amplifygen3 create --name my-appThis command creates the app and writes the
amplify.jsoncconfiguration file to your app folder. If the folder already has anamplify.jsoncfile, the agent uses it instead of runningcreate. -
To deploy your app:
aws amplifygen3 deployThis command deploys your app to the
previewenvironment. The agent gives you the URL from theVisitline of the command output, such as the following:Visit: https://preview-ab12--my-app.amplify.app/
To avoid keeping resources that you don’t need, delete the app when you finish. For the commands, see Clean up.
Step 4: Ask your agent to add a backend
If your app needs a database, or users who sign up and sign in, your agent can add a backend. A backend has three parts: Database, Auth, and Data API. Auth is authentication, authorization, and user management, built into your backend.
Your agent can add the backend, write its tables as migrations, run it on your computer, and deploy it. To run the backend on your computer, the CLI uses Docker by default, so install Docker and start it. To use Finch instead, start Finch. Then set the AWS_AMPLIFY_CONTAINER_RUNTIME environment variable to finch, or add "containerRuntime": "finch" to amplify.local.json.
In your app folder, give your agent a prompt such as the following:
Add a backend to my app so that users can sign up and sign in with an email and password. Each user sees only their own notes. Run it locally and show me that it works.
The agent runs Amplify CLI commands such as the following:
-
To add a backend to your app:
aws amplifygen3 local backend addThis command turns on the
backendblock inamplify.jsoncand creates themigrations/and.secrets/folders. In a project with apackage.jsonfile, it also installs the client SDK. If your folder has noamplify.jsoncfile yet, the agent runsaws amplifygen3 local init --type fullstackinstead. -
To run the backend and your app on your computer:
aws amplifygen3 local runThis command starts the backend in Docker or Finch and applies your migrations. Then it starts your app’s dev server.
-
To create a table:
aws amplifygen3 local migration create --description "create notes"The agent writes the table, its grants, and its row-level security (RLS) policies in the new migration file. Then it applies the migration with
aws amplifygen3 local migration apply. -
To deploy your app and its backend:
aws amplifygen3 deployThis command deploys to the
previewenvironment. Your first deployment from the CLI creates the backend and applies your migrations.
You can also give your agent prompts such as the following:
Add a due_date column to the notes table with a new migration, try it locally, and deploy it to preview.
Show me how much database compute my app's backend used this month, and list the branches of my preview environment.
For the last prompt, your agent gets the usage from aws amplifygen3 app get and the branches from aws amplifygen3 branch list --env preview.
For more information, see Backend.
Commit amplify.jsonc to your repository
amplify.jsonc is the file to commit to your repository. It holds your app’s build settings, so your teammates and their agents deploy the app the same way.
-
Don’t put environment variables or secrets in
amplify.jsonc. Set them withaws amplifygen3 var setinstead. For more information, see Environment variables and secrets. -
Don’t commit the
.amplify/folder. It’s build output, andaws amplifygen3 createadds it to your.gitignorefile. -
If your app has a backend, also commit the
migrations/folder. Don’t commit.secrets/oramplify.local.json, which hold your local database password and this computer’s local state.aws amplifygen3 local backend addadds both to your.gitignorefile.
For more information about amplify.jsonc, see Configuration file.
What your agent asks before it acts
The Amplify skill tells your agent to ask you and wait for your yes before it does the following:
-
Deploys to the
productionenvironment (aws amplifygen3 deploy --env production) -
Deletes an app, environment, integration, or domain
-
Turns off access control for an environment (
aws amplifygen3 access-control disable), which makes every deployment in that environment public -
Disconnects your Git repository (
aws amplifygen3 app edit --git ""), which stops Git deploys for every environment -
Deletes the backend, with every branch in every environment, including
production. To delete it, your agent removes thebackendblock fromamplify.jsoncand then runsaws amplifygen3 deploy --allow-destroy.Delete the backend?Deleting the backend also deletes each branch’s database, its automated backups, and its users. The
aws amplifygen3 app edit --backend remove --allow-destroycommand deletes the backend the same way, without a prompt. -
Deletes a backend branch and its data (
aws amplifygen3 branch delete). The command refuses theproductionbranch. It also refuses the branch that your live deployment uses, unless the agent adds--allow-deployed-branch. -
Deletes a user of your app, with the user’s sessions (
aws amplifygen3 backend user delete) -
Creates or edits a user for your app in the
productionenvironment (aws amplifygen3 backend user createoraws amplifygen3 backend user edit) -
Revokes a publishable key (
aws amplifygen3 backend publishable-key revoke), which turns the key off for good. If your live deployment uses the key, you also pass--allow-deployed-key. In that case, your app’s backend requests fail until the next successful deployment. -
Deletes a network connector, which disconnects your app from the resources in your VPC
-
Resets or deletes the local backend and its data (
aws amplifygen3 local resetoraws amplifygen3 local destroy)
In an agent session, a command that asks you to confirm stops before it changes anything, unless the agent adds --yes. Your agent adds --yes only after you say yes. For more information about what each command deletes, see Backend.
Common commands
The following table lists Amplify CLI commands that you or your agent can use.
| Command | Description |
|---|---|
|
|
Create an app and write |
|
|
Deploy your app to the |
|
|
Deploy your app to the |
|
|
List your apps |
|
|
Show details for an app |
|
|
List an app’s environments |
|
|
Create an environment |
|
|
List your integrations |
|
|
Set an environment variable |
|
|
Add a custom domain to an environment |
|
|
Get your app’s runtime logs |
For every command and option, see the CLI reference. For the frameworks that Amplify supports, see Frameworks.
Clean up
To avoid keeping resources that you don’t need, delete the app when you finish.
Deleting the app also deletes all of its environments and its backend, including every branch’s database and users. This action can’t be undone.
To delete the app and all of its environments, run the following command. Replace my-app with the name of your app.
aws amplifygen3 app delete --app my-app --yes
The app delete command doesn’t delete integrations. To delete an integration, run aws amplifygen3 integration delete --name integration-name, replacing integration-name with the name of your integration.
Next steps
After your agent deploys your app, you can do the following:
-
Add more AWS service integrations to your app.
-
Create a custom domain name.
-
Deploy with GitHub Actions instead of from your machine.