argocd - Argo CD command line (v3.5)
argocd [login|app|proj|repo|cluster|admin] ...
Options you will use
login argocd.lab --username admin [--password P] / login --core- Log in to the API server (password: argocd admin initial-password -n argocd), or use the Kubernetes API directly.
app list [-o wide]- Applications with sync status, health, sync policy and conditions.
app get APP [--refresh|--hard-refresh] [--show-operation]- Summary, conditions and every resource. --refresh re-renders git now instead of waiting up to 3 minutes.
app create APP --repo URL --path P --dest-server S --dest-namespace NS [--sync-policy automated --auto-prune --self-heal] [--sync-option CreateNamespace=true] | -f app.yaml- Create an Application.
app set APP --sync-policy automated|none [--self-heal[=false]] [--auto-prune] [--revision R] [--path P]- Change an Application.
app diff APP [--revision R]- Live (<) vs git (>) per resource; exit 1 when there are differences.
app sync APP [--prune] [--resource G:K:NAME] [--dry-run]- Apply git now: hooks, waves, prune; prints each resource's result.
app wait APP [--sync] [--health] [--timeout N]- Block until Synced / Healthy.
app history APP / app rollback APP [ID]- Deployed revisions by ID; rollback re-applies one (refused while auto-sync is on).
app manifests APP [--source live|git] / app resources APP- The rendered manifests; the tracked resources (and orphans).
app terminate-op APP / app delete APP [--cascade=false]- Stop a running sync; delete an app (cascading by default).
proj list / proj get P- AppProjects: allowed repos, destinations and cluster resources.
--server ADDRESS- Argo CD server address.
--grpc-web- Enables gRPC-web protocol. Useful if Argo CD server is behind a proxy which does not support HTTP2.
--insecure- Skip server certificate and domain verification.
--plaintext- Disable TLS.
--core- If set to true then CLI talks directly to Kubernetes instead of talking to Argo CD API server.
--auth-token TOKEN- Authentication token; set this or the ARGOCD_AUTH_TOKEN environment variable.
--config PATH- Path to Argo CD config (default ~/.config/argocd/config).
--port-forward- Connect to a random argocd-server port using port forwarding.
--port-forward-namespace NS- Namespace name which should be used for port forwarding.
--kube-context CONTEXT- Directs the command to the given kube-context.
--loglevel LEVEL- Set the logging level. One of: debug|info|warn|error (default "info").
Examples
$ argocd app get payments-prod --refreshWhat does git say now, and what is live?
$ argocd app diff payments-prodWhy is it OutOfSync: the exact fields.
$ argocd app set payments-prod --self-heal=falseBreak-glass only - and turn it back on in the same incident.
Gotchas
- Sync status (Synced/OutOfSync/Unknown) compares git with the cluster; health (Healthy/Progressing/Degraded/Missing/Suspended) says whether it works. Read both.
- Argo CD compares the fields git declares; mutating webhooks and controllers that rewrite them cause OutOfSync-forever - fix git or use ignoreDifferences + RespectIgnoreDifferences=true.
- Resources are tracked by the annotation argocd.argoproj.io/tracking-id.
Try argocd in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.