Skip to content

Commit f95e78d

Browse files
committed
Added configuration section and changed global commands to utility commands
Signed-off-by: Anand Francis Joseph <[email protected]>
1 parent 33e2b03 commit f95e78d

File tree

1 file changed

+65
-17
lines changed

1 file changed

+65
-17
lines changed

docs/OpenShift GitOps CLI User Guide.md

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,67 @@ argocd: v2.9.2+c5ea5c4
117117
```
118118
**Note:** The above output is just for reference. The actual details might be different based on the version of OpenShift GitOps argocd CLI client installed.
119119
120+
## Configuring OpenShift GitOps CLI (argocd)
121+
122+
Configure the Red Hat OpenShift GitOps `argocd` CLI to enable tab completion.
123+
124+
### Enabling tab completion
125+
126+
After you install the `argocd` CLI, you can enable tab completion to automatically complete `argocd` commands or suggest options when you press Tab.
127+
128+
#### Prerequisites
129+
- You must have the `argocd` CLI tool installed.
130+
- You must have bash-completion installed on your local system.
131+
132+
#### Procedure
133+
The following procedure enables tab completion for Bash.
134+
135+
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.
144+
145+
Tab completion is enabled when you open a new terminal.
146+
120147
## OpenShift GitOps argocd reference
148+
121149
This section lists the basic `argocd` CLI commands.
122150
**Note** MicroShift based installation do not host an ArgoCD server and supports only the `core` mode of execution.
123151
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.
124152
125153
### Basic syntax
126-
- Normal mode
127-
```
128-
argocd [command or options] [arguments…​]
129-
```
130154
131-
- Core mode
155+
#### Normal mode
156+
157+
In the normal mode, users have to login to the ArgoCD server component using the login component before executing the commands.
158+
159+
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+
```
163+
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+
```
169+
3. Execute the argocd commands
170+
```
171+
argocd [command or options] [arguments…​]
172+
```
173+
174+
#### Core mode
175+
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.
132177
```
133178
KUBECONFIG=~/.kube/config argocd --core [command or options] [arguments…​]
134179
```
180+
135181
### Global options
136182
137183
| Option| Argument Type | Description|
@@ -158,7 +204,7 @@ In the `core` mode (`--core` argument specified), the CLI talks directly to the
158204
| --redis-name | string | Name of the Redis deployment; set this or the ARGOCD_REDIS_NAME environment variable when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis") |
159205
160206
161-
### Global Commands
207+
### Utility Commands
162208
163209
#### version
164210
Print version information
@@ -236,16 +282,12 @@ compinit
236282
###### Flags:
237283
-h, --help help for completion
238284
239-
### Login Commands
285+
### Login related Commands
240286
* [argocd login](./cli/argocd_login.md) - Log in to an Argo CD server
241287
* [argocd logout](./cli/argocd_logout.md) - Log out from Argo CD
242288
* [argocd relogin](./cli/argocd_relogin.md) - Refresh an expired authenticate token
243-
* [argocd gpg add](./cli/argocd_gpg_add.md) - Adds a GPG public key to the server's keyring
244-
* [argocd gpg get](./cli/argocd_gpg_get.md) - Get the GPG public key with ID <KEYID> from the server
245-
* [argocd gpg list](./cli/argocd_gpg_list.md) - List configured GPG public keys
246-
* [argocd gpg rm](./cli/argocd_gpg_rm.md) - Removes a GPG public key from the server's keyring
247289
248-
### Admin Commands
290+
### Administrative Commands
249291
* [argocd admin](./cli/argocd_admin.md) - Contains a set of commands useful for Argo CD administrators and requires direct Kubernetes access
250292
* [argocd admin export](./cli/argocd_admin_export.md) - Export all Argo CD data to stdout (default) or a file
251293
* [argocd admin import](./cli/argocd_admin_import.md) - Import Argo CD data from stdin (specify `-') or a file
@@ -277,7 +319,7 @@ compinit
277319
* [argocd admin settings resource-overrides](./cli/argocd_admin_settings_resource-overrides.md) - Troubleshoot resource overrides
278320
* [argocd admin settings validate](./cli/argocd_admin_settings_validate.md) - Validate settings
279321
280-
### Account related commands
322+
### Account management commands
281323
* [argocd account](./cli/argocd_account.md) - Manage argo accounts
282324
* [argocd account bcrypt](./cli/argocd_account_bcrypt.md) - Generate bcrypt hash for any password
283325
* [argocd account can-i](./cli/argocd_account_can-i.md) - Can I
@@ -288,7 +330,13 @@ compinit
288330
* [argocd account list](./cli/argocd_account_list.md) - List accounts
289331
* [argocd account update-password](./cli/argocd_account_update-password.md) - Update an account's password
290332
291-
### Project related commands
333+
### GPG key management Commands
334+
* [argocd gpg add](./cli/argocd_gpg_add.md) - Adds a GPG public key to the server's keyring
335+
* [argocd gpg get](./cli/argocd_gpg_get.md) - Get the GPG public key with ID <KEYID> from the server
336+
* [argocd gpg list](./cli/argocd_gpg_list.md) - List configured GPG public keys
337+
* [argocd gpg rm](./cli/argocd_gpg_rm.md) - Removes a GPG public key from the server's keyring
338+
339+
### Project management commands
292340
* [argocd proj](./cli/argocd_proj.md) - Manage projects
293341
* [argocd proj add-destination](./cli/argocd_proj_add-destination.md) - Add project destination
294342
* [argocd proj add-orphaned-ignore](./cli/argocd_proj_add-orphaned-ignore.md) - Add a resource to orphaned ignore list
@@ -311,7 +359,7 @@ compinit
311359
* [argocd proj set](./cli/argocd_proj_set.md) - Set project parameters
312360
* [argocd proj windows](./cli/argocd_proj_windows.md) - Manage a project's sync windows
313361
314-
### Application related commands
362+
### Application management commands
315363
* [argocd app](./cli/argocd_app.md) - Manage argo Applications
316364
* [argocd app actions](./cli/argocd_app_actions.md) - Manage Resource actions
317365
* [argocd app create](./cli/argocd_app_create.md) - Create an application
@@ -354,15 +402,15 @@ compinit
354402
* [argocd app unset](./cli/argocd_app_unset.md) - Unset application parameters
355403
* [argocd app wait](./cli/argocd_app_wait.md) - Wait for an application to reach a synced and healthy state
356404
357-
### Application Set related commands
405+
### Application Set management commands
358406
* [argocd appset](./cli/argocd_appset.md) - argocd controls a Argo CD server
359407
* [argocd appset create](./cli/argocd_appset_create.md) - Create one or more ApplicationSets
360408
* [argocd appset delete](./cli/argocd_appset_delete.md) - Delete one or more ApplicationSets
361409
* [argocd appset get](./cli/argocd_appset_get.md) - Get ApplicationSet details
362410
* [argocd appset list](./cli/argocd_appset_list.md) - List ApplicationSets
363411
* [argocd appset update](./cli/argocd_appset_update.md) - Updates the given ApplicationSet(s)
364412
365-
### Repository related commands
413+
### Repository management commands
366414
* [argocd repo add](./cli/argocd_repo_add.md) - Add git repository connection parameters
367415
* [argocd repo get](./cli/argocd_repo_get.md) - Get a configured repository by URL
368416
* [argocd repo list](./cli/argocd_repo_list.md) - List configured repositories

0 commit comments

Comments
 (0)