Set up


This tutorial explains how to install and set up the Blue Brain Nexus CLI to connect to a Blue Brain Nexus deployment.


Let’s get started.

Install the Blue Brain Nexus CLI

Since the CLI is written in python, you may want to create a virtual environment for a clean set up. To do so, Conda can be used. If you don’t have it installed follow the instructions here.

conda create -n nexus-cli python=3.6
conda activate nexus-cli
pip install git+

The following command should output a help message if the installation is successful.

nexus --help
Usage: nexus [OPTIONS] COMMAND [ARGS]...

  --help  Show this message and exit.

  acls       ACLs operations
  auth       Authentication operations
  orgs       Organizations operations
  profiles   Profiles management operations
  projects   Projects operations
  resolvers  Resolvers operations
  resources  Resources operations
  schemas    Schemas operations
  views      Views operations

Connect to a Nexus deployment

Configure the CLI

To ease the usage of the CLI, we will create a profile named ‘tutorial’ storing locally various configurations such as the Nexus deployment url.

nexus profiles create tutorial \
&& nexus profiles select tutorial \
&& nexus profiles list
Profile created.
Selected profile: tutorial

Profile created.
+------------+----------+------------------------------------- +-------+
| Profile    | Selected | URL                                  | Token |
| tutorial   |   Yes    | |  None |
+------------+----------+------------------------------------- +-------+


A bearer token is needed to authenticate to Nexus. For the purpose of this tutorial, you’ll login using your github account.

The following command will open (after pressing enter button) a browser window from where you can login using your github account.

nexus auth web
A browser window will now open, please login, copy your token and use the 'set-token' command to store it in the CLI
Press ENTER to continue...

From the opened web page, click on the login button on the right corner and follow the instructions.


At the end you’ll see a token button on the right corner. Click on it to copy the token.


The token can now be added to the tutorial profile. In the output of the following command you should see that the token column has now an expiry date.

nexus auth set-token $TOKEN && nexus profiles list
| Profile      | Selected | URL                                 |            Token            |
| tutorial     |   Yes    |         | Expiry: YYYY-MM-DD HH:mm:s |

That’s it!