> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/argoproj/argo-cd/llms.txt
> Use this file to discover all available pages before exploring further.

# argocd app

> Manage Argo CD applications from the command line

The `argocd app` command provides comprehensive application management capabilities including creation, synchronization, deletion, and monitoring.

## Quick Examples

```bash theme={null}
# 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.

<Tabs>
  <Tab title="Git Repository">
    Create from a Git repository:

    ```bash theme={null}
    argocd app create guestbook \
      --repo https://github.com/argoproj/argocd-example-apps.git \
      --path guestbook \
      --dest-namespace default \
      --dest-server https://kubernetes.default.svc
    ```
  </Tab>

  <Tab title="Helm Chart">
    Create a Helm application:

    ```bash theme={null}
    argocd app create nginx-ingress \
      --repo https://charts.helm.sh/stable \
      --helm-chart nginx-ingress \
      --revision 1.24.3 \
      --dest-namespace default \
      --dest-server https://kubernetes.default.svc \
      --helm-set replicaCount=2
    ```
  </Tab>

  <Tab title="Kustomize">
    Create a Kustomize application:

    ```bash theme={null}
    argocd app create kustomize-app \
      --repo https://github.com/argoproj/argocd-example-apps.git \
      --path kustomize-guestbook \
      --dest-namespace default \
      --dest-server https://kubernetes.default.svc \
      --kustomize-image quay.io/argoprojlabs/argocd-e2e-container:0.1
    ```
  </Tab>

  <Tab title="Auto-Sync">
    Create with automatic synchronization:

    ```bash theme={null}
    argocd app create my-app \
      --repo https://github.com/example/repo.git \
      --path manifests \
      --dest-namespace default \
      --dest-server https://kubernetes.default.svc \
      --sync-policy automated \
      --auto-prune \
      --self-heal
    ```
  </Tab>
</Tabs>

**Key Flags:**

<ParamField path="--repo" type="string" required>
  Repository URL
</ParamField>

<ParamField path="--path" type="string" required>
  Path in repository to the app directory
</ParamField>

<ParamField path="--dest-namespace" type="string" required>
  Kubernetes target namespace
</ParamField>

<ParamField path="--dest-server" type="string" required>
  Kubernetes cluster URL (e.g., [https://kubernetes.default.svc](https://kubernetes.default.svc))
</ParamField>

<ParamField path="--sync-policy" type="string">
  Set sync policy: `manual`, `automated`, `auto`, or `automatic`
</ParamField>

<ParamField path="--auto-prune" type="boolean">
  Automatically prune resources no longer defined in Git
</ParamField>

<ParamField path="--self-heal" type="boolean">
  Automatically sync when cluster state deviates from Git
</ParamField>

### list

List all applications.

```bash theme={null}
# 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.

```bash theme={null}
# 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.

<Tabs>
  <Tab title="Basic Sync">
    ```bash theme={null}
    # Sync a single application
    argocd app sync my-app

    # Sync multiple applications
    argocd app sync app1 app2 app3
    ```
  </Tab>

  <Tab title="By Label">
    ```bash theme={null}
    # Sync apps by label
    argocd app sync -l app.kubernetes.io/instance=my-app
    argocd app sync -l env=production
    argocd app sync -l '!maintenance'
    ```
  </Tab>

  <Tab title="Specific Resources">
    ```bash theme={null}
    # Sync specific resources
    argocd app sync my-app --resource :Service:my-service
    argocd app sync my-app --resource argoproj.io:Rollout:my-rollout
    argocd app sync my-app --resource apps:Deployment:my-app
    ```
  </Tab>

  <Tab title="With Options">
    ```bash theme={null}
    # Dry run
    argocd app sync my-app --dry-run

    # Force sync
    argocd app sync my-app --force

    # Prune resources
    argocd app sync my-app --prune

    # Preview changes before sync
    argocd app sync my-app --preview-changes
    ```
  </Tab>
</Tabs>

**Key Flags:**

<ParamField path="--prune" type="boolean">
  Allow deleting unexpected resources
</ParamField>

<ParamField path="--dry-run" type="boolean">
  Preview apply without affecting cluster
</ParamField>

<ParamField path="--force" type="boolean">
  Use a force apply
</ParamField>

<ParamField path="--async" type="boolean">
  Do not wait for application to sync before continuing
</ParamField>

<ParamField path="--resource" type="string[]">
  Sync only specific resources as GROUP:KIND:NAME
</ParamField>

<ParamField path="--timeout" type="integer">
  Time out after this many seconds
</ParamField>

### diff

Perform a diff against the target and live state.

```bash theme={null}
# 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.

```bash theme={null}
# 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.

```bash theme={null}
# Unset parameter
argocd app unset my-app -p image.tag

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

### delete

Delete an application.

```bash theme={null}
# 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
```

<Warning>
  Using `--cascade` will delete all Kubernetes resources managed by the application.
</Warning>

### wait

Wait for application to reach a synced and healthy state.

```bash theme={null}
# 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.

```bash theme={null}
# 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.

```bash theme={null}
# 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.

```bash theme={null}
# 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.

```bash theme={null}
# 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.

```bash theme={null}
# List all resources
argocd app resources my-app

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

### patch

Patch application specifications.

```bash theme={null}
# 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.

```bash theme={null}
# Edit application
argocd app edit my-app
```

This opens the application manifest in your `$EDITOR`.

### terminate-op

Terminate running operation of an application.

```bash theme={null}
# Terminate sync operation
argocd app terminate-op my-app
```

## Advanced Features

### Multi-Source Applications

```bash theme={null}
# 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

```bash theme={null}
# List available actions
argocd app actions list my-app --kind Deployment

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

### Resource Operations

```bash theme={null}
# 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

```bash theme={null}
# 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

```bash theme={null}
# 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

```bash theme={null}
# 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

<CardGroup cols={2}>
  <Card title="ApplicationSets" icon="layer-group" href="/cli/appset">
    Manage ApplicationSets for multiple apps
  </Card>

  <Card title="Projects" icon="folder" href="/cli/project">
    Organize apps with projects
  </Card>
</CardGroup>
