1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/rosa-setting-up-cli.adoc
2024-04-11 15:33:44 +00:00

128 lines
4.0 KiB
Plaintext

// Module included in the following assemblies:
//
// * rosa_cli/rosa-get-started-cli.adoc
:_mod-docs-content-type: PROCEDURE
[id="rosa-setting-up-cli_{context}"]
= Setting up the ROSA CLI
Use the following steps to install and configure the ROSA CLI (`rosa`) on your installation host.
.Procedure
. Install and configure the latest AWS CLI (`aws`).
.. Follow the link:https://aws.amazon.com/cli/[AWS Command Line Interface] documentation to install and configure the AWS CLI for your operating system.
+
Specify your `aws_access_key_id`, `aws_secret_access_key`, and `region` in the `.aws/credentials` file. See link:https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html[AWS Configuration basics] in the AWS documentation.
+
[NOTE]
====
You can optionally use the `AWS_DEFAULT_REGION` environment variable to set the default AWS region.
====
.. Query the AWS API to verify if the AWS CLI is installed and configured correctly:
+
[source,terminal]
----
$ aws sts get-caller-identity --output text
----
+
.Example output
[source,terminal]
----
<aws_account_id> arn:aws:iam::<aws_account_id>:user/<username> <aws_user_id>
----
. Download the latest version of the ROSA CLI (`rosa`) for your operating system from the link:https://console.redhat.com/openshift/downloads[*Downloads*] page on {cluster-manager}.
. Extract the `rosa` binary file from the downloaded archive. The following example extracts the binary from a Linux tar archive:
+
[source,terminal]
----
$ tar xvf rosa-linux.tar.gz
----
. Add `rosa` to your path. In the following example, the `/usr/local/bin` directory is included in the path of the user:
+
[source,terminal]
----
$ sudo mv rosa /usr/local/bin/rosa
----
. Verify if the ROSA CLI is installed correctly by querying the `rosa` version:
+
[source,terminal]
----
$ rosa version
----
+
.Example output
[source,terminal]
----
1.2.15
Your ROSA CLI is up to date.
----
. Optional: Enable tab completion for the ROSA CLI. With tab completion enabled, you can press the `Tab` key twice to automatically complete subcommands and receive command suggestions:
+
--
** To enable persistent tab completion for Bash on a Linux host:
.. Generate a `rosa` tab completion configuration file for Bash and save it to your `/etc/bash_completion.d/` directory:
+
[source,terminal]
----
# rosa completion bash > /etc/bash_completion.d/rosa
----
+
.. Open a new terminal to activate the configuration.
** To enable persistent tab completion for Bash on a macOS host:
.. Generate a `rosa` tab completion configuration file for Bash and save it to your `/usr/local/etc/bash_completion.d/` directory:
+
[source,terminal]
----
$ rosa completion bash > /usr/local/etc/bash_completion.d/rosa
----
+
.. Open a new terminal to activate the configuration.
** To enable persistent tab completion for Zsh:
.. If tab completion is not enabled for your Zsh environment, enable it by running the following command:
+
[source,terminal]
----
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
----
+
.. Generate a `rosa` tab completion configuration file for Zsh and save it to the first directory in your functions path:
+
[source,terminal]
----
$ rosa completion zsh > "${fpath[1]}/_rosa"
----
+
.. Open a new terminal to activate the configuration.
** To enable persistent tab completion for fish:
.. Generate a `rosa` tab completion configuration file for fish and save it to your `~/.config/fish/completions/` directory:
+
[source,terminal]
----
$ rosa completion fish > ~/.config/fish/completions/rosa.fish
----
+
.. Open a new terminal to activate the configuration.
** To enable persistent tab completion for PowerShell:
.. Generate a `rosa` tab completion configuration file for PowerShell and save it to a file named `rosa.ps1`:
+
[source,terminal]
----
PS> rosa completion powershell | Out-String | Invoke-Expression
----
+
.. Source the `rosa.ps1` file from your PowerShell profile.
--
+
[NOTE]
====
For more information about configuring `rosa` tab completion, see the help menu by running the `rosa completion --help` command.
====