Argo CD CLI Basics – From Zero to Managing Apps
This document assumes:- Argo CD is already installed in the cluster
- You have
kubectlaccess - You are using the Argo CD CLI (
argocd)
1. Install Argo CD CLI
macOS
Linux
2. Access Argo CD Server
Most clusters expose Argo CD as ClusterIP, so you must port-forward.3. Get Initial Admin Password
4. Login Using Argo CD CLI
--insecure?
- Argo uses a self-signed cert by default.
- Without it, CLI login fails.
5. Repository Management (Git)
List repositories
Add a Git repository (HTTPS)
Add a Git repository (SSH – recommended)
- Private key has no passphrase (or provide one)
- Public key added to repo access keys in Git provider
- Repo URL must be SSH (
git@...)
Remove a repository
Get repository details
6. Application Basics
An Application = Git repo + path + cluster + namespace.List applications
Create an application (imperative)
--repo→ Git repository--path→ Folder inside repo--dest-server→ Target cluster--dest-namespace→ Target namespace--sync-policy automated→ Auto-sync (optional)
Create app without auto-sync (manual control)
7. Syncing Applications
Manual sync
Refresh app state (re-fetch Git)
- Repo credential changes
- Branch/tag changes
- Repo-server restarts
Force sync (dangerous but sometimes needed)
- Recreate resources
- Overwrite drift
- Potentially cause downtime
8. Application Inspection & Debugging
Get app details
View app history
Rollback to a previous revision
Delete an application
--cascade to delete cluster resources too:
9. Cluster Management
List clusters known to Argo CD
Add current cluster
10. Common Operational Commands
Restart repo-server (Git issues)
Restart application controller
Check Argo CD components
11. Mental Model (Important)
- Argo CD does not continuously validate repo auth
- “Connected” ≠ “Can fetch”
git fetchfailure = broken auth- SSH issues are almost always key placement or repo URL mistakes
- CLI errors > UI indicators
Strong Opinion (earned from pain)
If this is a real environment:- ✅ Use SSH deploy keys
- ✅ Use service accounts
- ❌ Avoid personal credentials
- ❌ Avoid trusting UI status
If you want next:
- ApplicationSet CLI usage
- Multi-env repo structure (dev/stage/prod)
- How Argo CD actually stores repo credentials (secrets)
- Hardening Argo CD for production
