With the Red Hat OpenShift Application Services 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:
Installing the rhoas CLI
You can install rhoas
on Linux, macOS, or Windows.
Installing the rhoas CLI on Linux
If you are using Linux, you can install rhoas
by either using the installation script, or the RPM. The installation script installs the latest version of rhoas
by default.
Installation script
-
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
The
rhoas
CLI is installed in$HOME/.local/bin
. -
Verify that the
rhoas
installation directory is in a directory on yourPATH
.To check your
PATH
, run the following command:$ echo $PATH
-
Check the
rhoas
version to verify that the CLI is installed.$ rhoas --version
RPM installation
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
.$ sudo dnf install -y https://github.com/redhat-developer/app-services-cli/releases/download/v<version-num>_/rhoas_<version-num>_linux_amd64.rpm
-
Check the
rhoas
version to verify that the CLI is installed.$ rhoas --version
Installing the rhoas CLI on macOS
-
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
The
rhoas
CLI is installed in$HOME/bin
. -
Verify that the
rhoas
installation directory is in a directory on yourPATH
.To check your
PATH
, run the following command:$ echo $PATH
-
Check the
rhoas
version to verify that the CLI is installed.$ rhoas --version
Installing the rhoas CLI on Windows
-
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
. -
Click OK to save changes.
-
-
Open a terminal and check the
rhoas
version to verify that the CLI is installed.$ rhoas --version
Configuring rhoas
After you install the rhoas
CLI, you can enable command completion to automatically complete rhoas
commands or suggest options when you press Tab.
echo $0
command.
You can enable command completion for each of the following shells:
-
You have a command-line terminal application.
-
You’ve installed the
rhoas
CLI. -
If you’re using macOS, you’ve installed
bash-completion
configured in your.bash_profile
file.
Enabling command completion on Bash
-
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
For macOS, to find the location of yourbash-completion
directory, check the~/.bashrc
or~/.bash_profile
file. -
Open a new terminal window.
Command completion is enabled.
Enabling command completion on Zsh
-
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.
Enabling command completion on Fish
-
Install fish completions.
$ rhoas completion fish > ~/.config/fish/completions/rhoas.fish
-
Open a new terminal window.
Command completion is enabled.
Logging in to rhoas
After rhoas
is installed, you can log in to access your application services.
-
You have a Red Hat account.
-
You’ve installed the
rhoas
CLI.
-
In a terminal, log in to
rhoas
.$ rhoas login
Your web browser opens the Red Hat Single Sign-On page.
-
Enter your credentials to log in to your Red Hat account.
Welcome pages in the browser notify you that you’ve been logged in to
rhoas
successfully.In your terminal, the
rhoas login
command indicates that you’re logged in.
Logging out of rhoas
You can log out from the rhoas
CLI by using the rhoas logout
command.
-
Log out of
rhoas
.$ rhoas logout