Important
|
The |
With the rhoas
command-line interface (CLI), you can manage your application services from a terminal.
This guide describes how to set up rhoas
by doing the following:
You can install rhoas
on Linux, macOS, or Windows.
Note
|
The rhoas Releases page lists the bug fixes and new features for every rhoas release.
|
If you are using Linux, you can install rhoas
by either using the installation script, or the RPM.
-
Review the
install.sh
installation script. -
Run the
install.sh
script:$ curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash
NoteYou can use the
-s
argument to install a specific version of therhoas
CLI. For example, this command installs version0.32.0
:$ curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash -s 0.32.0
The
rhoas
CLI is installed in$HOME/.local/bin
. -
Verify that the
rhoas
installation directory is on your$PATH
.To check your
$PATH
, run the following command:$ echo $PATH
-
Check the
rhoas
version to verify that the CLI is installed.This example shows that
rhoas
0.32.0 is installed:$ rhoas --version rhoas version 0.32.0
You can install rhoas
as an RPM if you are using Red Hat Enterprise Linux (RHEL), Fedora, or CentOS.
-
Navigate to the
rhoas
Releases page and choose the version that you’d like to download. -
Use
dnf
/yum
to install the desired version ofrhoas
:This example installs
rhoas
version0.32.0
:$ sudo dnf install -y https://github.com/redhat-developer/app-services-cli/releases/download/v0.32.0/rhoas_0.32.0_linux_amd64.rpm
-
Check the
rhoas
version to verify that the CLI is installed.This example shows that
rhoas
0.32.0 is installed:$ rhoas --version rhoas version 0.32.0
-
Review the
install.sh
installation script. -
Run the
install.sh
script:$ curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash
NoteYou can use the
-s
argument to install a specific version of therhoas
CLI. For example, this command installs version0.32.0
:$ curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash -s 0.32.0
The
rhoas
CLI is installed in$HOME/bin
. -
Verify that the
rhoas
installation directory is on your$PATH
.To check your
$PATH
, run the following command:$ echo $PATH
-
Check the
rhoas
version to verify that the CLI is installed.This example shows that
rhoas
0.32.0 is installed:$ rhoas --version rhoas version 0.32.0
-
Navigate to the
rhoas
Releases page. -
Download the latest
rhoas
.zip file. -
On your computer, create a
C:\rhoas
folder. -
Extract the
rhoas.exe
file from the .zip file that you downloaded. -
Move the
rhoas.exe
file toC:\rhoas
. -
If you are using Windows 10, set the
PATH
variable.-
Click Search and type
env
orenvironment
. -
Select Edit environment variables for your account.
-
In the Variable section, select Path, and click Edit.
-
Click New, and enter
C:\rhoas
.
-
After you install the rhoas
CLI,
you can enable command completion to automatically complete rhoas
commands or suggest options when you press Tab.
Note
|
The procedure for enabling command completion depends on the shell you are using.
To determine which shell you are using, run the echo $0 command.
|
You can enable command completion for each of the following shells:
-
You’ve installed the
rhoas
CLI.
-
Create the
rhoas_completions
script file.$ rhoas completion bash > rhoas_completions
-
Move the script file to a special Bash completions directory.
Linux$ sudo mv rhoas_completions /etc/bash_completion.d/rhoas
macOS$ sudo mv rhoas_completions /usr/local/etc/bash_completion.d/rhoas
-
Open a new terminal window.
Command completion is enabled.
-
Install the command completion script.
$ rhoas completion zsh > "${fpath[1]}/_rhoas"
-
Unless already installed, enable command completions.
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
-
Open a new terminal window.
Command completion is enabled.
-
Install fish completions.
$ rhoas completion -s fish > ~/.config/fish/completions/rhoas.fish
-
Open a new terminal window.
Command completion is enabled.
After rhoas
is installed, you can log in to access your application services.
-
You must have an account to access Red Hat OpenShift Application Services.
-
You’ve installed the
rhoas
CLI.
-
In a terminal, log in to
rhoas
.$ rhoas login
You are redirected to your web browser at https://sso.redhat.com.
-
Enter your credentials to log in to your Red Hat account.
Welcome pages in the browser notify you that you have been logged in to
rhoas
successfully.In your terminal, the
rhoas login
command indicates that you are logged in:$ rhoas login Logging in... ✔️ Logged in successfully ✔️ You are now logged in as "user"
You can log out from the rhoas
CLI by using the rhoas logout
command.
-
Log out of
rhoas
.$ rhoas logout Successfully logged out