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

# Chat

> Ask a question about one processed document from the command line.

`okra chat` asks a question about a single processed document and returns a cited answer. It requires a document ID via `--doc`.

```bash theme={null}
okra chat "What was total revenue?" --doc doc-abc123
```

<Note>
  `okra chat` is the ergonomic alias for the canonical grounded command [`okra context ask`](/cli/reference). Both answer from bounded, cited context for one document.
</Note>

## Flags

| Flag             | Description                             |
| ---------------- | --------------------------------------- |
| `--doc <id>`     | Document ID to ask about (**required**) |
| `--model <name>` | Override the model                      |
| `--stream`       | Stream response tokens as they arrive   |

## Streaming

```bash theme={null}
okra chat "Summarize the key findings" --doc doc-abc123 --stream
```

With `--stream`, tokens print as they arrive. In `--json` mode the streamed answer is collected and returned as a single JSON payload.

## Machine-readable output

When stdout is not a TTY (or with `--json`), `okra chat` returns the standard envelope with the answer and any citations:

```json theme={null}
{
  "ok": true,
  "command": "chat",
  "result": { "answer": "Total revenue was $4.2M for FY2023." },
  "cost": { "usd": null },
  "citations": [],
  "next_actions": []
}
```

## Asking across multiple documents

To ask one question across several documents, group them into a collection and use [`okra collections query`](/cli/collections):

```bash theme={null}
okra collections query "Q4 Reports" "Compare revenue across companies"
```

<Tip>
  For general questions that aren't about a specific document, use a chat client connected via [MCP](/mcp/overview) rather than `okra chat`, which always operates on one document.
</Tip>
