第3章 GitOps argocd CLI reference


重要

The Red Hat OpenShift GitOps argocd CLI tool is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

This section lists the basic GitOps argocd CLI commands.

3.1. Basic syntax

The GitOps argocd CLI is a tool for configuring and managing Red Hat OpenShift GitOps and Argo CD resources from the command line.

3.1.1. Default mode

In the default mode, the argocd CLI client communicates with the Argo CD server component through API requests. To execute commands, you must log in to the Argo CD server using your Argo CD credentials and remain logged in throughout the session. If the login session times out, you can use the relogin command to log in again. When done using the argocd commands, you can log out using the logout command.

Command syntax

argocd [command or options] [arguments…​]

3.1.2. Core mode

In this mode, the CLI communicates directly with the Kubernetes API server through the credentials set in the kubeconfig file. The default kubeconfig file is available at the $HOME/.kube/config location. You can customize this file using the KUBECONFIG environment variable. To execute commands in the core mode, you can use the --core argument and don’t need to log in to the Argo CD server for user authentication.

To specify the Repo server component name in the <argocd-instance-name>-repo-server format, you can either use the --repo-server-name command line option or set the ARGOCD_REPO_SERVER_NAME environment variable.

Command syntax

KUBECONFIG=~/.kube/config argocd --core [command or options] [arguments…​]

You can choose one of the following options to execute argocd commands in the core mode:

注記

If multiple Argo CD instances are in use, set the default namespace of the current context to the namespace of the ArgoCD instance you want to interact with.

  • Default kubeconfig file with the default context:

    argocd --core [command or options] [arguments…]

    Example 1: Display a list of applications:

    $ argocd --core app list --repo-server-name openshift-gitops-repo-server

    Example 2: Display a list of applications:

    $ ARGOCD_REPO_SERVER_NAME=openshift-gitops-repo-server argocd --core app list
  • Default kubeconfig file with a custom context:

    argocd --core --kube-context [context] [command or options] [arguments…]

    Example 1: Display a list of applications:

    $ argocd --core --kube-context kubeadmin-local app list --repo-server-name openshift-gitops-repo-server

    Example 2: Display a list of applications:

    $ ARGOCD_REPO_SERVER_NAME=openshift-gitops-repo-server argocd --core --kube-context kubeadmin-local app list
  • A custom kubeconfig file with the default context:

    KUBECONFIG=~/.kube/custom_config argocd --core [command or options] [arguments…]

    Example: Display a list of applications:

    $ KUBECONFIG=~/.kube/custom_config argocd --core app list --repo-server-name openshift-gitops-repo-server
  • A custom kubeconfig file with a custom context:

    KUBECONFIG=~/.kube/custom_config argocd --core --kube-context [context] [command or options] [arguments…]

    Example: Display a list of applications:

    $ KUBECONFIG=~/.kube/custom_config argocd --kube-context kubeadmin-local --core app list --repo-server-name openshift-gitops-repo-server
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る