# Install and Configure the Immuta CLI

This page details how to install the Immuta CLI and tab completions.

## 1 - Install the Immuta CLI

{% hint style="danger" %}
**macOS CLI Binary Warning**: When installing the macOS CLI binary, macOS displays the warning "could not verify that this app is free from malware" when the binary is run. Navigate to the **Security & Privacy** section in your System Preferences to allow the binary to be run.
{% endhint %}

Download the binary that corresponds to your operating system.

{% tabs %}
{% tab title="Linux" %}
The latest stable binaries can be found here:

**Linux x86\_64 (amd64)**

```shell
curl -Lo immuta https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta_cli_linux_amd64 && chmod +x immuta
```

**Linux ARMv8 (arm64)**

```shell
curl -Lo immuta https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta_cli_linux_arm64 && chmod +x immuta
```

{% endtab %}

{% tab title="MacOS" %}
The latest stable binaries can be found here:

**Darwin x86\_64 (amd64)**

```shell
curl -Lo immuta https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta_cli_darwin_amd64 && chmod +x immuta
```

**Darwin ARMv8 (arm64)**

```shell
curl -Lo immuta https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta_cli_darwin_arm64 && chmod +x immuta
```

{% endtab %}

{% tab title="Windows" %}
The latest stable binary can be found here: <https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta_cli_windows_amd64>.

Download and add the binary to a directory in your system's $PATH as `immuta.exe`.
{% endtab %}
{% endtabs %}

*The SHA 256 checksum is available to verify the file at* [*https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta\_cli\_SHA256SUMS*](https://immuta-platform-artifacts.s3.amazonaws.com/cli/latest/immuta_cli_SHA256SUMS)*.*

## 2 - Configure the CLI with Your Immuta Tenant

1. Run `immuta configure`.
2. Enter the URL of your Immuta tenant in the interactive prompt.
3. Enter your Immuta API Key in the interactive prompt:

```bash
$ immuta configure
? What is the url of the immuta instance you use?: https://your.instance.url.com/
? What is the api key of your immuta user account?:  ***************************Updated the config at /Users/user/.immutacfg.yaml
```

Below is the configuration file that will be saved at `~/.immutacfg.yaml`:

```yaml
default:

  api_key: <apiKey>

  host: https://your.immuta.url.com
```

## 3 - Install Tab Completions

To generate shell completion scripts for Immuta CLI commands, run `immuta completion [bash|zsh|fish|powershell]`. You can opt to specify `-h` or `--help` for instructions on installing tab completions for Bash, Zsh, Fish, and PowerShell commands and flags.

Use the tabs below for specific instructions for each of these shells.

{% tabs %}
{% tab title="Bash" %}

1. Install bash-completion <https://github.com/scop/bash-completion>.
2. Add this to your `~/.bash_profile`:

   ```bash
   eval "$(immuta completion bash)"
   ```

{% endtab %}

{% tab title="Zsh" %}

1. Generate an `_immuta` completion script and save it in your `$fpath`:

   ```zsh
   immuta completion zsh > /usr/local/share/zsh/site-functions/_immuta
   ```
2. Ensure that the following is present in your `~/.zshrc`:

   ```zshrc
   autoload -U compinit
   compinit -i
   ```

{% endtab %}

{% tab title="Fish" %}
Generate an `immuta.fish` completion script:

```fish
immuta completion fish > ~/.config/fish/completions/immuta.fish
```

{% endtab %}

{% tab title="PowerShell" %}

1. Run `immuta completion powershell | Out-String | Invoke-Expression`.
2. To load completions for every new session, run

   ```powershell
   immuta completion powershell > immuta.ps1
   ```
3. Source this `immuta.ps1` from your PowerShell profile.
   {% endtab %}
   {% endtabs %}

The exact configuration file locations might vary based on your system. Make sure to restart your shell before you test whether completions are working.
