---
title: "ezgh obs ai runs search"
description: "Search a dataset's agent runs, newest first."
---

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

# ezgh obs ai runs search

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh obs ai runs search --dataset d [--agent a] [--model m] [--text t] [flags]
```

Search the agent runs of a dataset: one run is one trace of GenAI spans. Without `--from`, the last hour. Times are RFC 3339, a date, or a duration ago (2h, 7d). `--text` searches prompts, completions, system instructions and tool calls and shows the first match; it needs permission to read content (obs.genai.readContent). `--sort` is startTime (the default), tokens, duration or errors.

Part of [`ezgh obs ai runs`](/cli/reference/obs-ai-runs).

## Examples

```sh
ezgh obs ai runs search --dataset production --agent support --text refund
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--agent` | string |  | only this agent |
| `--all` | boolean |  | follow nextCursor through every page |
| `--conversation` | string |  | only this conversation ID |
| `--cursor` | string |  | start from this page (a previous page's nextCursor) |
| `--dataset` | string |  | the dataset: its ID, slug or environment (required) |
| `--environment` | string |  | only this environment |
| `--from` | string |  | start of the time range (default 1h ago) |
| `--limit` | int | `25` | items per page, 1 to 100 |
| `--model` | string |  | only this model |
| `--order` | string |  | asc or desc (default desc) |
| `--provider` | string |  | only this provider |
| `--service` | string |  | only this service |
| `--sort` | string |  | startTime (default), tokens, duration or errors |
| `--status` | string |  | only runs with this status (ok or error) |
| `--text` | string |  | full text in prompts, completions and tool calls (needs permission to read content) |
| `--to` | string |  | end of the time range (default now) |
| `--tool` | string |  | only runs that called this tool |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/obs-ai-runs-search/index.mdx
