With the 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:
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.
The installation script installs the latest version of rhoas
by default.
-
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
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
-
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
-
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
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 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.
-
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
NoteFor macOS, to find the location of your bash-completion
directory, check the~/.bashrc
or~/.bash_profile
file. -
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 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 have a Application Services 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.
You can log out from the rhoas
CLI by using the rhoas logout
command.
-
Log out of
rhoas
.$ rhoas logout