# 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="/files/1vP1zxZKVRuLj47qoIL5" alt=""><figcaption><p>Import results file.</p></figcaption></figure>


---

# 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.kubolabs.io/getting-started/kuboscore/local-mode.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.
