> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hunch.tools/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bash

> Reference documentation for the `hunch` CLI available in the Code Runner

## `hunch input`

Loads and outputs the input JSON.

**Example:**

<CodeGroup>
  ```bash Command theme={null}
  hunch input
  ```

  ```json Output theme={null}
  {
      "instructions": "The instructions on the code runner block",
      "blocks": [
          {
              "title": "Block 1",
              "output": "This is the content/output of Block 1",
              "files": [
                  {
                      "media/type": "image/png",
                      "url": "https://example.com/this-is-the-download-url.png"
                  }
              ]
          },
          {
              "title": "Block 2",
              "output": "This is the content/output of Block 2"
          }
      ]
  }
  ```
</CodeGroup>

***

## `hunch compiled-prompt`

Prints the compiled prompt.

**Options:**

* `--instructions / --no-instructions`: Whether to include the instructions of the code runner block. Default is `--no-instructions`.
* `--titles / --no-titles`: Whether to include the titles of the blocks. Default is `--titles`.

**Example:**

<CodeGroup>
  ```bash Command theme={null}
  hunch compiled-prompt --instructions
  ```

  ```text Output theme={null}
  The instructions on the code runner block

  Block 1:
  This is the content/output of Block 1

  Block 2:
  This is the content/output of Block 2
  ```
</CodeGroup>

***

## `hunch extract-url`

Extracts the first URL from the compiled prompt.

**Example:**

<CodeGroup>
  ```bash Command theme={null}
  hunch extract-url
  ```

  ```text Output theme={null}
  https://example.com
  ```
</CodeGroup>

***

## `hunch extract-urls`

Extracts all URLs from the compiled prompt.

**Example:**

<CodeGroup>
  ```bash Command theme={null}
  hunch extract-urls
  ```

  ```text Output theme={null}
  https://example.com/first
  https://example.com/second
  ```
</CodeGroup>

***

## `hunch block`

Select and apply commands to a single input block to the code runner. Running
this without any subcommands will output the JSON for the selected block.

**Options:**

* `--title TEXT`: The title of the block to fetch
* `--ititle TEXT`: The case-insensitive title of the block to fetch

**Subcommands:**

* `output`: Prints the output of the block
* `extract-url`: Extracts the first URL from the output of the block
* `extract-urls`: Extracts all URLs from the output of the block

**Examples:**

<CodeGroup>
  ```bash Command theme={null}
  hunch block --title "Block 2"
  ```

  ```json Output theme={null}
  {
      "title": "Block 2",
      "output": "This is the content/output of Block 2"
  }
  ```
</CodeGroup>

<br />

<CodeGroup>
  ```bash Command theme={null}
  hunch block output --title "Block 2"
  ```

  ```text Output theme={null}
  This is the content/output of Block 2
  ```
</CodeGroup>

<br />

<CodeGroup>
  ```bash Command theme={null}
  hunch block extract-url --title "Block 1"
  ```

  ```text Output theme={null}
  https://example.com
  ```
</CodeGroup>

<br />

<CodeGroup>
  ```bash Command theme={null}
  hunch block extract-urls --title "Block 2"
  ```

  ```text Output theme={null}
  https://example.com/first
  https://example.com/second
  ```
</CodeGroup>

***
