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

# Using Blnk Core

> Connect the Blnk CLI to your Core instance and verify the connection.

Use connection commands to create or confirm your connection with your Blnk Core instance before you run resource commands.

***

## `blnk connect`

Point the CLI at a Core instance, store your API key locally, and confirm the instance responds before you run resource commands. Run this after install or whenever you switch environments (sandbox, staging, production).

```bash theme={"system"}
blnk connect [url]
```

<Icon icon="brackets" size={16} color="#808080" className="cli-section-icon" /> **Arguments**

| Argument | Type   | Required | Description                                                                            |
| :------- | :----- | :------- | :------------------------------------------------------------------------------------- |
| `url`    | string | No       | The URL of the Blnk Core instance to connect to. Include the protocol (http or https). |

<Icon icon="sliders-horizontal" size={16} color="#808080" className="cli-section-icon" /> **Options**

| Option       | Type    | Description                 |
| :----------- | :------ | :-------------------------- |
| `-h, --help` | boolean | Show help for this command. |

<Icon icon="list-ordered" size={16} color="#808080" className="cli-section-icon" /> **Usage**

Run the command with or without the URL argument. If the URL is not provided, the CLI prompts for it.

<Steps>
  <Step title="Enter the instance URL and API key">
    If you did not pass a URL argument, the CLI prompts for the instance URL, then the API key:

    ```text wrap theme={"system"}
    url >
    api key >
    ```

    Press **Enter** at the API key prompt to skip if your instance does not require a key.
  </Step>

  <Step title="Verify health">
    While the CLI checks connectivity, you see a spinner such as `Testing connection health`.
  </Step>

  <Step title="You're good to go!">
    Once done, the CLI prints the success or error message.

    <CodeGroup>
      ```text 200 Success icon="circle-check" theme={"system"}
      success:
        Successfully connected to "https://api.example.com"
      ```

      ```text wrap Invalid API key icon="circle-x" theme={"system"}
      error:
        Invalid API key. Verify that the provided API key is correct and try again.
      ```

      ```text wrap Instance unreachable icon="circle-x" theme={"system"}
      error:
        Can't connect to instance. Verify the URL and ensure your instance is running.
      ```
    </CodeGroup>

    <Warning>
      If the API key is wrong, verify the key and run `connect` again.

      If the instance is unreachable, confirm it is running and reachable from your machine, then try again.
    </Warning>
  </Step>
</Steps>

***

## `blnk info`

Confirm which Core URL the CLI is using and whether the last health check succeeded, without re-entering credentials. Use it when a command fails with auth or connectivity errors and you need to verify you are on the right instance.

```bash theme={"system"}
blnk info
```

<Icon icon="sliders-horizontal" size={16} color="#808080" className="cli-section-icon" /> **Options**

| Option       | Type    | Description                 |
| :----------- | :------ | :-------------------------- |
| `-h, --help` | boolean | Show help for this command. |

<Icon icon="list-ordered" size={16} color="#808080" className="cli-section-icon" /> **Usage**

<Steps>
  <Step title="Check connection status">
    Run the command to see which instance the CLI is configured to use:

    ```bash wrap theme={"system"}
    blnk info
    ```

    The CLI prints the current server connection and whether it is connected.

    <CodeGroup>
      ```text 200 Success icon="circle-check" theme={"system"}
      Current server connection:
        https://api.example.com [+] connected
      ```

      ```text wrap Not connected icon="circle-x" theme={"system"}
      Current server connection:
        Not set [-] not connected
      ```
    </CodeGroup>
  </Step>
</Steps>
