Kubernetes
Argo CD CLI
Argo CD CLI commands for GitOps continuous deployment.
31 commands
Windows
MacOS
Linux
#gitops
#deployment
Application Management
argocd app create myapp --repo https://github.com/org/repo.git --path k8s --dest-server https://kubernetes.default.svc --dest-namespace default # Create application
List all applications
argocd app list
Show application details and status
argocd app get myapp
Delete an application
argocd app delete myapp
argocd app set myapp --parameter image.tag=v2 # Update application parameter
Show application deployment history
argocd app history myapp
Sync
Sync application to target state
argocd app sync myapp
Sync and remove resources not in Git
argocd app sync myapp --prune
Force sync even if already synced
argocd app sync myapp --force
Preview sync without applying changes
argocd app sync myapp --dry-run
Wait for application to be healthy
argocd app wait myapp
Sync to latest commit
argocd app sync myapp --revision HEAD
Repository
argocd repo add https://github.com/org/repo.git --username user --password pass # Add Git repository
argocd repo add https://github.com/org/repo.git --ssh-private-key-path ~/.ssh/id_rsa # Add repo with SSH key
List configured repositories
argocd repo list
argocd repo rm https://github.com/org/repo.git # Remove a repository
argocd repocreds add https://github.com/org --username user --password token # Add repository credentials template
Project
Create a new project
argocd proj create myproject
List all projects
argocd proj list
Show project details
argocd proj get myproject
argocd proj add-destination myproject https://kubernetes.default.svc default # Add allowed destination
argocd proj add-source myproject https://github.com/org/repo.git # Add allowed source repo
Delete a project
argocd proj delete myproject
Account
Login to Argo CD server
argocd login argocd.example.com
List all accounts
argocd account list
Update current account password
argocd account update-password
Show current user information
argocd account get-user-info
argocd account generate-token --account myaccount # Generate API token for account
Quick Commands
Sync application to target state from Git
argocd app sync myapp
Create a new Argo CD application
argocd app create myapp --repo https://github.com/org/repo.git --path k8s --dest-server https://kubernetes.default.svc --dest-namespace default
Login to Argo CD server
argocd login argocd.example.com