ArgoCD CLI reference for GitOps continuous delivery. Use when asked to deploy apps, sync manifests, check sync status, configure repos, rollback deployments...
# Add ArgoCD Helm repo
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
# Create namespace
kubectl create namespace argocd
# Install with project values
helm install argocd argo/argo-cd \
--namespace argocd \
--values deploy/helm/argocd/values.yaml \
--wait --timeout 10m
# Verify installation
kubectl get pods -n argocd
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=argocd-server -n argocd --timeout=300s
# Get auto-generated admin password
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -d; echo
# Login via CLI
argocd login argocd.${DNS_ZONE_NAME} --username admin --password <password>
# Apply repository credentials from manifests
kubectl apply -f argocd/repo-credentials.yaml
# Or add via CLI
argocd repo add https://github.com/${GITHUB_ORG}/three-horizons-accelerator-v4.git \
--username <username> --password <github-token>
# Verify
argocd repo list
# Apply root application (bootstraps all child apps)
kubectl apply -f argocd/app-of-apps/root-application.yaml
# Apply sync policies
kubectl apply -f argocd/sync-policies.yaml
# Verify apps are created
argocd app list
# Apply cluster secret store
kubectl apply -f argocd/secrets/cluster-secret-store.yaml
# Deploy External Secrets app
kubectl apply -f argocd/apps/external-secrets.yaml
# Deploy Gatekeeper
kubectl apply -f argocd/apps/gatekeeper.yaml
# Login to ArgoCD
argocd login <ARGOCD_SERVER> --username admin --password <password>
# Current context
argocd context
# List applications
argocd app list
# Get application status
argocd app get <app-name>
# Show application diff (ALWAYS do before sync)
argocd app diff <app-name>
# Sync application
argocd app sync <app-name>
# Sync with prune (careful in production)
argocd app sync <app-name> --prune
# Hard refresh
argocd app get <app-name> --hard-refresh
# Application health
argocd app get <app-name> -o json | jq '.status.health.status'
# Sync status
argocd app get <app-name> -o json | jq '.status.sync.status'
# Resources status
argocd app resources <app-name>
# Check ArgoCD server logs
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-server --tail=100
# Check application controller logs
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-application-controller --tail=100
# Check repo server logs
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-repo-server --tail=100
# Force sync
argocd app sync <app-name> --force
# Check events
kubectl get events -n argocd --sort-by='.lastTimestamp'
deploy/helm/argocd/values.yamlargocd/app-of-apps/root-application.yamlargocd/sync-policies.yamlargocd/repo-credentials.yamlargocd/secrets/cluster-secret-store.yamlterraform/modules/argocd/Used by: @devops, @sre