---
schema_version: "1"
id: 99abb87895986efd6c90d22f9b8bed24cff453c19a5d947966e0d232ab16f8b2
title: agent preview sessions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/agent/cli_reference_agent_preview_sessions.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_agent_preview_sessions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f11f7a6813335d8eda8162b2344014610cbe38a28f28986ca32dd33806841eb3
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# agent preview sessions

List all known programmatic agent preview sessions.

## Description for agent preview sessions

This command lists the agent preview sessions that were started with the "agent preview start" command and are still in the local cache. Use this command to discover specific session IDs that you can pass to the "agent preview send" or "agent preview end" commands with the --session-id flag.

Programmatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file. In this command's output table, the Agent column contains either the API name of the authoring bundle or the published agent, whichever was used when starting the session. In the table, if the same API name has multiple rows with different session IDs, then it means that you previously started multiple preview sessions with the associated agent.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |

## Examples for agent preview sessions

List all cached agent preview sessions:

```shell
sf agent preview sessions
```
<!-- prettier-ignore-end -->
