# Local mode

{% hint style="warning" %}
The following content assumes you have [**`kubectl` binary**](https://kubernetes.io/docs/tasks/tools/#kubectl) **installed**, as well as a **privileged access** to your cluster.
{% endhint %}

## Get KuboScore

[Download KuboScore CLI](https://www.kuboscore.io/client) on a machine that has access to your cluster.

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

```bash
# Retrieve KuboScore CLI latest version string
export KS_VERSION=$(curl -s https://download.kuboscore.io/binaries/kuboscore-cli-latest.txt)

# Download latest version of KuboScore CLI with curl
curl -O https://download.kuboscore.io/binaries/kuboscore-cli-$KS_VERSION-linux-amd64

# Allow binary execution
chmod +x ./kuboscore-cli-$KS_VERSION-linux-amd64
```

{% endtab %}

{% tab title="MacOS" %}

```bash
# Retrieve KuboScore CLI latest version string
export KS_VERSION=$(curl -s https://download.kuboscore.io/binaries/kuboscore-cli-latest.txt)

# Download latest version of KuboScore CLI with curl
curl -O https://download.kuboscore.io/binaries/kuboscore-cli-$KS_VERSION-darwin-amd64

# Allow binary execution
chmod +x ./kuboscore-cli-$KS_VERSION-darwin-amd64
```

{% endtab %}

{% tab title="Windows (PowerShell)" %}

```powershell
# Retrieve KuboScore CLI latest version string
Set-Variable -Name "KSVersion" -Value (Invoke-WebRequest -UseBasicParsing -URI https://download.kuboscore.io/binaries/kuboscore-cli-latest.txt).Content

# Download latest version of KuboScore CLI with Invoke-WebRequest
Invoke-WebRequest -URI "https://download.kuboscore.io/binaries/kuboscore-cli-$(Get-Variable -Name "KSVersion" -ValueOnly)-windows.exe" -OutFile ".\kuboscore-cli-$(Get-Variable -Name "KSVersion" -ValueOnly)-windows.exe"
```

{% endtab %}
{% endtabs %}

> Note: you can check the integrity of your download with the following [checksum file](https://download.kuboscore.io/binaries/sha256.sum).

## Usage

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

```bash
# Execute KuboScore CLI
./kuboscore-cli-$KS_VERSION-linux-amd64 --kubeconfig ~/.kube/config
```

{% endtab %}

{% tab title="MacOS" %}

```bash
# Execute KuboScore CLI
./kuboscore-cli-$KS_VERSION-darwin-amd64 --kubeconfig ~/.kube/config
```

{% endtab %}

{% tab title="Windows (PowerShell)" %}

```powershell
# Retrieve KuboScore CLI latest version string
Set-Variable -Name "KSVersion" -Value (Invoke-WebRequest -UseBasicParsing -URI https://download.kuboscore.io/binaries/kuboscore-cli-latest.txt).Content

# Execute KuboScore CLI
.\kuboscore-cli-$(Get-Variable -Name "KSVersion" -ValueOnly)-windows.exe `
  --kubeconfig %USERPROFILE%\.kube\config
```

{% endtab %}
{% endtabs %}

| Option                   | Description                                                                                                                                                                                                                                   |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--kubeconfig`, `-k`     | <p><strong>Set </strong><em><strong>kubeconfig</strong></em><strong> file to use</strong><br>Defaults to value of <code>KUBECONFIG</code> environment variable or default config file location (usually <code>$HOME/.kube/config</code>).</p> |
| `--export`, `-e`         | <p><strong>Set exported results filename</strong><br>Defaults to <code>kuboscore-results-YYYYMMDD-HHmmss</code> (eg: <code>kuboscore-results-20230126-181857</code>).</p>                                                                     |
| `--confirm-target`, `-y` | **Automatically confirm target cluster**                                                                                                                                                                                                      |
| `--accept-license`       | <p><strong>Automatically accept license</strong><br>(make sure to review the license before using this flag).</p>                                                                                                                             |
| `--cleanup`              | <p><strong>Clean remaining KuboScore resources (if needed)</strong><br>Keep in mind that resources are automatically removed after the execution. This option is only useful if you killed the process while it was running.</p>              |

## Import results in KuboScore

After the scoring is done, you will get a **results file** that you can import on the KuboScore website.

{% hint style="info" %}
Uploading your results file will allow you to **get more details** and **keep track** of your previous analysis from one **central place**.
{% endhint %}

1. Go to [KuboScore](https://www.kuboscore.io)
2. Sign in to your account
3. Go to [your scorings](https://www.kuboscore.io/scores)
4. Use the import feature to upload the results file
5. Review your results!

<figure><img src="https://1027538846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FALaQyn9R5AiEIcVCAxPW%2Fuploads%2FpDEUVgAYgS74VPJrsSw1%2Fkuboscore-import-offline-results.png?alt=media&#x26;token=c7d83bcf-9d6e-4997-ad65-523c1db36284" alt=""><figcaption><p>Import results file.</p></figcaption></figure>
