# Use the Agentic Data Plane CLI

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [agentic-data-plane-full.txt](https://docs.redpanda.com/agentic-data-plane-full.txt)

---
title: Use the Agentic Data Plane CLI
latest-operator-version: v26.2.1
latest-console-tag: v3.10.0
latest-connect-version: 4.105.0
latest-redpanda-tag: v26.2.1
docname: index
page-component-name: agentic-data-plane
page-version: master
page-component-version: master
page-component-title: Agentic Data Plane
page-relative-src-path: index.adoc
page-edit-url: https://github.com/redpanda-data/adp-docs/edit/main/modules/cli/pages/index.adoc
description: Manage Agentic Data Plane resources from the terminal with rpk ai. Install the CLI, connect it to an AI Gateway, and script LLM providers, MCP servers, OAuth, and agents.
page-topic-type: how-to
personas: platform_engineer, agent_builder
learning-objective-1: Install the Agentic Data Plane CLI and connect it to an AI Gateway
learning-objective-2: "Manage Agentic Data Plane resources from the terminal: LLM providers, MCP servers, OAuth providers and clients, and agents"
learning-objective-3: Format command output for scripts and pipelines
page-git-created-date: "2026-06-26"
page-git-modified-date: "2026-08-10"
---

<!-- Source: https://docs.redpanda.com/agentic-data-plane/cli.md -->

The Agentic Data Plane command-line interface, `rpk ai`, manages [Agentic Data Plane](https://docs.redpanda.com/agentic-data-plane/reference/glossary/#agentic-data-plane) resources from your terminal. It drives the same control surface as the Agentic Data Plane UI: [large language model (LLM)](https://docs.redpanda.com/agentic-data-plane/reference/glossary/#large-language-model-llm) providers, Model Context Protocol (MCP) servers, OAuth providers and clients, and agents. Because every action is a command, you can script it and run it in continuous integration.

The Agentic Data Plane CLI, also called the Redpanda AI CLI, runs as an [`rpk`](https://docs.redpanda.com/agentic-data-plane/reference/rpk/rpk-ai/rpk-ai/) plugin, so you install and run it through your existing `rpk` setup.

After reading this page, you will be able to:

-   Install the Agentic Data Plane CLI and connect it to an AI Gateway

-   Manage Agentic Data Plane resources from the terminal: LLM providers, MCP servers, OAuth providers and clients, and agents

-   Format command output for scripts and pipelines


![rpk ai workflow. Install the rpk ai plugin, sign in and select an Agentic Data Plane environment, then manage LLM providers, MCP servers, OAuth resources, and agents; list or call MCP tools and send A2A messages; or launch supported coding agents through AI Gateway. These workflows share the selected identity and environment.](_images/rpk-ai-workflow.svg)

Figure 1. `rpk ai` reuses one authenticated environment across resource, protocol, and agent workflows

## [](#install-the-cli)Install the CLI

The Agentic Data Plane CLI is an `rpk` managed plugin. Install `rpk` first (see [Install or Update rpk](https://docs.redpanda.com/agentic-data-plane/reference/rpk-install/)), then install the plugin:

```bash
rpk ai install
```

Update the plugin later with [`rpk ai upgrade`](https://docs.redpanda.com/agentic-data-plane/reference/rpk/rpk-ai/rpk-ai-upgrade/), and remove it with [`rpk ai uninstall`](https://docs.redpanda.com/agentic-data-plane/reference/rpk/rpk-ai/rpk-ai-uninstall/).

> 📝 **NOTE**
>
> Upgrading `rpk` does not upgrade the plugin. The plugin is a separate binary that stays at its installed version, even across `rpk` upgrades, until you run `rpk ai upgrade`. New commands and flags in the reference marked "introduced in ai version X" require the plugin at that version or later.

## [](#connect-to-an-ai-gateway)Connect to an AI Gateway

The `rpk ai` command is self-contained: it has its own login and its own environment selection, independent of any `rpk cloud` session. You sign in once, choose an Agentic Data Plane environment, and `rpk ai` targets that environment’s AI Gateway for every command.

1.  Sign in to Agentic Data Plane. This runs an OAuth device-authorization flow in your browser, caches credentials in `~/.rpai/credentials` (readable only by you), then lists the Agentic Data Plane environments in your organization so you can pick one:

    ```bash
    rpk ai auth login
    ```

2.  List the environments available to you, and switch the active one by name or ID:

    ```bash
    rpk ai env list
    rpk ai env use <environment>
    ```

    In these commands, `<environment>` is the name or ID of an Agentic Data Plane environment. `rpk ai env use` switches the active environment, pointing the CLI at that environment’s AI Gateway. Inspect the resolved environment and token state at any time with `rpk ai env show` and `rpk ai auth status`.

3.  Verify the connection:

    ```bash
    rpk ai llm-provider list
    ```


For the full setup walkthrough, including token expiry behavior and the supported environment variables, see [Use `rpk ai` for local development](https://docs.redpanda.com/agentic-data-plane/gateway/connect-agent/#authenticate-with-rpk-ai).

To target a different AI Gateway URL for a single command without switching environments, pass `--rpai-endpoint`:

```bash
rpk ai --rpai-endpoint https://aigw.<cluster-id>.clusters.rdpa.co llm-provider list
```

This overrides the selected environment’s AI Gateway URL for that one command; the flag is not bound to an environment variable. For a local or manual gateway you use repeatedly, define it once as an environment with `rpk ai env add`:

```bash
rpk ai env add local --ai-gateway-url http://localhost:8090 --auth-mode none
rpk ai env use local
```

## [](#manage-resources)Manage resources

Each Agentic Data Plane resource has its own command group, and each group supports the standard `create`, `get`, `list`, `update`, and `delete` actions. The model catalog is read-only.

| Command | Manages |
| --- | --- |
| rpk ai llm-provider | LLM providers (OpenAI, Anthropic, Google, AWS Bedrock, and OpenAI-compatible endpoints) |
| rpk ai mcp-server | MCP servers and their tools |
| rpk ai oauth-provider | OAuth providers for user-delegated MCP connections |
| rpk ai oauth-client | OAuth clients that external tools use to reach an MCP server |
| rpk ai agent | Agents in the agent registry |
| rpk ai model | The model catalog (read-only discovery) |

For example, to create and inspect an LLM provider:

```bash
rpk ai llm-provider create --name openai --type openai --api-key-ref OPENAI_API_KEY
rpk ai llm-provider get openai
```

In this command, `--api-key-ref` names a secret already stored in Agentic Data Plane. The CLI never takes a raw API key, so secrets stay out of your shell history and out of any file you commit.

To create, update, and delete resources declaratively from YAML manifests instead of imperative flags, see [Manage Resources with GitOps](gitops/).

## [](#format-command-output)Format command output

Every `list` and `get` command honors `-o` (`--format`):

| Format | Use |
| --- | --- |
| table | Default. Human-readable columns. |
| wide | Table with extra columns. |
| json | Machine-readable JSON for scripts and jq. |
| yaml | YAML. A get -o yaml dump is a complete manifest you can edit and reapply. |
| markdown | Pipe-friendly tables for documents. |

Set a default for the session with the `RPAI_FORMAT` environment variable. The `-o` flag always wins when both are set.

## [](#next-steps)Next steps

-   [Manage Resources with GitOps](gitops/)

-   [Configure an LLM Provider](https://docs.redpanda.com/agentic-data-plane/gateway/configure-provider/)

-   [rpk ai](https://docs.redpanda.com/agentic-data-plane/reference/rpk/rpk-ai/rpk-ai/)