﻿---
title: stack kb security-ai-assistant-api find-prompts cli command
description: Get prompts Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4075/reference/elastic-cli/cli/stack/kb/security-ai-assistant-api/find-prompts
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-ai-assistant-api find-prompts cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-ai-assistant-api find-prompts [options]
```

Get prompts
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--fields string[]">
    List of specific fields to include in each returned prompt.
    **Repeatable:** pass `--fields` multiple times to supply more than one value
  </definition>
  <definition term="--filter string">
    Search query string to filter prompts by matching fields.
  </definition>
  <definition term="--sort-field enum">
    Field to sort prompts by.
    **Values:** created_at, is_default, name, updated_at
  </definition>
  <definition term="--sort-order enum">
    Sort order, either asc or desc.
    **Values:** asc, desc
  </definition>
  <definition term="--page number">
    Page number for pagination.
  </definition>
  <definition term="--per-page number">
    Number of prompts per page.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>