## Documentation Index

Fetch the complete documentation index at: [/docs/llms.txt](/content/docs/llms.txt)

Use this file to discover all available pages before exploring further.

Read what Mo has said in a session. By default the command returns immediately with the transcript so far. Pass `--timeout` to wait for Mo to finish its current turn, ask a question, or reach the time limit. Use [`qa wait`](/content/docs/cli-reference/mo/commands/wait/index.html) when a script needs to wait without a time limit.

```
qa read <session-id> --timeout 290s
```

##  Arguments

<session-id>

string

required

The session to read, from the output of `qa start`.

##  Options

--timeout <duration>

string

default:"0"

Maximum time to wait for new output. Accepts `0` (return immediately) or a value such as `30s`, `2m`, or `500ms`, up to `290s`. Loop the command to follow a long session.

--from <origin>

string

default:"start"

Where to read from. `start` returns the whole transcript plus anything Mo says while the command waits. `latest` skips the existing transcript and returns only output produced while the command waits, so a polling loop does not reprint earlier messages.

--json

boolean

Print the raw response as one JSON object instead of plain text.

##  Output

In plain-text mode, the command prints each message on stdout. Two status lines can appear on stderr:

- `Mo is still working.` when the timeout ran out before Mo finished.
- `Mo was stopped.` when the session state is `stopped`, for example after `qa stop` or a stop from the dashboard.

With `--json`, the object has this shape:

```
{
  "sessionId": "<session-id>",
  "state": "waitingOnUser",
  "sessionState": "waitingOnUser",
  "displayState": "needs_you",
  "timedOut": false,
  "messages": [\
    { "role": "assistant", "text": "Which environment should I test?" }\\
  ],
  "pendingInput": {
    "id": "<input-id>",
    "question": "Which environment should I test?",
    "options": ["staging", "production"]
  }
}
```

`displayState` is the session’s state as the UI shows it, the same word [`qa status`](/content/docs/cli-reference/mo/commands/status/index.html) reports: `needs_you`, `running`, `waiting_on_agents`, `failed_start`, `cancelled`, `ready`, or `sleeping`. `state` and `sessionState` carry the lifecycle value (`starting`, `working`, `waitingOnUser`, `waitingOnAgents`, `idle`, or `stopped`); `state` is the legacy field kept for shipped clients such as `qa wait`. Servers running an earlier API omit `displayState`; use `qa status` for the display word on those. `timedOut` is `true` when the command returned because the timeout ran out while Mo was still working. `pendingInput` is present only when Mo is waiting for an answer; reply with [`qa send`](/content/docs/cli-reference/mo/commands/send/index.html).

##  Examples

Follow a session until Mo stops working:

```
while true; do
  output=$(qa read "$session_id" --from latest --timeout 290s --json) || exit $?
  jq -r '.messages[].text' <<<"$output" || exit $?
  timed_out=$(jq -r .timedOut <<<"$output") || exit $?
  [[ "$timed_out" == true ]] || break
done
```

##  Notes

Reading does not remove messages from the session. For a snapshot of the session state and its findings, run [`qa status`](/content/docs/cli-reference/mo/commands/status/index.html) instead.
