# Bolt CLI

{% hint style="info" %}

* This feature is available with the [**Paradime Bolt plan**](https://www.paradime.io/pricing)**.**&#x20;
* Your API keys ***must*** have either [Bolt Schedules Admin or Bolt Schedules Metadata Viewer](https://docs.paradime.io/app-help/developers/generate-api-keys) capabilities.
  {% endhint %}

## Trigger a Bolt Run

Using the Paradime CLI, you can trigger a run for a given Bolt schedule name.

### CLI command

```bash
paradime bolt run "<schedule_name>"
```

### Options

| Flag          | Type               | Description                                    |
| ------------- | ------------------ | ---------------------------------------------- |
| `--branch`    | *`Optional, TEXT`* | Git branch name or commit hash to checkout.    |
| `--command`   | *`Optional, TEXT`* | Command(s) to override the default commands.   |
| `--pr-number` | *`Optional, INT`*  | Pull request number to associate with the run. |
| `--wait`      |                    | Wait for the run to finish                     |
| `--json`      |                    | JSON formatted response                        |
| `--help`      |                    | Show CLI command options and exit.             |

### Examples

{% tabs %}
{% tab title="Trigger Bolt schedule run and wait for status" %}
{% hint style="info" %}
Trigger a Bolt schedule run, and return the status until is completed.
{% endhint %}

#### CLI command

```bash
paradime bolt run "daily run" --wait
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FwqCk34cVwKaRtG3LF4FY%2Fparadime_bolt_run_wait.png?alt=media&#x26;token=108b4dac-ffee-48a8-bf80-8e0de69650f7" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Trigger Bolt schedule run with command override" %}
{% hint style="info" %}
Trigger a Bolt schedule run, and override the schedule commands at runtime.
{% endhint %}

#### CLI command

```bash
paradime bolt run "daily run" --command "dbt run -s order_items", "dbt test"  --wait
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FBPfh9u0ONrXez0h697W8%2Fparadime_bolt_run_command_override.png?alt=media&#x26;token=a28f8020-a944-4909-8244-bf5972e0f1cc" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Trigger Bolt schedule run with git branch override" %}
{% hint style="info" %}
Trigger a Bolt schedule run, and override the git branch at runtime.
{% endhint %}

#### CLI command

```bash
paradime bolt run "daily run" --branch "feature-branch-123" --wait
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FMgbM8zh6cRBhtE7UNrQz%2Fparadime_bolt_run_branch_override.png?alt=media&#x26;token=7a3f0a82-8278-4228-8f31-1fcdbbe83a5c" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Download a Bolt Schedule artifacts

Using the Paradime CLI, you can download the latest artifacts of a given Bolt schedule name.

### CLI command

```bash
paradime bolt artifact
```

### Options

| Flag              | Type                  | Description                                                                                                             |
| ----------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `--schedule-name` | *`Required, TEXT`*    | The name of the Bolt schedule                                                                                           |
| `--artifact-path` | *`Optional, TEXT`*    | The path to the artifact in the Bolt run. \[default: target/manifest.json]                                              |
| `--command-index` | *`Optional, INTEGER`* | The index of the command in the schedule. Defaults to searching through all commands from the last command to the first |
| `--output-path`   | *`Optional, TEXT`*    | The path to save the artifact. Defaults to the current directory.                                                       |
| `--help`          |                       | Show CLI command options and exit.                                                                                      |

### Examples

{% tabs %}
{% tab title="Get Bolt schedule manifest.json" %}
{% hint style="info" %}
Get Bolt schedule `manifest.json` from the latest run.
{% endhint %}

#### CLI command

```
paradime bolt artifact --schedule-name "daily run"
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FvM9PHUrBdlyD7mo7eXxM%2Fparadime_bolt_artifcat_manifest.png?alt=media&#x26;token=3550258d-9d9a-4722-bc53-adfd0a02a081" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Get Bolt schedule run\_results.json" %}
{% hint style="info" %}
Get Bolt schedule `run_results.json` from the latest run.
{% endhint %}

#### CLI command

```
paradime bolt artifact --schedule-name "daily run" --artifact-path target/run_results.json
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2F2JQ0ecBdECpwWMSEPnNo%2Fparadime_bolt_artifcat_with_path.png?alt=media&#x26;token=e4e46aad-ae3f-44dc-a0e5-dfb740ac2506" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Bolt Schedules Suspend

{% hint style="danger" %}
YAML schedules **cannot** be "suspended" via the CLI.
{% endhint %}

Using the Paradime CLI, you can programmatically suspend a Bolt Schedule. This will be marked as "Paused". Schedules in "Paused" state will not run.

### CLI Command

```bash
paradime bolt schedule suspend "<schedule_name>"
```

### Examples

{% tabs %}
{% tab title="Suspend a Bolt Schedule" %}

#### CLI Command

```bash
paradime bolt schedule suspend "daily run"
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FYdhEcEJdX8scRpeLseJX%2Fimage.png?alt=media&#x26;token=a00246b3-6564-4296-b096-9de798fd3e79" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Bolt Schedules Unsuspend

{% hint style="danger" %}
YAML schedules **cannot** be "unsuspend" via the CLI.
{% endhint %}

Using the Paradime CLI, you can programmatically unsuspand a Bolt Schedule when in  a "Paused" state. This is normally used in combination with the [Bolt Schedules Suspend](#bolt-schedules-suspend) CLI command.

When a Bolt schedule is "Unsuspended", runs will resume.

### CLI Command

```bash
paradime bolt schedule unsuspend "<schedule_name>"
```

### Examples

{% tabs %}
{% tab title="Unsuspend a Bolt Schedule" %}

#### CLI Command

```bash
paradime bolt schedule unsuspend "daily run"
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FEGIB8xLjWdD58XBhi3I1%2Fimage.png?alt=media&#x26;token=31362562-56ab-43bd-9bb7-1e4315209fe7" alt=""><figcaption></figcaption></figure>

{% endtab %}
{% endtabs %}

### CLI Command

```bash
paradime bolt schedule unsuspend "<schedule_name>"
```

## Verify paradime\_schedule.yml configuration file

Using the Paradime CLI, you can verify that your paradime\_schedules.yml configuration file containting the YAML configured Bolt schedules is correct and free of errors.

### CLI Command

<pre class="language-bash"><code class="lang-bash"><strong>paradime bolt verify
</strong></code></pre>

### Options

| Flag   | Type               | Description                                                               |
| ------ | ------------------ | ------------------------------------------------------------------------- |
| --path | *`Optional, TEXT`* | Path to paradime\_schedules.yml file. \[default: paradime\_schedules.yml] |
| --help |                    | Show CLI command options and exit.                                        |

### Examples

{% tabs %}
{% tab title="Verify paradime\_schedules.yml file" %}
{% hint style="info" %}
Verify the paradime\_schedules.yml file with the Bolt schedules configurations does not contain errors.
{% endhint %}

#### CLI Command

```bash
paradime bolt verify --path /workspace/repository/dbt/paradime_schedules.yml
```

#### Example output

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FWBxq2cEqOSJ6k8HW2Wtr%2Fparadime_bolt_verify.png?alt=media&#x26;token=5f2ee89c-f829-4732-9340-798dbe4ee5be" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
