Skip to content

Latest commit

 

History

History
 
 

rhoas-cli

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Installing and configuring the rhoas CLI

Important

The rhoas command-line interface (CLI) is currently available for Development Preview. Development Preview releases provide early access to a limited set of features that might not be fully tested and that might change in the final GA version. Users should not use Development Preview software in production or for business-critical workloads. Limited documentation is available for Development Preview releases and is typically focused on fundamental user goals.

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:

Installing the rhoas CLI

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.

Installing the rhoas CLI on Linux

If you are using Linux, you can install rhoas by either using the installation script, or the RPM.

Installation script

Procedure
  1. Review the install.sh installation script.

  2. Run the install.sh script:

    $ curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash
    Note

    You can use the -s argument to install a specific version of the rhoas CLI. For example, this command installs version 0.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.

  3. Verify that the rhoas installation directory is on your $PATH.

    To check your $PATH, run the following command:

    $ echo $PATH
  4. 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

RPM installation

You can install rhoas as an RPM if you are using Red Hat Enterprise Linux (RHEL), Fedora, or CentOS.

Procedure
  1. Navigate to the rhoas Releases page and choose the version that you’d like to download.

  2. Use dnf/yum to install the desired version of rhoas:

    This example installs rhoas version 0.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
  3. 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

Installing the rhoas CLI on macOS

Procedure
  1. Review the install.sh installation script.

  2. Run the install.sh script:

    $ curl -o- https://raw.githubusercontent.com/redhat-developer/app-services-cli/main/scripts/install.sh | bash
    Note

    You can use the -s argument to install a specific version of the rhoas CLI. For example, this command installs version 0.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.

  3. Verify that the rhoas installation directory is on your $PATH.

    To check your $PATH, run the following command:

    $ echo $PATH
  4. 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

Installing the rhoas CLI on Windows

Procedure
  1. Navigate to the rhoas Releases page.

  2. Download the latest rhoas .zip file.

  3. On your computer, create a C:\rhoas folder.

  4. Extract the rhoas.exe file from the .zip file that you downloaded.

  5. Move the rhoas.exe file to C:\rhoas.

  6. If you are using Windows 10, set the PATH variable.

    1. Click Search and type env or environment.

    2. Select Edit environment variables for your account.

    3. In the Variable section, select Path, and click Edit.

    4. Click New, and enter C:\rhoas.

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.

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:

Prerequisites
  • You’ve installed the rhoas CLI.

Enabling command completion on Bash

Procedure
  1. Create the rhoas_completions script file.

    $ rhoas completion bash > rhoas_completions
  2. 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
  3. Open a new terminal window.

    Command completion is enabled.

Enabling command completion on Zsh

Procedure
  1. Install the command completion script.

    $ rhoas completion zsh > "${fpath[1]}/_rhoas"
  2. Unless already installed, enable command completions.

    $ echo "autoload -U compinit; compinit" >> ~/.zshrc
  3. Open a new terminal window.

    Command completion is enabled.

Enabling command completion on Fish

Procedure
  1. Install fish completions.

    $ rhoas completion -s fish > ~/.config/fish/completions/rhoas.fish
  2. 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.

Prerequisites
  • You must have an account to access Red Hat OpenShift Application Services.

  • You’ve installed the rhoas CLI.

Procedure
  1. In a terminal, log in to rhoas.

    $ rhoas login

    You are redirected to your web browser at https://sso.redhat.com.

  2. 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"

Logging out of rhoas

You can log out from the rhoas CLI by using the rhoas logout command.

Procedure
  • Log out of rhoas.

    $ rhoas logout
    Successfully logged out