Skip to main content
The argocd app command provides comprehensive application management capabilities including creation, synchronization, deletion, and monitoring.

Quick Examples

# List all applications
argocd app list

# Get application details
argocd app get my-app

# Set an override parameter
argocd app set my-app -p image.tag=v1.0.1

Subcommands

create

Create a new application.
Create from a Git repository:
argocd app create guestbook \
  --repo https://github.com/argoproj/argocd-example-apps.git \
  --path guestbook \
  --dest-namespace default \
  --dest-server https://kubernetes.default.svc
Key Flags:
--repo
string
required
Repository URL
--path
string
required
Path in repository to the app directory
--dest-namespace
string
required
Kubernetes target namespace
--dest-server
string
required
Kubernetes cluster URL (e.g., https://kubernetes.default.svc)
--sync-policy
string
Set sync policy: manual, automated, auto, or automatic
--auto-prune
boolean
Automatically prune resources no longer defined in Git
--self-heal
boolean
Automatically sync when cluster state deviates from Git

list

List all applications.
# List all applications
argocd app list

# List with JSON output
argocd app list -o json

# Filter by project
argocd app list -p my-project

# Filter by label
argocd app list -l env=production
argocd app list -l 'app.kubernetes.io/instance notin (app1,app2)'
Output:
NAME            CLUSTER                         NAMESPACE  PROJECT  STATUS  HEALTH   SYNCPOLICY  CONDITIONS
guestbook       https://kubernetes.default.svc  default    default  Synced  Healthy  Auto-Prune  <none>
helm-guestbook  https://kubernetes.default.svc  default    default  Synced  Healthy  <none>      <none>

get

Get application details.
# Get application details
argocd app get my-app

# Get with YAML output
argocd app get my-app -o yaml

# Show application manifests
argocd app get my-app --show-manifests
Output:
Name:               my-app
Project:            default
Server:             https://kubernetes.default.svc
Namespace:          default
URL:                https://cd.example.com/applications/my-app
Repo:               https://github.com/example/repo.git
Target:             main
Path:               manifests
SyncWindow:         Sync Allowed
Sync Policy:        Automated (Prune)
Sync Status:        Synced to main (a1b2c3d)
Health Status:      Healthy

GROUP  KIND        NAMESPACE  NAME       STATUS  HEALTH   HOOK  MESSAGE
       Service     default    my-app-svc Synced  Healthy        service/my-app-svc created
apps   Deployment  default    my-app     Synced  Healthy        deployment.apps/my-app created

sync

Synchronize application to its target state.
# Sync a single application
argocd app sync my-app

# Sync multiple applications
argocd app sync app1 app2 app3
Key Flags:
--prune
boolean
Allow deleting unexpected resources
--dry-run
boolean
Preview apply without affecting cluster
--force
boolean
Use a force apply
--async
boolean
Do not wait for application to sync before continuing
--resource
string[]
Sync only specific resources as GROUP:KIND:NAME
--timeout
integer
Time out after this many seconds

diff

Perform a diff against the target and live state.
# Show differences
argocd app diff my-app

# Diff with local manifests
argocd app diff my-app --local ./manifests
Output:
===== apps/Deployment default/my-app ======
  spec:
    replicas: 2
-   image: myapp:v1.0.0
+   image: myapp:v1.0.1

set

Set application parameters.
# Set Helm parameters
argocd app set my-app -p image.tag=v2.0.0
argocd app set my-app -p replicas=3

# Set sync policy
argocd app set my-app --sync-policy automated

# Enable auto-prune
argocd app set my-app --auto-prune

# Set project
argocd app set my-app --project my-project

unset

Unset application parameters.
# Unset parameter
argocd app unset my-app -p image.tag

# Disable auto-prune
argocd app unset my-app --auto-prune

delete

Delete an application.
# Delete application (keeps resources)
argocd app delete my-app

# Delete application and cascade delete resources
argocd app delete my-app --cascade

# Force delete without confirmation
argocd app delete my-app --yes
Using --cascade will delete all Kubernetes resources managed by the application.

wait

Wait for application to reach a synced and healthy state.
# Wait for sync and health
argocd app wait my-app

# Wait with timeout
argocd app wait my-app --timeout 300

# Wait for health only
argocd app wait my-app --health

history

Show application deployment history.
# Show deployment history
argocd app history my-app

# Show with JSON output
argocd app history my-app -o json
Output:
ID  DATE                           REVISION
1   2024-01-15 10:30:00 +0000 UTC  main (a1b2c3d)
2   2024-01-15 11:45:00 +0000 UTC  main (d4e5f6g)
3   2024-01-15 14:20:00 +0000 UTC  main (g7h8i9j)

rollback

Rollback application to a previous deployed version.
# Rollback to previous version
argocd app rollback my-app

# Rollback to specific history ID
argocd app rollback my-app 2

# Rollback with prune
argocd app rollback my-app 2 --prune

manifests

Print manifests of an application.
# Print manifests
argocd app manifests my-app

# Save to file
argocd app manifests my-app > manifests.yaml

# Get specific revision
argocd app manifests my-app --revision v1.0.0

logs

Get logs of application pods.
# Get logs from all pods
argocd app logs my-app

# Follow logs
argocd app logs my-app --follow

# Filter by container
argocd app logs my-app --container nginx

# Get logs since timestamp
argocd app logs my-app --since 1h

resources

List resources of application.
# List all resources
argocd app resources my-app

# List with kind filter
argocd app resources my-app --kind Deployment

patch

Patch application specifications.
# Patch with JSON
argocd app patch my-app --patch '{"spec":{"source":{"targetRevision":"v2.0.0"}}}'

# Patch with file
argocd app patch my-app --patch-file patch.json

# Patch type
argocd app patch my-app --patch-type merge --patch '...'

edit

Edit application in default editor.
# Edit application
argocd app edit my-app
This opens the application manifest in your $EDITOR.

terminate-op

Terminate running operation of an application.
# Terminate sync operation
argocd app terminate-op my-app

Advanced Features

Multi-Source Applications

# Add additional source
argocd app add-source my-app \
  --repo https://github.com/example/values.git \
  --path values

# Remove source
argocd app remove-source my-app --source-name values

Resource Actions

# List available actions
argocd app actions list my-app --kind Deployment

# Run action
argocd app actions run my-app restart --kind Deployment

Resource Operations

# Get specific resource
argocd app get-resource my-app --kind Deployment --name my-app

# Delete specific resource
argocd app delete-resource my-app --kind ConfigMap --name my-config

# Patch resource
argocd app patch-resource my-app --kind Deployment --name my-app \
  --patch '{"spec":{"replicas":5}}'

Common Workflows

Deploy New Version

# Update image tag
argocd app set my-app -p image.tag=v2.0.0

# Preview changes
argocd app diff my-app

# Sync and watch
argocd app sync my-app
argocd app wait my-app --health

Emergency Rollback

# Check history
argocd app history my-app

# Rollback to last known good
argocd app rollback my-app 5

# Wait for health
argocd app wait my-app --health

Debug Application

# Get application status
argocd app get my-app

# Check diff
argocd app diff my-app

# Get resource details
argocd app resources my-app

# Check logs
argocd app logs my-app --follow

Next Steps

ApplicationSets

Manage ApplicationSets for multiple apps

Projects

Organize apps with projects