Skip to content

Quickstart: Installing the Apheris CLI🔗

Your Apheris representative will have provided you with a number of wheel files, which need to be installed in a specific order. For this tutorial, you will only use the apheris_auth and apheris_cli wheels. If the provided wheel files are zipped, please first unzip them.

1. Create a Virtual Environment🔗

Next, create a new Python virtual environment in which to install the Apheris CLI. The CLI supports Python 3.8-3.10, so please make sure you're using a supported version of Python.

python3 -m venv apheris-cli-venv
source apheris-cli-venv/bin/activate

2. Install Apheris Auth🔗

The apheris_auth wheel is the Apheris Authentication package, which contains the underlying logic used to authenticate with the Apheris environment. It is not expected for end-users to use this directly, but it is a required component for the Apheris CLI.

Install the apheris_auth wheel (replace x.y.z with the version number of your wheel file):

pip install apheris_auth-x.y.z-py3-none-any.whl

3. Install Apheris CLI🔗

The apheris_cli wheel contains the apheris-cli package, which provides the mechanism to interact with the Orchestrator, create Compute Specs and run computation jobs.

Install the apheris_cli wheel (again replace x.y.z with the version number of your wheel file):

pip install apheris_cli-x.y.z-py3-none-any.whl

4. Install CLI Auto-completion🔗

Auto-completion is available for CLI commands, which means you can start typing a command, then hit TAB to complete it.

Auto-completion installation is dependent on the shell you are using. To ensure you install the right settings for your shell, you can use the $SHELL environment variable, or manually name your shell.

$ apheris --install-completion $SHELL
bash completion installed in /home/username/.bash_completions/apheris.sh
Completion will take effect once you restart the terminal

As suggested above, restart your terminal, re-activate your virtual environment, then try it out! Start typing apheris d, hit TAB and watch it complete to apheris datasets.

Note

If using shell commands from inside a Jupyter Notebook, the shell auto-completion might not work.

5. Configure your Environment🔗

Now you have installed all the necessary packages, you need to provide your environment configuration. This is done using a Python package called dotenv which is installed as a dependency of the CLI and allows easy configuration of environment variables from a file.

Please contact your Apheris representative to get access the dotenv file for your environment. This file contains environment variables for your specific environment, including which URL the CLI should connect to. You can set these environment variables like so:

dotenv -f <name_of_environment_file> run $SHELL

Note

If you are running the apheris-cli from a Conda environment, please note that you may need to reactivate the conda environment after running this command.

6. Test it out🔗

Let's test your installation. The simplest way to do that is to see what version of the Apheris CLI you have installed:

$ apheris version
0.17.0

Note

The version you see here will vary, dependant on the package provided by your Apheris representative.

You can see the available commands at any time using the --help flag:

$ apheris --help

 Usage: apheris [OPTIONS] COMMAND [ARGS]...                                            

╭─ Options ───────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.             │
│ --show-completion             Show completion for the current shell, to copy it or  │
│                               customize the installation.                           │
│ --help                        Show this message and exit.                           │
╰─────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────╮
│ compute    Use the sub-commands to interact with compute specs.                     │
│ datasets   Use the sub-commands to interact with datasets.                          │
│ job        Use the sub-commands to interact with jobs.                              │
│ login      Interactive login to the Apheris platform. You will be forwarded to a    │
│            website. For machine to machine applications (m2m), make sure the        │
│            environment variables `APH_SERVICE_USER_CLIENT_ID` and                   │
│            `APH_SERVICE_USER_CLIENT_SECRET` are set. Call `apheris login status` to │
│            check your login status.                                                 │
│ logout     Log out of the Apheris platform.                                         │
│ models     Interact with the model registry.                                        │
│ version    Print the version of the Apheris CLI.                                    │
╰─────────────────────────────────────────────────────────────────────────────────────╯

Next steps🔗

Now you've installed the Apheris CLI, why not try it out by following our Getting Started guide?