Skip to content
Latchkey

argocd app sync Command Reference

Sync an Argo CD application to reconcile the cluster with Git.

argocd app sync tells Argo CD to apply the desired state from Git to the cluster for an application. In CI it makes a GitOps deploy deterministic by triggering and awaiting the sync.

What it does

argocd app sync reconciles an applications live cluster state with its Git source: it applies manifests, optionally prunes removed resources, and can wait until the app reports Healthy and Synced. It turns the GitOps loop into an explicit pipeline step.

Common flags and usage

  • APP_NAME: the application to sync (required)
  • --prune: delete resources no longer defined in Git
  • --timeout SECONDS: fail if the sync does not finish in time
  • --revision REF: sync to a specific Git revision
  • --grpc-web: use gRPC-Web through ingress proxies
  • authenticate with argocd login or --auth-token

Example

shell
- name: Argo CD sync
  env:
    ARGOCD_SERVER: argocd.internal:443
  run: |
    argocd app sync my-app \
      --auth-token "${{ secrets.ARGOCD_AUTH_TOKEN }}" \
      --revision "${{ github.sha }}" \
      --prune --grpc-web
    argocd app wait my-app --health --grpc-web \
      --auth-token "${{ secrets.ARGOCD_AUTH_TOKEN }}"

In CI

Authenticate with --auth-token from secrets (or argocd login) and pass --grpc-web when the server is behind an ingress. Pin --revision to the deployed commit, then follow with argocd app wait --health so the job only passes once the rollout is actually healthy.

Key takeaways

  • argocd app sync reconciles a cluster with its Git source on demand.
  • Use --auth-token from secrets and --grpc-web behind an ingress.
  • Follow sync with argocd app wait --health so CI gates on real readiness.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →