# Installing Chasm Inference Scout via CLI

## Introduction

For advanced users and those looking to automate their setup process, Chasm Inference Scout can be installed using the Command Line Interface (CLI). This method provides greater flexibility and control over the installation process.

The CLI installation relies on [Homebrew](https://brew.sh/), a popular package manager for macOS and Linux systems. Homebrew simplifies the process of installing, updating, and managing software packages, making it an ideal tool for our Scout setup.

This guide will walk you through the step-by-step process of installing Homebrew (if you haven't already) and then using it to install the Chasm Inference Scout. Whether you're setting up multiple instances or integrating the installation into your automated workflows, this CLI method will prove invaluable.

## Installing Homebrew on Ubuntu

### Prerequisites

* Ubuntu operating system
* Sudo privileges
* Docker installed: Follow the [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/)

### Installation Steps

{% hint style="info" %}
If you're using DigitalOcean, you probably will want to follow the [guide below](#common-errors-and-solutions)
{% endhint %}

#### 1. Run the Installation Script

Open a terminal and run the following command to start the Homebrew installation:

```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

#### 2. Configure the Environment

After successful installation, add Homebrew to your PATH by appending the following to your `.bashrc` file:

```bash
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> ~/.bashrc
```

#### 3. Apply the Changes

Run the following command to apply the changes to the current session:

```bash
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
```

#### 4. Install Build Essentials

Install the necessary build tools:

```bash
sudo apt-get install build-essential
```

### Common Errors and Solutions

{% hint style="warning" %}

#### Error: Don't run this as root!

{% endhint %}

If you see the following error:

```
==> Checking for `sudo` access (which may request your password)...
Don't run this as root!
```

**Solution**: If you encounter this error, you'll need to create a new user and install Homebrew using that account. Follow these steps:

1. Create a new user:

   ```bash
   sudo adduser brewuser
   sudo usermod -aG sudo brewuser
   ```
2. Switch to the new user and run the installation script:

   ```bash
   sudo -u brewuser 
   bash -c '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
   ```
3. Configure the environment for the new user:

   ```bash
   (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/brewuser/.bashrc
   ```
4. Apply the changes:

   ```bash
   eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
   ```
5. Install build essentials:

   ```bash
   sudo apt-get install build-essential
   ```

## Installing Chasm Inference Scout

Once you have Homebrew set up on your system, you can proceed with the installation of Chasm Inference Scout using the following commands:

#### 1. Add the Chasm Network Tap

First, we need to add the Chasm Network tap to Homebrew. A tap is a third-party repository for Homebrew formulas. Run the following command:

```bash
brew tap ChasmNetwork/tap
```

This command tells Homebrew to track the repository of Chasm Network, allowing you to install their custom packages.

#### 2. Install Chasm CLI

After adding the tap, you can install the Chasm CLI by running:

```bash
brew install chasm-cli
```

This command will download and install the Chasm Inference Scout CLI tool on your system.

## Running Chasm CLI

After successfully installing Chasm CLI, you can start using it by simply running the `chasm` command in your terminal. This command serves as the entry point for all Chasm-related operations.&#x20;

To setup a new scout, select the following in the CLI:

`Choose an option: Setup new scout`

<figure><img src="https://3640688233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoDYYIBTYFerp1E0aQIKD%2Fuploads%2F6adDdm7ADAK8nIh2QAmW%2FScreenshot%202024-08-13%20at%2011.42.27%E2%80%AFAM.png?alt=media&#x26;token=af4f4807-10b9-4d6b-a202-08dd230579a1" alt=""><figcaption></figcaption></figure>

You'll be able to select the NFT to set up, and the rest of steps are similar to the [regular setup guide](https://network-docs.chasm.net/chasm-scout-season-0/chasm-inference-scout-setup-guide).&#x20;

{% hint style="info" %}
Note that the 'View My Scout' functionality is still under work progress
{% endhint %}
