Skip to content

Commit 576de57

Browse files
committed
Formatted basic syntax commands
Signed-off-by: Anand Francis Joseph <[email protected]>
1 parent f95e78d commit 576de57

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

docs/OpenShift GitOps CLI User Guide.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ After you install the `argocd` CLI, you can enable tab completion to automatical
133133
The following procedure enables tab completion for Bash.
134134
135135
1. Save the Bash completion code to a file:
136-
```
137-
$ argocd completion bash > argocd_bash_completion
138-
```
139-
Copy the file to /etc/bash_completion.d/:
140-
```
141-
$ sudo cp argocd_bash_completion /etc/bash_completion.d/
142-
```
143-
Alternatively, you can save the file to a local directory and source it from your `.bashrc` file instead.
136+
```
137+
$ argocd completion bash > argocd_bash_completion
138+
```
139+
2. Copy the file to /etc/bash_completion.d/:
140+
```
141+
$ sudo cp argocd_bash_completion /etc/bash_completion.d/
142+
```
143+
Alternatively, you can save the file to a local directory and source it from your `.bashrc` file instead.
144144
145145
Tab completion is enabled when you open a new terminal.
146146
@@ -157,26 +157,32 @@ In the `core` mode (`--core` argument specified), the CLI talks directly to the
157157
In the normal mode, users have to login to the ArgoCD server component using the login component before executing the commands.
158158
159159
1. Get the admin password for the ArgoCD server
160-
```
161-
ADMIN_PASSWD=$(kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d)
162-
```
160+
```
161+
ADMIN_PASSWD=$(kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d)
162+
```
163163
2. Login to the ArgoCD server using the login command
164-
```
165-
argocd login --username admin --password ${ADMIN_PASSWD} <server url>
166-
#eg:
167-
argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
168-
```
164+
```
165+
argocd login --username admin --password ${ADMIN_PASSWD} <server url>
166+
#eg:
167+
argocd login --username admin --password ${ADMIN_PASSWD} openshift-gitops.openshift-gitops.apps-crc.testing
168+
```
169169
3. Execute the argocd commands
170-
```
171-
argocd [command or options] [arguments…​]
172-
```
170+
```
171+
argocd [command or options] [arguments…​]
172+
```
173173
174174
#### Core mode
175175
176-
In the `core` mode (`--core` argument specified), the CLI talks directly to the Kubernetes API server set as per the `KUBECONFIG` environment variable or the default file `$HOME/.kube/config`. There is no need for users to login into the ArgoCD server for executing commands.
177-
```
178-
KUBECONFIG=~/.kube/config argocd --core [command or options] [arguments…​]
179-
```
176+
In the `core` mode (`--core` argument specified), the CLI talks directly to the Kubernetes API server set as per the `KUBECONFIG` environment variable or the default file `$HOME/.kube/config`. There is no need for users to login into the ArgoCD server for executing commands. The commands would be run as user configured in the kubeconfig file.
177+
178+
1. With the default context in kubeconfig file
179+
```
180+
KUBECONFIG=~/.kube/config argocd --core [command or options] [arguments…​]
181+
```
182+
2. With a custom context in kubeconfig file
183+
```
184+
KUBECONFIG=~/.kube/config argocd --core --kube-context [context] [command or options] [arguments…​]
185+
```
180186
181187
### Global options
182188

0 commit comments

Comments
 (0)