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

# Managed Agents CLI (ag)

> Run managed agent sessions, manage presets and skills, and enable, browse, and trigger Signal from your terminal with the ag CLI.

> [!NOTE]
>
> Managed agents are available on **Enterprise**. Signal is available on all Arize AX plans. See [Pricing and usage](/docs/ax/security-and-settings/pricing-and-usage) for plan limits.

The `ag` CLI is the terminal and TUI client for [managed agents](/docs/ax/agents/build-your-own-agent) and [Signal](/docs/ax/observe/signal). It talks to the Arize GraphQL API with your API key and a space, and lets you:

* Run and follow **managed agent sessions** (one sandboxed agent run each)
* Manage **presets** (reusable agent configs) and **skills** (credentials injected into the sandbox)
* Enable Signal on a project, browse its **issues**, and **trigger a Signal run now**
* Open an interactive **TUI** by running `ag` with no arguments

> [!NOTE]
>
> `ag` is not the [`ax` CLI](/docs/api-clients/cli/overview). Use `ax` for platform resources (spaces, projects, traces, datasets, evaluators, prompts). Use `ag` for the agent runtime: sessions, presets, skills, automations, and Signal. The two tools accept the same Arize API key.

| Tool | Auth | Use for |
| - | - | - |
| `ag` | API key + space | Sessions, presets, skills, automations, Signal |
| [`ax`](/docs/api-clients/cli/overview) | AX profiles | Spaces, projects, traces, datasets, evaluators, prompts |
| [GraphQL API](/docs/ax/graphql-reference/guides/managed-agents-and-signal) | API key | Everything `ag` does, from your own code |

## Getting Started

### 1. Install the CLI

> [!NOTE]
>
> Requires Go on your `PATH`. The binary installs to `~/go/bin`; keep that directory on your `PATH`.

From the root of the Arize source repository:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
go install ./go/cmd/ag
ag help
```

To run it without installing:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
go run ./go/cmd/ag -- help
```

> [!NOTE]
>
> Prebuilt binaries and a Homebrew formula are not published yet. Contact your Arize account team if you need access to the source repository.

### 2. Save a context

Every space-scoped command needs a **space ID** (the `/spaces/<id>` segment of any Arize URL) and an **API key**. Save both once so you do not have to pass them on every command:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
export ARIZE_API_KEY=<your-api-key>
ag context set --space <space-id> --api-key-env ARIZE_API_KEY
```

`--api-key-env` stores the *name* of the environment variable, never the key itself. Run `ag context show` to confirm what was saved.

### 3. Verify your setup

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ag context show          # Saved space, endpoint, and API key variable
ag session list          # Recent managed agent sessions in the space
ag signal project list   # Projects with Signal enabled
```

***

## Configuration

### Context file

`ag context set` writes `~/.arize/ag_context.toml` with three values: the default space, the GraphQL endpoint, and the name of the environment variable that holds your API key. Flags passed on the command line override the saved values for that invocation.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ag context                 # Show saved context and usage
ag context show            # Saved context as JSON
ag context set --space <space-id> --api-key-env ARIZE_API_KEY
ag context set --endpoint https://app.arize.com/graphql
ag context unset           # Clear the saved context
```

| Option | Description |
| - | - |
| `--space` | Default space ID |
| `--endpoint` | Default GraphQL endpoint. A bare host is normalized to `https://<host>/graphql`. |
| `--api-key-env` | Name of the environment variable that holds your API key |

### Authentication

`ag` looks for an API key in this order and uses the first one it finds:

1. `--api-key <key>` on the command
2. `--api-key-env <VAR>` on the command or in the saved context
3. The `ARIZE_API_KEY` environment variable
4. The [`ax` profile](/docs/api-clients/cli/profiles) named by `--profile`, or the active `ax` profile

> [!WARNING]
>
> Reusing `ax` profiles is wired but not yet reliable. Prefer `--api-key-env` or `ARIZE_API_KEY`.

### Endpoint

The GraphQL endpoint is resolved in this order:

1. `--endpoint` on the command, or the saved context
2. The `ax` profile's GraphQL routing, when `--profile` is used
3. The `ARIZE_GRAPHQL_ENDPOINT` environment variable
4. `https://app.arize.com/graphql`

Self-hosted and VPC deployments set `--endpoint` to their own host. The path must be empty or `/graphql`.

***

## Options & Output

### Common Options

Every command except `ag context` accepts these options:

| Option | Description |
| - | - |
| `--profile` | `ax` profile name to read credentials from |
| `--api-key` | Arize API key override |
| `--api-key-env` | Name of the environment variable containing the API key |
| `--endpoint` | GraphQL endpoint override |
| `--output` | Output format: `text` (default) or `json` |
| `--verbose` | Log every GraphQL request |

`--space` is accepted by the commands that are scoped to a space: `session list`, `session create`, `signal project list`, `automation list`, and the TUI. It falls back to the saved context.

### Output Formats

With `--output text`, list commands print a table and accept `--columns` to choose and order the columns. With `--output json`, they print the full objects, including fields that have no column.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ag session list --columns id,status,prompt,created_at
ag session list --output json | jq '.[].id'
```

### IDs

Every ID that `ag` prints or accepts is a relay ID (a base64 string), not a numeric database ID. Copy IDs from `ag ... list` output or from the Arize URL.

### Aliases

Resource names have aliases, so these are the same command:

* `ag session` = `ag sessions` = `ag jobs`
* `ag preset` = `ag presets` = `ag agents`
* `ag skill` = `ag skills` = `ag integration` = `ag integrations`
* `ag automation` = `ag automations`
* `ag signal` = `ag signals`

These docs use `session`, `preset`, and `skill`.

***

## Interactive TUI

Run `ag` with no subcommand to open a home menu with two areas: **Sessions** (create and inspect sessions) and **Signal** (browse Signal issues for a project). Press `esc` to return to the home menu and `q` to quit.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ag                         # Home menu
ag --space <space-id>      # TUI in a specific space
ag signal                  # Jump to the Signal project picker
ag resume <session-id>     # Attach to a session's live transcript
```

Any subcommand skips the TUI and prints to stdout.

***

## Command cheat sheet

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ag [flags]                                  TUI home
ag resume <session-id>
ag session    list | show | create | send | events | artifacts | delete
ag preset     list | show | create | update | delete
ag skill      list | create | update | delete
ag automation list | trigger
ag signal                                   TUI project picker
ag signal project  list [--all] | show <project-id> | create <project-id> | delete <project-id>
ag signal issue    list <project-id> | show <issue-id>
ag context    show | set | unset
```

***

## Resources

> **[Sessions](/docs/api-clients/ag/sessions)**
>
> Create, message, follow, and inspect managed agent runs

> **[Presets](/docs/api-clients/ag/presets)**
>
> Reusable agent configs: repo, provider, and skills

> **[Skills](/docs/api-clients/ag/skills)**
>
> Credentials injected into the sandbox as environment variables

> **[Automations](/docs/api-clients/ag/automations)**
>
> List scheduled runs and trigger one now

> **[Signal](/docs/api-clients/ag/signal)**
>
> Enable Signal on a project and browse its issues

> **[GraphQL guide](/docs/ax/graphql-reference/guides/managed-agents-and-signal)**
>
> The same operations from your own code

## Related docs

* [Managed agents](/docs/ax/agents/build-your-own-agent) — The gallery, agent configs, sessions, and automations in the UI
* [Connect your harness](/docs/ax/agents/connect-your-harness) — Credentials, skills, permissions, and sandbox boundaries
* [Signal](/docs/ax/observe/signal) — Ranked issues on a tracing project
* [AX CLI](/docs/api-clients/cli/overview) — The `ax` CLI for platform resources
