ArgoCD CLI Cheat Sheet

Step 1: Login to ArgoCD
argocd login <ARGOCD_SERVER> --username admin --password <password>
Explanation: Authenticate to the ArgoCD API server.
Example:
argocd login argocd.example.com --username admin --password admin123
2. Create a New App
argocd app create <APP_NAME> \
--repo <GIT_REPO_URL> \
--path <APP_PATH> \
--dest-server https://kubernetes.default.svc \
--dest-namespace <NAMESPACE>
Explanation: Register a new Kubernetes app from a Git repo.
Example:
argocd app create guestbook \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace default
3. Deploy (Sync) the App
argocd app sync <APP_NAME>
- Explanation: Sync the app state from Git to the Kubernetes cluster.
- Example:
argocd app sync guestbook
4. Refresh Git Repo State
argocd app refresh <APP_NAME>
Explanation: Force ArgoCD to re-check the Git repo for changes.
Example:
argocd app refresh guestbook
5. View App Status
argocd app get <APP_NAME>
Explanation: Displays current state, health, and sync status.
Example:
argocd app get guestbook
6. List All Applications
argocd app list
7. Check Application Logs (from UI)
kubectl logs -n argocd deploy/argocd-server