# DinoAI CLI

{% hint style="info" %}

* This feature is available with the [**Paradime DinoAI plan**](https://www.paradime.io/pricing)**.**
* Your API keys ***must*** have DinoAI Agent capabilities.
* Programmable agents are defined as YAML files under `.dinoai/agents/<name>.yml` in your workspace repository.
  {% endhint %}

### Talk to a DinoAI Agent

Using the Paradime CLI, you can talk to a DinoAI programmable agent directly from your terminal.

The `paradime dinoai` command supports two modes:

* **Interactive** — drop into a chat-style REPL and have a multi-turn conversation with the agent.
* **One-shot** — pass `--message` (or pipe a message via `stdin`), wait for the response, and exit.

In both modes, agent messages are streamed to the terminal as they arrive, rendered as markdown.

#### CLI command

```bash
paradime dinoai
```

#### Options

| Flag        | Short | Type               | Description                                                                               |
| ----------- | ----- | ------------------ | ----------------------------------------------------------------------------------------- |
| `--agent`   | `-a`  | *`Optional, TEXT`* | Named agent under `.dinoai/agents/<name>.yml`. Omit to use an ad-hoc agent.               |
| `--message` | `-m`  | *`Optional, TEXT`* | Opening message. **When provided, runs a single turn and exits** (no interactive prompt). |
| `--session` | `-s`  | *`Optional, TEXT`* | Resume an existing session by ID. The full conversation history is replayed first.        |
| `--help`    |       |                    | Show CLI command options and exit.                                                        |

{% hint style="info" %}
**Session lifetime:** A DinoAI session pod stays alive for 24 hours after its last activity. Use `--session <id>` to rejoin within that window — the agent retains full conversation context.
{% endhint %}

#### Examples

{% tabs %}
{% tab title="Start an interactive chat" %}
{% hint style="info" %}
Open an interactive prompt against a named agent. Each turn is sent to the agent and the streamed response is rendered in your terminal. Press Ctrl-C or submit an empty line to exit.
{% endhint %}

**CLI command**

```bash
paradime dinoai --agent data-quality-checker
```

**Example output**

```
Session xwzdneft6emspe0f
╭──────────────────────────────────────────────────────────────────────────────╮
│ dinoai  data-quality-checker                                                 │
│ Session xwzdneft6emspe0f  ·  blank line or Ctrl-C to exit                    │
╰──────────────────────────────────────────────────────────────────────────────╯
> Which models have no tests?
⠹ DinoAI is thinking… (RUNNING, 0:08)
```

{% endtab %}

{% tab title="One-shot: send a message and exit" %}
{% hint style="info" %}
Pass `--message` to run a single turn — the CLI triggers the agent, streams the response, and exits. Useful for ad-hoc questions or shell aliases.
{% endhint %}

**CLI command**

```bash
paradime dinoai --agent data-quality-checker --message "Which models have no tests?"
```

**Example output**

```
Session a71bc0mr6owuzb2r

Here are the models without tests in your project:

🔴 No YAML file = No tests defined
  • stg_f1__constructor_results
  • stg_f1__driver_standings
  • dim_f1__driver
  ...
```

{% endtab %}

{% tab title="One-shot: pipe a message via stdin" %}
{% hint style="info" %}
When `stdin` is piped and no `--message` is passed, the CLI reads the message from `stdin`, runs a single turn, and exits. Useful in scripts and CI.
{% endhint %}

**CLI command**

```bash
echo "Summarize today's failed dbt runs" | paradime dinoai --agent data-quality-checker
```

{% endtab %}

{% tab title="Resume an existing session" %}
{% hint style="info" %}
Use `--session <id>` to pick up where you left off. The CLI fetches the full conversation history, prints it back, and drops you into the interactive prompt for the next turn.
{% endhint %}

**CLI command**

```bash
paradime dinoai --session xwzdneft6emspe0f
```

{% endtab %}

{% tab title="Resume and send a follow-up (one-shot)" %}
{% hint style="info" %}
Combine `--session` with `--message` to send one follow-up to an existing session and exit — the history is not replayed, only the new exchange is rendered.
{% endhint %}

**CLI command**

```bash
paradime dinoai --session xwzdneft6emspe0f --message "Now generate the missing YAML files"
```

{% endtab %}
{% endtabs %}

### Aborting and rejoining a run

If a run is taking too long, you can press **Ctrl-C** at any point. This aborts only the **local view** — the agent run continues server-side. The CLI prints the session ID and the command needed to rejoin:

```
↩ aborted local view — run still RUNNING server-side.
  Rejoin with: paradime dinoai --session xwzdneft6emspe0f
```

You can then re-attach later (within the 24-hour session window) and resume streaming as soon as the agent emits new messages.

### Spinner status meanings

While a run is in flight, the CLI shows a single-line spinner labelled with the current run status and elapsed time:

```
⠹ DinoAI is thinking… (RUNNING, 0:08)
```

The status field can be one of:

| Status      | Meaning                                                                                                                      |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `QUEUED`    | The run has been accepted by the backend and is waiting for an agent pod.                                                    |
| `RUNNING`   | The agent is actively processing your message.                                                                               |
| `WAITING`   | The previous turn already returned `COMPLETED`; the backend is still transitioning the run state for your follow-up message. |
| `COMPLETED` | Terminal — the agent finished and produced a response.                                                                       |
| `FAILED`    | Terminal — the run did not complete successfully. The CLI prints the last error message.                                     |


---

# 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.paradime.io/app-help/developers/paradime-cli/dinoai-cli.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.
