Skill v1.0.1
currentAutomated scan100/100+1 new
version: "1.0.1" name: argocd description: Complete ArgoCD CLI and REST API skill for GitOps automation. Use when working with ArgoCD for: (1) Managing Applications - create, sync, delete, rollback, get status, wait for health, view logs, (2) ApplicationSets - templated multi-cluster deployments with generators, (3) Projects - RBAC, source/destination restrictions, sync windows, roles, (4) Repositories - add/remove Git repos, Helm charts, OCI registries, credential templates, (5) Clusters - register, rotate credentials, manage multi-cluster, (6) Accounts - generate tokens, manage users, check permissions, (7) Admin operations - export/import, settings validation, RBAC testing, notifications, (8) Troubleshooting - sync issues, health problems, connection errors. Supports both REST API (curl/HTTP) and CLI approaches with bearer token authentication.
ArgoCD Skill
Complete ArgoCD operations via REST API and CLI with bearer token authentication.
Authentication Setup
Generate and use bearer tokens for all operations:
# Generate token (requires existing login)argocd login $ARGOCD_SERVER --username admin --password $ARGOCD_PASSWORDARGOCD_TOKEN=$(argocd account generate-token)# Or generate for service accountARGOCD_TOKEN=$(argocd account generate-token --account cibot --expires-in 7d)# Export for subsequent commandsexport ARGOCD_SERVER="argocd.example.com"export ARGOCD_AUTH_TOKEN="$ARGOCD_TOKEN"
Service account setup (in argocd-cm ConfigMap):
data:accounts.cibot: apiKey,loginaccounts.cibot.enabled: "true"
REST API Pattern
All API calls use this pattern:
curl -s -H "Authorization: Bearer $ARGOCD_AUTH_TOKEN" \-H "Content-Type: application/json" \"https://$ARGOCD_SERVER/api/v1/{endpoint}"
Use the helper script at scripts/argocd-api.sh for common operations.
Quick Reference
Applications
# List all applicationsargocd app list -o json# Create applicationargocd app create myapp \--repo https://github.com/org/repo.git \--path manifests \--dest-server https://kubernetes.default.svc \--dest-namespace default \--sync-policy automated \--auto-prune \--self-heal# Sync with optionsargocd app sync myapp --prune --force --timeout 300# Sync specific resources onlyargocd app sync myapp --resource apps:Deployment:nginx# Dry runargocd app sync myapp --dry-run# Wait for healthargocd app wait myapp --health --sync --timeout 300# Get statusargocd app get myapp -o json | jq '{health: .status.health.status, sync: .status.sync.status}'# Rollbackargocd app history myappargocd app rollback myapp 2# Delete (cascade deletes resources)argocd app delete myapp --cascade -y# Terminate running operationargocd app terminate-op myapp
ApplicationSets
# Create/update ApplicationSetargocd appset create appset.yaml --upsert# Listargocd appset list# Get detailsargocd appset get myappset -o yaml# Deleteargocd appset delete myappset -y
Projects
# Create projectargocd proj create myproject -d https://kubernetes.default.svc,default -s https://github.com/org/*# Add destinations/sourcesargocd proj add-destination myproject https://kubernetes.default.svc 'team-*'argocd proj add-source myproject 'https://github.com/org/*'# Manage rolesargocd proj role create myproject deployerargocd proj role add-policy myproject deployer -a sync -p allow -o '*'argocd proj role add-group myproject deployer my-sso-group# Generate role tokenargocd proj role create-token myproject deployer --expires-in 24h# Sync windowsargocd proj windows add myproject \--kind allow --schedule "0 22 * * *" --duration 2hargocd proj windows list myproject
Repositories
# Add HTTPS repo with tokenargocd repo add https://github.com/org/repo --username git --password $GH_TOKEN# Add SSH repoargocd repo add git@github.com:org/repo.git --ssh-private-key-path ~/.ssh/id_rsa# Add Helm repoargocd repo add https://charts.example.com --type helm --name myrepo# Add OCI registryargocd repo add registry.example.com \--type helm --enable-oci --username user --password pass# Credential template (applies to matching repos)argocd repocreds add https://github.com/myorg/ --username git --password $TOKEN# List/removeargocd repo listargocd repo rm https://github.com/org/repo
Clusters
# Add cluster from kubeconfig contextargocd cluster add my-context --name production# List clustersargocd cluster list# Get cluster detailsargocd cluster get https://production.example.com# Rotate credentialsargocd cluster rotate-auth production# Remove clusterargocd cluster rm https://production.example.com
Accounts
# List accountsargocd account list# Generate tokenargocd account generate-token --account cibot --expires-in 7d --id deploy-token# Check permissionsargocd account can-i sync applications '*'argocd account can-i get applications 'myproject/*'# Update passwordargocd account update-password --account admin# Get user infoargocd account get-user-info
REST API Examples
See references/api-reference.md for complete endpoint documentation.
Create Application via API
curl -X POST -H "Authorization: Bearer $ARGOCD_AUTH_TOKEN" \-H "Content-Type: application/json" \"https://$ARGOCD_SERVER/api/v1/applications" \-d '{"metadata": {"name": "myapp", "namespace": "argocd"},"spec": {"project": "default","source": {"repoURL": "https://github.com/org/repo.git","path": "manifests","targetRevision": "HEAD"},"destination": {"server": "https://kubernetes.default.svc","namespace": "default"},"syncPolicy": {"automated": {"prune": true, "selfHeal": true},"syncOptions": ["CreateNamespace=true"]}}}'
Sync Application via API
curl -X POST -H "Authorization: Bearer $ARGOCD_AUTH_TOKEN" \-H "Content-Type: application/json" \"https://$ARGOCD_SERVER/api/v1/applications/myapp/sync" \-d '{"revision": "HEAD","prune": true,"dryRun": false,"strategy": {"hook": {}},"syncOptions": {"items": ["CreateNamespace=true"]}}'
Get Application Status
curl -s -H "Authorization: Bearer $ARGOCD_AUTH_TOKEN" \"https://$ARGOCD_SERVER/api/v1/applications/myapp" | \jq '{name: .metadata.name, health: .status.health.status, sync: .status.sync.status}'
Application Spec Reference
apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata:name: myappnamespace: argocdfinalizers:- resources-finalizer.argocd.argoproj.iospec:project: defaultsource:repoURL: https://github.com/org/repo.gittargetRevision: HEADpath: manifests# Helm optionshelm:releaseName: my-releasevalueFiles: [values.yaml, values-prod.yaml]parameters:- name: image.tagvalue: v1.0.0# Kustomize optionskustomize:namePrefix: prod-images: [gcr.io/image:v1.0.0]destination:server: https://kubernetes.default.svcnamespace: defaultsyncPolicy:automated:prune: trueselfHeal: truesyncOptions:- CreateNamespace=true- ServerSideApply=true- PruneLast=trueretry:limit: 5backoff:duration: 5sfactor: 2maxDuration: 3mignoreDifferences:- group: appskind: DeploymentjsonPointers: [/spec/replicas]
ApplicationSet Generators
See references/api-reference.md for complete generator patterns.
apiVersion: argoproj.io/v1alpha1kind: ApplicationSetmetadata:name: cluster-appsnamespace: argocdspec:generators:# List generator- list:elements:- cluster: devurl: https://dev.example.com- cluster: produrl: https://prod.example.com# Cluster generator- clusters:selector:matchLabels:environment: production# Git directory generator- git:repoURL: https://github.com/org/apps.gitdirectories:- path: apps/*# Matrix generator (combine two generators)- matrix:generators:- clusters: {}- git:repoURL: https://github.com/org/apps.gitdirectories: [{path: apps/*}]template:metadata:name: '{{.cluster}}-{{.path.basename}}'spec:project: defaultsource:repoURL: https://github.com/org/apps.gittargetRevision: HEADpath: '{{.path.path}}'destination:server: '{{.url}}'namespace: '{{.path.basename}}'
Sync Options Reference
| Option | Description | |
|---|---|---|
Prune=true | Delete resources not in Git | |
PruneLast=true | Prune after sync completes | |
Replace=true | Use replace instead of apply | |
ServerSideApply=true | Use server-side apply | |
CreateNamespace=true | Create namespace if missing | |
ApplyOutOfSyncOnly=true | Only sync changed resources | |
Validate=false | Skip kubectl validation | |
Force=true | Force resource replacement | |
RespectIgnoreDifferences=true | Respect ignoreDifferences on sync |
Resource Hooks and Waves
metadata:annotations:# Sync wave (lower = earlier)argocd.argoproj.io/sync-wave: "-1"# Hook phaseargocd.argoproj.io/hook: PreSync|Sync|PostSync|SyncFail|PostDelete# Hook deletion policyargocd.argoproj.io/hook-delete-policy: HookSucceeded|HookFailed|BeforeHookCreation
Health Status Values
| Status | Description | |
|---|---|---|
Healthy | Resource running correctly | |
Progressing | Deployment in progress | |
Degraded | Health check failed | |
Suspended | Resource paused | |
Missing | Resource doesn't exist | |
Unknown | Cannot determine health |
CLI Global Flags
| Flag | Description | |
|---|---|---|
--server | ArgoCD server address | |
--auth-token | Bearer token | |
--grpc-web | Use gRPC-web (for proxies) | |
--insecure | Skip TLS verification | |
--plaintext | Disable TLS | |
--config | Config file path | |
-o json/yaml/wide | Output format |
Error Handling
# Check if app exists before operationsif argocd app get myapp &>/dev/null; thenargocd app sync myappelseargocd app create myapp ...fi# Wait with timeout and handle failureif ! argocd app wait myapp --health --timeout 300; thenecho "App failed to become healthy"argocd app get myappexit 1fi# Idempotent upsert patternargocd app create myapp --upsert ...argocd repo add https://repo --upsert ...
Common Workflows
Deploy and Wait Pattern
argocd app sync myapp --prune --asyncargocd app wait myapp --health --sync --timeout 300
Canary/Blue-Green with Argo Rollouts
# Promote rolloutargocd app actions run myapp promote --kind Rollout --resource-name my-rollout
Multi-Cluster Deployment
# Register clustersargocd cluster add dev-context --name devargocd cluster add prod-context --name prod# Use ApplicationSet with cluster generator
Admin Operations
# Get initial admin passwordargocd admin initial-password -n argocd# Export all resources for backupargocd admin export > backup.yaml# Import from backupargocd admin import < backup.yaml# Start local dashboard (core mode)argocd admin dashboard# Validate RBAC policyargocd admin settings rbac validate --policy-file policy.csv# Test RBAC permissionargocd admin settings rbac can role:developer sync applications 'myproject/*'# Notification managementargocd admin notifications template listargocd admin notifications trigger list
Troubleshooting Quick Reference
# Check diff for out-of-sync appsargocd app diff myapp# Force refresh from Gitargocd app get myapp --hard-refresh# View detailed sync operationargocd app get myapp --show-operation# Check application conditionsargocd app get myapp -o json | jq '.status.conditions'# Terminate stuck syncargocd app terminate-op myapp# Check controller logskubectl logs -n argocd -l app.kubernetes.io/name=argocd-application-controller --tail=100# Apps not healthyargocd app list -o json | \jq -r '.items[] | select(.status.health.status != "Healthy") | .metadata.name'# Apps out of syncargocd app list -o json | \jq -r '.items[] | select(.status.sync.status != "Synced") | .metadata.name'
For complete API endpoint documentation, see references/api-reference.md. For complete CLI command reference, see references/cli-reference.md. For troubleshooting guide, see references/troubleshooting.md.
Absorbed sub-skills (post-consolidation)
This skill now subsumes the former argocd-command and argocd-review skills. Their original SKILL.md content (still useful as deep reference) lives under References/:
| Subject | Path | |
|---|---|---|
| Local cluster context (kubeconfig, port-forward, aliases) | References/command-workflows/ + References/command-tools/ | |
| Application review, diff, rollback, history, sync troubleshooting | References/review.md + References/review-workflows/ + References/review-tools/ |
For multi-cluster ApplicationSets, Image Updater, cluster bootstrapping, and workload onboarding, see the sibling `argocd-advanced` skill. For canary / blue-green / promotion, see `progressive-delivery`.
Gotchas
- `OutOfSync` with empty diff: Usually a Helm chart
releaseNamechange or kustomize hash mismatch after a CRD upgrade.argocd app diffshows nothing — runargocd app manifeststo see the rendered output. - `ignoreDifferences` silently ignored under SSA: With Server-Side Diff enabled, schema-validation errors on unknown fields (e.g. Job
podReplacementPolicyon K8s 1.29+) fire before ignoreDifferences runs. Disable SSA per-app viaargocd.argoproj.io/compare-options: ServerSideDiff=false. - `--cascade` deletes the namespace too if you created it via
CreateNamespace=true. Use--cascade=falseto detach the Application while keeping workloads. - Tokens cannot be revoked individually — only by deleting the account or rotating the JWT signing key. Always pass
--idtogenerate-tokenso you can audit which token is which. - `argocd app sync` on an automated-sync app is a no-op if the controller already attempted a sync this poll cycle. Add
--forceor temporarily disable auto-sync to push through. - `finalizers: [resources-finalizer.argocd.argoproj.io]` is required for cascade delete to actually remove cluster resources. Without it, deleting the Application orphans everything in the destination namespace.