mcpField
A
argocd-cli

argocd-cli

github.com/oldwinterCloud & DevOps1050 installsUpdated 1w ago
Repository

About argocd-cli

argocd-cli is a skill for managing GitOps deployments with the ArgoCD CLI, aimed at operators responsible for application delivery and cluster state. It documents commands for syncing, status checks, rollbacks, diffs, and resource operations.

Key features

  1. 01Inspect sync and health status
  2. 02Sync applications and selected resources
  3. 03Refresh application state
  4. 04Review diffs and deployment history
  5. 05Roll back to a chosen revision
  6. 06Inspect resources and pod logs

Use cases

  1. 01Check whether an app matches Git state
  2. 02Deploy the latest changes from Git
  3. 03Investigate sync errors or unhealthy status
  4. 04Restore an application to an earlier revision

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oldwinter/skills --skill argocd-cli

After installing, type/argocd-cliin Claude Code to confirm it loaded.

Details

From the project README

ArgoCD CLI Skill

This skill enables GitOps deployment management using ArgoCD CLI.

Environment

Connection
  • Server: 192.168.10.117:31006
  • Web UI: http://192.168.10.117:31006
  • Credentials: admin / CpfsoneT7ogVKWOh
Login Command

If token expires, re-authenticate:

yes | argocd login 192.168.10.117:31006 --username admin --password CpfsoneT7ogVKWOh --insecure
Applications Overview
ApplicationClusterNamespaceEnvironment
simplex-k1-prodAWS EKSproduction生产环境
simplex-k2-stagingAWS EKSstaging预发布环境
simplex-localK3ssimplex本地开发
simplex-local-infraK3scommon本地基础设施

Common Operations

Application Status
# List all applications
argocd app list

# Get specific application status
argocd app get argocd/simplex-k1-prod
argocd app get argocd/simplex-k2-staging
argocd app get argocd/simplex-local

# Get application in JSON format
argocd app get argocd/simplex-k1-prod -o json

# Get application in YAML format
argocd app get argocd/simplex-k1-prod -o yaml
Sync Operations
# Sync application (deploy latest from git)
argocd app sync argocd/simplex-k1-prod

# Sync with prune (remove resources not in git)
argocd app sync argocd/simplex-k1-prod --prune

# Sync specific resources only
argocd app sync argocd/simplex-k1-prod --resource apps:Deployment:simplex-api

# Sync with force (replace resources)
argocd app sync argocd/simplex-k1-prod --force

# Sync and wait for completion
argocd app sync argocd/simplex-k1-prod --timeout 300

# Dry run sync (preview changes)
argocd app sync argocd/simplex-k1-prod --dry-run
Refresh
# Refresh application (re-read from git)
argocd app get argocd/simplex-k1-prod --refresh

# Hard refresh (clear cache and re-read)
argocd app get argocd/simplex-k1-prod --hard-refresh
Rollback
# View deployment history
argocd app history argocd/simplex-k1-prod

# Rollback to specific revision
argocd app rollback argocd/simplex-k1-prod <revision-id>

# Example: rollback to revision 5
argocd app rollback argocd/simplex-k1-prod 5
Diff and Comparison
# Show diff between live and desired state
argocd app diff argocd/simplex-k1-prod

# Show diff with local manifests
argocd app diff argocd/simplex-k1-prod --local /path/to/manifests
Resource Management
# List application resources
argocd app resources argocd/simplex-k1-prod

# Get logs from application pods
argocd app logs argocd/simplex-k1-prod

# Follow logs
argocd app logs argocd/simplex-k1-prod --follow

# Logs from specific container
argocd app logs argocd/simplex-k1-prod --container simplex-api

# Delete specific resource
argocd app delete-resource argocd/simplex-k1-prod --kind Deployment --resource-name simplex-api
Application Management
# Create new application
argocd app create <name> \
  --repo ssh://[email protected]:2222/simplexai/infra/simplex-gitops.git \
  --path kubernetes/overlays/<env> \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace <namespace>

# Delete application
argocd app delete argocd/<app-name>

# Set application parameters
argocd app set argocd/simplex-k1-prod --parameter key=value
Project Management
# List projects
argocd proj list

# Get project details
argocd proj get simplex

# List project roles
argocd proj role list simplex

Status Interpretation

Sync Status
StatusMeaning
SyncedLive state matches desired state in git
OutOfSyncLive state differs from git
UnknownUnable to determine sync status
Health Status
StatusMeaning
HealthyAll resources are healthy
ProgressingResources are being updated
DegradedOne or more resources are unhealthy
SuspendedResources are suspended
MissingResources don't exist
UnknownHealth status unknown

Output Formatting

Status Summary
📊 ArgoCD Application Status

┌─────────────────────┬──────────┬───────────┬─────────────────┐
│ Application         │ Sync     │ Health    │ Last Sync       │
├─────────────────────┼──────────┼───────────┼─────────────────┤
│ simplex-k1-prod     │ Synced   │ Healthy   │ 2h ago          │
│ simplex-k2-staging  │ Synced   │ Healthy   │ 1h ago          │
│ simplex-local       │ OutOfSync│ Degraded  │ 30m ago         │
└─────────────────────┴──────────┴───────────┴─────────────────┘

Troubleshooting

Application Not Syncing
  1. Check sync status: argocd app get argocd/<app>
  2. Check for sync errors in conditions
  3. Hard refresh: argocd app get argocd/<app> --hard-refresh
  4. Check git repository access
ComparisonError

Usually indicates:

  • Git repository access issues
  • Invalid manifests in git
  • Kustomize/Helm rendering errors

Resolution:

# Hard refresh to clear cache
argocd app get argocd/<app> --hard-refresh

# Check app details for error message
argocd app get argocd/<app>
Authentication Expired
# Re-login
yes | argocd login 192.168.10.117:31006 --username admin --password CpfsoneT7ogVKWOh --insecure

Integration with Kargo

ArgoCD applications are managed by Kargo for progressive delivery:

  • Kargo Warehouse detects new images in ECR
  • Kargo Stages promote freights through environments
  • ArgoCD syncs the changes to clusters

Kargo-managed applications have annotation:

kargo.akuity.io/authorized-stage: kargo-simplex:prod

For progressive delivery operations, use the Kargo CLI skill.

Comments

Markdown supported