mcpField
A
ArgoCdCommand

ArgoCdCommand

github.com/julianobarbosa云与 DevOps1451 次安装2 天前更新
代码仓库

关于 ArgoCdCommand

用于管理 `cafehyna-hub` 集群中 ArgoCD 的命令行交互技能。它将请求路由到应用、ApplicationSet、集群、仓库、项目、登录和故障排查工作流,并支持生产环境及端口转发连接。

主要功能

  1. 01ArgoCD 登录指引
  2. 02应用与 ApplicationSet 管理
  3. 03集群、仓库和项目操作
  4. 04故障排查与日志工作流
  5. 05生产环境和端口转发连接

适用场景

  1. 01同步 ArgoCD 应用
  2. 02创建 ApplicationSet
  3. 03查看应用日志
  4. 04向 ArgoCD 注册集群

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/julianobarbosa/claude-code-skills --skill argocdcommand

安装后在 Claude Code 中输入/argocdcommand确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

Tools/
ArgoCdCli.ts
Workflows/
AppManage.md
AppSetManage.md
ClusterManage.md
Login.md
ProjectManage.md
RepoManage.md
Troubleshoot.md

详细介绍

ArgoCdCommand

适用于 cafehyna-hub 集群的完整 ArgoCD CLI 交互技能,可通过 argocd.cafehyna.com.br 或端口转发 localhost:8080 进行访问。

集群配置

设置值
Kubeconfig~/.kube/aks-rg-hypera-cafehyna-hub-config
ArgoCD Serverargocd.cafehyna.com.br
ArgoCD Namespaceargocd
端口转发localhost:8080
环境设置
# Set kubeconfig for cafehyna-hub
export KUBECONFIG=~/.kube/aks-rg-hypera-cafehyna-hub-config

# Or use --kubeconfig flag
kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config get pods -n argocd
别名(推荐)
# Add to ~/.bashrc or ~/.zshrc
alias k-hub='kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config'
alias argocd-hub='KUBECONFIG=~/.kube/aks-rg-hypera-cafehyna-hub-config argocd'

连接模式

模式服务使用场景
生产环境argocd.cafehyna.com.br直接访问 ArgoCD
端口转发localhost:8080本地开发/调试

工作流路由

工作流触发语句文件
登录"login to argocd", "authenticate"Workflows/Login.md
应用管理"create app", "delete app", "sync app", "app status"Workflows/AppManage.md
应用集管理"create applicationset", "appset", "generate apps"Workflows/AppSetManage.md
集群管理"add cluster", "list clusters", "remove cluster"Workflows/ClusterManage.md
仓库管理"add repo", "list repos", "remove repository"Workflows/RepoManage.md
项目管理"create project", "list projects", "project settings"Workflows/ProjectManage.md
故障排查"app logs", "diff", "rollback", "history"Workflows/Troubleshoot.md

快速参考

身份验证
# Login to production (with kubeconfig set)
export KUBECONFIG=~/.kube/aks-rg-hypera-cafehyna-hub-config
argocd login argocd.cafehyna.com.br --sso

# Login via port-forward
kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config port-forward svc/argocd-server -n argocd 8080:443 &
argocd login localhost:8080 --insecure
常见操作
# List applications
argocd app list

# Sync application
argocd app sync <app-name>

# Get app details
argocd app get <app-name>

# List applicationsets
argocd appset list
kubectl 命令(cafehyna-hub)
# Get ArgoCD pods
kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config get pods -n argocd

# Get applications (CRD)
kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config get applications -n argocd

# Get applicationsets (CRD)
kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config get applicationsets -n argocd

# Get ArgoCD server logs
kubectl --kubeconfig ~/.kube/aks-rg-hypera-cafehyna-hub-config logs -n argocd -l app.kubernetes.io/name=argocd-server -f

工具

工具用途文件
ArgoCdCli执行 argocd 命令并处理连接Tools/ArgoCdCli.ts

示例

示例 1:同步应用

User: "Sync the grafana application in ArgoCD"
→ Invokes AppManage workflow
→ Runs: argocd app sync grafana
→ Reports sync status and health

示例 2:创建 ApplicationSet

User: "Create an applicationset for the monitoring stack"
→ Invokes AppSetManage workflow
→ Guides through appset creation with multi-source pattern
→ Applies via: argocd appset create -f appset.yaml

示例 3:查看应用日志

User: "Show me logs for the failing defectdojo app"
→ Invokes Troubleshoot workflow
→ Runs: argocd app logs defectdojo --follow
→ Displays pod logs for debugging

示例 4:添加新集群

User: "Register the new dev cluster with ArgoCD"
→ Invokes ClusterManage workflow
→ Runs: argocd cluster add <context-name>
→ Confirms cluster registration

评论

支持 Markdown