$ argocd --core app list --repo-server-name openshift-gitops-repo-server
The Red Hat OpenShift GitOps 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.
The GitOps argocd
CLI is a tool for configuring and managing Red Hat OpenShift GitOps and Argo CD resources from the command line.
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.
argocd [command or options] [arguments…]
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.
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…]
$ argocd --core app list --repo-server-name openshift-gitops-repo-server
$ 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…]
$ argocd --core --kube-context kubeadmin-local app list --repo-server-name openshift-gitops-repo-server
$ 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…]
$ 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…]
$ KUBECONFIG=~/.kube/custom_config argocd --kube-context kubeadmin-local --core app list --repo-server-name openshift-gitops-repo-server
Global options are applicable to all the subcommands of the argocd
.
Option | Argument type | Description |
---|---|---|
|
|
Authentication token. |
|
|
Client certificate file. |
|
|
Client certificate key file. |
|
|
Path to Argo CD configuration file. Defaults to the |
|
|
Name of the Argo CD Application Controller component with If the label of this component’s name differs from the default, for example, when you are installing it through the helm chart, set either the |
|
N/A |
If set to |
|
N/A |
Enable the gRPC-Web protocol for the Argo CD server. This is useful if, for example, the server is behind a proxy that does not support the HTTP/2 protocol. |
|
|
Enable the gRPC-Web protocol for the Argo CD server. This is useful if, for example, the server is behind a proxy that does not support the HTTP/2 protocol. Set web root. |
|
|
Configure an additional header to all requests made by the GitOps |
|
N/A |
Help for the GitOps |
|
|
Set the maximum number of retries to establish an HTTP connection to the Argo CD server. |
|
N/A |
Skip server certificate and domain verification. |
|
|
Direct the command to the given kube context. |
|
|
Set the logging format to either text or JSON. Defaults to |
|
|
Set the logging level. Defaults to |
|
N/A |
Disable Transport Layer Security (TLS) protocols. |
|
N/A |
Connect to a random Argo CD server port using port forwarding. |
|
|
Namespace name to be used for port forwarding. |
|
|
Name of the Redis HA Proxy deployment with If the label of this deployment’s name differs from the default, for example, when you are installing HAProxy through the helm chart, set either the |
|
|
Name of the Redis deployment with If the label of this deployment’s name differs from the default, for example, when you are installing it through the helm chart, set either the |
|
|
Name of the Argo CD Repo server with If the label of this Repo server’s name differs from the default, for example, when you are installing it through the helm chart, set either the |
|
|
Argo CD server address. |
|
|
Server certificate file. |
|
|
Name of the Argo CD API server with If the label of this Argo CD API server’s name differs from the default, for example, when you are installing it through the helm chart, set either the |
Print version information of the CLI.
argocd version [flags]
$ argocd version
$ argocd version --client
$ argocd version --server <server_url>
$ argocd version -o json
$ argocd version --short -o yaml
Print the help message about any command in the application.
argocd help [command] [flags]
$ argocd help
admin
subcommand$ argocd help admin
Write bash
or zsh
shell completion code to standard output.
argocd completion SHELL [flags]
For bash
, ensure you have Bash completions installed and enabled. Alternatively, write it to a file and source it in your .bash_profile
.
# source <(argocd completion bash)
For zsh
, ensure you have Bash completions installed and enabled.
~/.zshrc
file and access completion in your current shellsource <(argocd completion zsh)
compdef _argocd argocd