Skip to content

Deploy: Plan and Apply

Preview deployment changes, apply them, check status, and tear down resources.

  • Deploy section configured in arena.yaml (see Configure Deploy)
  • A compiled .pack.json file
  • An installed adapter

Preview what changes will be made without modifying anything:

Terminal window
promptarena deploy plan

Target a specific environment:

Terminal window
promptarena deploy plan --env production

Example output:

Planning deployment (env: production)...
Provider: agentcore v0.2.0
Changes:
+ agent_runtime.greeting Create agent runtime
+ a2a_endpoint.greeting Create A2A endpoint
Summary: 2 resources to create, 0 to update, 0 to delete
SymbolActionDescription
+CREATENew resource will be created
~UPDATEExisting resource will be modified
-DELETEResource will be removed
!DRIFTResource has drifted from expected state
NO_CHANGEResource exists and needs no changes

Run both plan and apply in one step:

Terminal window
promptarena deploy

Or target an environment:

Terminal window
promptarena deploy --env staging

What happens:

  1. The CLI loads arena.yaml and merges environment config
  2. Auto-detects or uses the specified pack file
  3. Sends a plan request to the adapter
  4. Sends an apply request with streaming progress
  5. Saves state to .promptarena/deploy.state
Terminal window
promptarena deploy --pack dist/app.pack.json
Terminal window
promptarena deploy --config deploy.yaml

Query the current state of deployed resources:

Terminal window
promptarena deploy status

Or for a specific environment:

Terminal window
promptarena deploy status --env production

Example output:

Status: deployed
Last deployed: 2026-02-16T10:30:00Z
Pack checksum: sha256:abc123def456...
Resources:
agent_runtime.greeting: healthy
a2a_endpoint.greeting: healthy
StatusMeaning
deployedAll resources are running
not_deployedNo resources found
degradedSome resources are unhealthy
unknownUnable to determine status
HealthMeaning
healthyResource is running normally
unhealthyResource exists but has issues
missingResource was expected but not found

Remove all managed resources:

Terminal window
promptarena deploy destroy --env staging

What happens:

  1. Loads prior state (exits if no state exists)
  2. Sends a destroy request to the adapter
  3. The adapter removes all managed resources
  4. Deletes the local state file

When you update a pack and redeploy, the adapter receives the prior state and can determine what changed:

Terminal window
# Update your prompt
vim prompts/greeting.yaml
# Recompile
packc compile --config arena.yaml --output app.pack.json --id my-app
# Plan shows updates
promptarena deploy plan --env production
# Apply updates
promptarena deploy --env production

The plan will show ~ (UPDATE) for resources that need modification and empty space for resources with no changes.

Terminal window
# Deploy in order: dev → staging → production
promptarena deploy --env dev
promptarena deploy --env staging
promptarena deploy --env production
Terminal window
for env in dev staging production; do
echo "=== $env ==="
promptarena deploy status --env $env
done

Always plan before applying to production:

Terminal window
# Review the plan
promptarena deploy plan --env production
# Apply after review
promptarena deploy apply --env production

Refresh local state to match the live environment. This detects drift — resources that have been modified outside of PromptKit.

Terminal window
# Refresh state for default environment
promptarena deploy refresh
# Refresh state for production
promptarena deploy refresh --env production

Example output:

Refreshing state (env: production)...
Provider: agentcore v0.2.0
Resources:
agent_runtime.greeting: healthy
! a2a_endpoint.greeting: unhealthy — endpoint configuration changed
State refreshed at 2026-02-16T11:00:00Z

State is also automatically refreshed before each deploy plan and deploy command, so manual refresh is mainly useful for checking drift without planning changes.

Import pre-existing cloud resources into deployment state. This is useful when you’ve created resources manually or with another tool and want PromptKit to manage them going forward.

Terminal window
promptarena deploy import <type> <name> <id>

Examples:

Terminal window
# Import an agent runtime by its container ID
promptarena deploy import agent_runtime my-agent container-abc123
# Import an A2A endpoint
promptarena deploy import a2a_endpoint my-ep endpoint-xyz789
# Import into a specific environment
promptarena deploy import agent_runtime my-agent container-abc123 --env production

Example output:

Importing agent_runtime "my-agent" (container-abc123)...
Imported: agent_runtime.my-agent — healthy

After importing, the resource appears in deploy plan and deploy status output, and will be managed by subsequent deploy and deploy destroy operations.

The status and destroy commands require a prior deployment. Deploy first:

Terminal window
promptarena deploy --env production

Compile your pack first, or specify the path:

Terminal window
promptarena deploy --pack path/to/app.pack.json

If plan shows all resources as NO_CHANGE, the pack and config haven’t changed since the last deploy. Update your pack or config and try again.