# CLI (Preview Version)

## Overview

The Neurelo CLI is a tool that helps you to use some of Neurelo’s features programmatically from outside of the UI. You can download the latest version from the Neurelo dashboard. Neurelo's CLI is currently supported for the following operating systems -

* MacOS 64-bit (ARM and Intel based)
* Linux 64-bit (ARM and Intel based)

## Installation

Visit <https://dashboard.neurelo.com> and navigate to the user menu on the top right. Click on the "Download CLI" button. You will be redirected to the download page where you can find different versions of the CLI to download for your preferred platform (Mac or Linux are both available).&#x20;

After downloading the binary, please ensure it's executable by executing

```bash
chmod +x ./binary-path-here
```

<figure><img src="/files/v5mJ0p1BqouerDDSQr0w" alt="" width="563"><figcaption></figcaption></figure>

### MacOS Specific Installation Instructions

You might be warned that this application is from an unknown developer. To bypass this, simply open the Security and Privacy pane in the System Settings of your mac, scroll down in that page, and press 'Open Anyway' next to the Neurelo CLI binary name. You'll be prompted once more when trying to run the binary - click 'Open Anyway', and then you will be able to use the CLI.

## Modes

Neurelo CLI supports two modes of operations - an interactive mode and a non-interactive mode. In the interactive mode, you can enter the command without options, and you will be prompted with responses for the next steps. In the non-interactive mode, you can enter the full command, including options, and the necessary action(s) will be performed without prompts.

### - Interactive Mode

This is the mode the CLI will be in when you enter the command with no sub-options and press the Enter key. You will then be prompted on the next steps through the responses. This mode is useful when you are interacting live with the CLI as a user.

### - Non-Interactive Mode

This is the mode in the CLI when you enter the full command, including its sub-options, on one line and press the Enter key. The necessary action(s) will be performed without prompts.

## Commands

To check if the installation was successful, use the following command to display the available options for Neurelo’s CLI:

{% hint style="info" %}
Note - we are using <mark style="color:red;">`neurelo`</mark> as the name of the binary in the text that follows. Please use the name of your binary in these commands instead
{% endhint %}

```
$ neurelo 
```

Output similar to the following is displayed:

```
Usage: neurelo [command] [options]

CLI to interact with Neurelo's Data Access Platform

Options:
  -h, --help      Display all the options

Commands:
  login           Authenticate the user utilizing the Neurelo CLI
  project         Interact with projects
  env             Interact with environments from the selected project
  commit          Interact with commits from the selected project
  datasource      Interact with data sources from the selected project
  branch          Interact with branches from the selected project
  sdk             Interact with Neurelo SDKs

```

{% hint style="info" %}
Use `neurelo [command] -h` to see the available subcommands for a given command
{% endhint %}

### login

To use the Neurelo CLI, you must first login with the following command which will be redirected automatically to Neurelo's dashboard to proceed with the authentication.

```bash
$ neurelo login
```

After successful login, you can start using the CLI.

{% hint style="warning" %}
The session is valid for 1 hour after being authenticated. You may need to re-login after the session expires.&#x20;
{% endhint %}

{% hint style="success" %}
You can also create a <mark style="color:red;">`machine user`</mark> for using the CLI. Please refer to this [documentation](/guides/ci-integration-using-neurelo-cli.md) for creating and using a machine user.&#x20;
{% endhint %}

### project

This command provides support for all the projects that user has access to. The following subcommands are available for use with the`project` command:

* **get**

  Return the information from an specific project.

  * Interactive mode:

  ```bash
  $ neurelo project get
  ```

  * Options:

  `—-id` String of project id to be retrieved.

  ```bash
  $ neurelo project get --projectId <projectId>
  ```
* **ls**

  Return a list of all projects that the current user has access to.

  ```bash
  $ neurelo project ls
  ```
* **use**

  Select a project to use as part of the CLI session context.

  This subcommand is useful for interacting with other Neurelo features such as environments.

  * Interactive mode:

  ```bash
  $ neurelo project use
  ```

  * Options:

  `—-id` String of project id that will be used for the session context.

  ```bash
  $ neurelo project use --projectId <projectId>
  ```

### env

This command provides support for working with the environments that user has access to in the selected project.

{% hint style="warning" %}
Remember to select a project with \`neurelo project use\` first
{% endhint %}

Check the following subcommands to use with `env` command:

* **get**

  Return the information from a specific environment, such as environment id, environment name, project name, and the organization name.

  * Interactive mode:

  ```bash
  $ neurelo env get
  ```

  * Options:

  `—-id` (String) Environment id to be retrieved

  ```bash
  $ neurelo env get --environmentId <environmentId>
  ```
* **use**

  Select an environment to use as part of the CLI session context

  This subcommand is needed for interacting with other features that specific environment.

  * Interactive mode:

  ```bash
  $ neurelo env use
  ```

  * Options:

  `--id` String of environment id that will be selected as part of session context.

  ```bash
  $ neurelo env use --environmentId <environmentId>
  ```
* **add**

  Create a new environment for a selected project.

  * Interactive mode:

  ```bash
  $ neurelo env add
  ```

  * Options:

  If you use this subcommand with options, all options are required except for those marked as optional.

  `—-name` (String) Name for the new environment

  `—-region` (String) Region for the environment \[`us-east-2`/`us-west-2`]

  `—-commitId` (String) Commit ID that will be selected for environment. Hint: Get the commit id with `neurelo commit ls` command.

  `—-datasourceId` \[Optional] (String) Datasource id that will be attached to environment. Hint: Get data source id with `neurelo datasource ls`

  ```bash
  $ neurelo env add
  	--name <name> 
  	--region <region> 
  	--commitId <commitId> 
  	--datasourceId <dataSourceId> 
  ```
* **ls**

  Return a list of all environments that current user has access to within the selected project.

  ```bash
  $ neurelo env ls
  ```
* **update**

  Update the configuration for a selected environment. Currently the CLI supports updating the commit id. To use this subcommand it is necessary to select environment with `neurelo env use`

  * Interactive mode:

  ```bash
  $ neurelo env update 
  ```

  * Options:

  `--commitId` (String) Commit ID that will be updated

  ```bash
  $ neurelo env update --commitId <commitId>
  ```
* **start**

  Start the runners for the selected environment

  ```bash
  $ neurelo env start
  ```
* **stop**

  Stop the runners for the selected environment

  ```bash
  $ neurelo env stop
  ```

### commit

This command provides support for working with the commits in a project that the user has access to

{% hint style="info" %}
Remember to select a project with \`neurelo project use\`
{% endhint %}

Check the following subcommands to use with `commit` command:

* **ls**

  Return a list of all commits in the selected project. If you use interactive mode, this will retrieve from default branch, otherwise if you use the option specifying the branch it will return a list from selected branch.

  * Interactive mode (Default branch):

  ```bash
  $ neurelo commit ls
  ```

  * Options:

  `--branch` (String) Branch ID that will be selected to get the commit list.

  ```bash
  $ neurelo commit ls --branch <branchId>
  ```

### datasource

This command provides support for working with the data sources that the user has access to

{% hint style="info" %}
Remember to select a project with \`neurelo project use\`
{% endhint %}

Check the following subcommands to use with the`datasource` command:

* **attach**

  Attach a data source to the selected environment. To use this subcommand, first select the environment with `neurelo env use`

  * Options:

  `--id` (String) Data source id to be attached to environment.

  ```bash
  $ neurelo datasource attach --dataSourceId <datasourceId>
  ```
* **detach**

  Detach a data source from the selected environment. To use this subcommand select the environment with `neurelo env use`

  * Options:

  `--id` (String) Data source id that will be detached from environment

  ```bash
  $ neurelo datasource detach --dataSourceId <datasourceId>
  ```
* **ls**

  Return a list of all data sources in the selected environment.

  ```bash
  $ neurelo datasource ls
  ```
* **rm**

  Delete a data source from the selected project

  * Options:

  `--id` String of data source id that will be deleted

  ```bash
  $ neurelo datasource rm --dataSourceId <datasourceId>
  ```

### branch

This command provides support for working with the branches that the user has access to.

{% hint style="info" %}
Remember to select a project with \`neurelo project use\`
{% endhint %}

Check the following subcommand to use with the `branch` command:

* **ls**

  Return a list of all branches available in selected project.

  ```bash
  $ neurelo branch ls
  ```

### sdk

This command provides support for downloading the sdks that user can use from selected project.

{% hint style="info" %}
Remember to select a project with \`neurelo project use\`
{% endhint %}

Check the following subcommands to use with the `sdk` command:

* **download**

  Download the sdk for a specific language given the commit id.

  * Interactive mode:

  ```bash
  $ neurelo sdk download
  ```

  * Options:

  `--language` (String) SDK type to download \[typescript/python/golang]

  `--commitId` (String) Commit ID for which the SDK will be downloaded

  ```bash
  $ neurelo sdk download --language <languageName> --commitId <commitId>
  ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.neurelo.com/cli-preview-version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
