Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问许可证需确认审计异常

argocdargocd 命令行

Agent Skill

argocd 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

196

周安装

8

GitHub Stars

公开资料未说明

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:argocd(argocd 命令行)
来源仓库:https://github.com/kaynetik/skills
仓库路径:skills/argocd
安装命令:
npx skills add https://github.com/kaynetik/skills --skill argocd
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kaynetik/skills --skill argocd

简介

argocd 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 提供 ArgoCD 架构概览,包括 API Server、Repository Server、Application Controller 等核心组件说明。
  • 支持 Kubernetes 应用的 GitOps 部署管理,涵盖多集群、多项目和应用集配置。
  • 安装命令为 npx skills add https://github.com/kaynetik/skills --skill argocd。
  • 涉及 K8s 资源操作,需确认 kubeconfig 和环境权限,避免误操作生产集群。

SKILL.md

ArgoCD

Architecture

argocd (namespace)
  api-server                -- UI / CLI / API gateway
  repo-server               -- Git interaction, manifest rendering
  application-controller    -- K8s reconciliation loop
  applicationset-controller -- ApplicationSet reconciliation
  redis                     -- caching
  dex                       -- SSO / OIDC

Application (single source)

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: myapp
  namespace: argocd
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  project: production
  source:
    repoURL: https://github.com/myorg/myapp
    targetRevision: main
    path: k8s/overlays/production
  destination:
    server: https://kubernetes.default.svc
    namespace: production
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
      allowEmpty: false
    syncOptions:
    - CreateNamespace=true
    - ServerSideApply=true
    - ApplyOutOfSyncOnly=true
    retry:
      limit: 5
      backoff:
        duration: 5s
        factor: 2
        maxDuration: 3m

Helm source

source:
  repoURL: https://github.com/myorg/helm-charts
  targetRevision: main
  path: charts/myapp
  helm:
    releaseName: myapp
    valueFiles:
    - values.yaml
    - values-production.yaml
    parameters:
    - name: image.tag
      value: "v2.0.0"

Kustomize source

source:
  repoURL: https://github.com/myorg/myapp
  targetRevision: main
  path: k8s/overlays/production
  kustomize:
    images:
    - myregistry.io/myapp:v2.0.0
    commonLabels:
      environment: production

Application (multi-source)

Use spec.sources (plural) to combine manifests from multiple repositories -- for example, a Helm chart from one repo with environment-specific values from another.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: billing-app
  namespace: argocd
spec:
  project: default
  destination:
    server: https://kubernetes.default.svc
    namespace: billing
  sources:
  - repoURL: https://github.com/myorg/helm-charts
    targetRevision: v3.2.0
    path: charts/billing
    helm:
      valueFiles:
      - $values/envs/production/values.yaml
  - repoURL: https://github.com/myorg/config
    targetRevision: main
    ref: values

The ref: values entry makes that repo accessible as $values in valueFiles paths. spec.sources replaces spec.source -- they are mutually exclusive.

AppProject

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: production
  namespace: argocd
spec:
  sourceRepos:
  - https://github.com/myorg/*
  destinations:
  - namespace: production
    server: https://kubernetes.default.svc
  clusterResourceWhitelist:
  - group: '*'
    kind: '*'
  roles:
  - name: developer
    policies:
    - p, proj:production:developer, applications, sync, production/*, allow
    - p, proj:production:developer, applications, get, production/*, allow
    groups:
    - developers
  syncWindows:
  - kind: allow
    schedule: '0 9 * * 1-5'
    duration: 8h
    applications:
    - '*'
  orphanedResources:
    warn: true

ApplicationSet generators

Enable Go templates with goTemplate: true and goTemplateOptions: ["missingkey=error"] (recommended). Go template syntax uses {{.field}} instead of the legacy {{field}} fasttemplate syntax.

Git (directory per environment)

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: myapp-envs
  namespace: argocd
spec:
  goTemplate: true
  goTemplateOptions: ["missingkey=error"]
  generators:
  - git:
      repoURL: https://github.com/myorg/myapp
      revision: main
      directories:
      - path: k8s/overlays/*
  template:
    metadata:
      name: 'myapp-{{.path.basename}}'
    spec:
      project: production
      source:
        repoURL: https://github.com/myorg/myapp
        targetRevision: main
        path: '{{.path.path}}'
      destination:
        server: https://kubernetes.default.svc
        namespace: '{{.path.basename}}'
      syncPolicy:
        automated:
          prune: true
          selfHeal: true

List (multi-cluster)

generators:
- list:
    elements:
    - cluster: us-east-1
      url: https://cluster1.example.com
    - cluster: eu-central-1
      url: https://cluster2.example.com
template:
  metadata:
    name: 'myapp-{{.cluster}}'
  spec:
    destination:
      server: '{{.url}}'
      namespace: production

Matrix (environments x clusters)

generators:
- matrix:
    generators:
    - git:
        repoURL: https://github.com/myorg/myapp
        revision: main
        directories:
        - path: k8s/overlays/*
    - list:
        elements:
        - cluster: prod-us
          url: https://prod-us.example.com
        - cluster: prod-eu
          url: https://prod-eu.example.com

Progressive sync (RollingSync)

Stages rollouts across environments. Each step matches applications by label and controls how many can update concurrently.

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: myapp-rolling
  namespace: argocd
spec:
  goTemplate: true
  goTemplateOptions: ["missingkey=error"]
  generators:
  - list:
      elements:
      - cluster: dev
        url: https://dev.example.com
        env: env-dev
      - cluster: staging
        url: https://staging.example.com
        env: env-staging
      - cluster: prod
        url: https://prod.example.com
        env: env-prod
  strategy:
    type: RollingSync
    rollingSync:
      steps:
      - matchExpressions:
        - key: envLabel
          operator: In
          values: [env-dev]
      - matchExpressions:
        - key: envLabel
          operator: In
          values: [env-staging]
        maxUpdate: 0
      - matchExpressions:
        - key: envLabel
          operator: In
          values: [env-prod]
        maxUpdate: 10%
  template:
    metadata:
      name: 'myapp-{{.cluster}}'
      labels:
        envLabel: '{{.env}}'
    spec:
      project: production
      source:
        repoURL: https://github.com/myorg/myapp
        targetRevision: main
        path: 'k8s/overlays/{{.cluster}}'
      destination:
        server: '{{.url}}'
        namespace: myapp

maxUpdate: 0 means the step requires manual promotion (or an external trigger). maxUpdate: 10% limits concurrent updates to 10% of matching apps.

Ignore application differences

Prevents the ApplicationSet controller from overwriting fields that operators modify manually (e.g., pinning a branch for debugging).

spec:
  ignoreApplicationDifferences:
  - jqPathExpressions:
    - .spec.sources[] | select(.repoURL == "https://github.com/myorg/repo").targetRevision

Caveat: MergePatch replaces entire lists on any change, so modifying other sources in the same sources list can still reset the ignored field.

Sync hooks and waves

# PreSync job -- runs before sync, deleted on success
metadata:
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
    argocd.argoproj.io/sync-wave: "1"

# PostSync smoke test
metadata:
  annotations:
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
    argocd.argoproj.io/sync-wave: "5"

Waves are ordered lowest-first. Resources in the same wave are applied together.

RBAC (argocd-rbac-cm)

data:
  policy.default: role:readonly
  policy.csv: |
    g, myorg:platform-team, role:admin
    p, role:developer, applications, get, */*, allow
    p, role:developer, applications, sync, */*, allow
    p, role:developer, repositories, get, *, allow
  scopes: '[groups, email]'

SSO (Dex + GitHub)

# argocd-cm
data:
  url: https://argocd.example.com
  dex.config: |
    connectors:
    - type: github
      id: github
      name: GitHub
      config:
        clientID: $dex.github.clientId
        clientSecret: $dex.github.clientSecret
        orgs:
        - name: myorg
          teams:
          - platform-team
          - developers

Custom health checks

# argocd-cm
data:
  resource.customizations.health.argoproj.io_Rollout: |
    hs = {}
    if obj.status ~= nil then
      if obj.status.phase == "Healthy" then
        hs.status = "Healthy"
        return hs
      end
    end
    hs.status = "Progressing"
    hs.message = "Rollout in progress"
    return hs

CLI reference

# Application lifecycle
argocd app list
argocd app get <app> [--refresh] [--hard-refresh]
argocd app sync <app> [--prune] [--dry-run] [--force] [--timeout 300]
argocd app diff <app>
argocd app history <app>
argocd app rollback <app> <revision>
argocd app logs <app> [--follow] [--container <name>]
argocd app resources <app>
argocd app delete <app> [--cascade=false]

# Repo management
argocd repo add <url> --username <u> --password <token>
argocd repo list

# Cluster management
argocd cluster add <context>
argocd cluster list

# Project management
argocd proj list
argocd proj get <project>

Status reference

Sync statusMeaning
SyncedLive state matches Git
OutOfSyncDrift detected
UnknownCannot determine
Health statusMeaning
HealthyAll resources healthy
ProgressingResources being updated
DegradedOne or more resources unhealthy
SuspendedResources suspended
MissingResources absent from cluster

Troubleshooting

App stuck OutOfSync after correct Git state:

argocd app get <app> --hard-refresh
argocd app diff <app>

ComparisonError (Kustomize/Helm render failure):

  • Hard-refresh to clear the repo-server cache.
  • Check the conditions field in argocd app get output for the render error.

Sync stuck / hook not completing:

  • Check hook pod logs: argocd app logs <app>.
  • Verify hook-delete-policy -- HookSucceeded leaves failed hook pods visible for inspection.

Authentication expired:

argocd login <server> --username admin --password <password> [--insecure]

Best practices

  • One Application per logical component, not one giant app per cluster.
  • Enable prune: true and selfHeal: true in production.
  • Use AppProjects to enforce source/destination boundaries per team.
  • Use sync waves to sequence dependent resources (e.g., CRDs before CRs).
  • Use syncWindows to gate production deployments to business hours.
  • Implement orphanedResources.warn: true to surface drift early.
  • Prefer ServerSideApply=true for large resources to avoid annotation size limits.
  • Enable Go templates with goTemplateOptions: ["missingkey=error"] in all ApplicationSets.
  • Use spec.sources (multi-source) when Helm values live in a separate repo from the chart.

Anti-patterns

  • No prune -- leaves orphaned resources that accumulate silently.
  • No AppProject -- loses namespace/repo isolation, no RBAC boundaries.
  • Manual syncs only -- defeats the point of GitOps; drift goes undetected.
  • Overloading one Application with unrelated resources -- makes rollback and diff noisy.
  • Using legacy fasttemplate syntax ({{field}}) in new ApplicationSets -- Go templates with missingkey=error catch typos at render time.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.12%
按下载量换算24

Claude

27.84%
按下载量换算18

Cursor

16.86%
按下载量换算11

Gemini CLI

9.31%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills