Quickstart: Installing the Apheris CLI🔗
In this tutorial you will see how to install the Apheris CLI and its auto-complete functionality.
Apheris is officially supported on Mac and Linux. When using Windows, we suggest using WSL and your preferred Linux distribution.
1. Create a Virtual Environment🔗
Next, create a new Python virtual environment in which to install the Apheris CLI. The CLI supports Python 3.10-3.11, 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 the 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.
Since Apheris 3.9, the CLI is now installable as a PyPi package.
Install the apheris-cli wheel (replace x.y.z with the version number from the release notes of your Apheris version):
pip install apheris-cli==x.y.z
Note
Installing apheris-cli also installs apheris-auth. This 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. If you need to install the CLI offline, please install the wheel files provided by your Apheris representative in the following order: apheris-auth then apheris-cli.
3. 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.
4. 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.
5. 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.44.0
Note
The version you see here will vary, dependent 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 ─────────────────────────────────────────────────────────────────────╮
│ 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. │
│ version Print the version of the Apheris CLI. │
│ datasets Use the sub-commands to interact with datasets. │
│ compute Use the sub-commands to interact with Compute Specs. │
│ job Use the sub-commands to interact with jobs. │
│ models Interact with the Registry. │
╰────────────────────────────────────────────────────────────────────────────────╯
Next steps🔗
Now you've installed the Apheris CLI, why not try it out by following our Getting Started guide?