﻿---
title: stack kb security-ai-assistant-api create-knowledge-base cli command
description: Create a KnowledgeBase for a resource Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://docs-v3-preview.elastic.dev/elastic/cli/tree/main/cli/stack/kb/security-ai-assistant-api/create-knowledge-base
---

# stack kb security-ai-assistant-api create-knowledge-base cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-ai-assistant-api create-knowledge-base \
  --resource <resource> \
  [options]
```

Create a KnowledgeBase for a resource
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--resource string required">
    The KnowledgeBase `resource` value.
  </definition>
  <definition term="--model-id string">
    ELSER modelId to use when setting up the Knowledge Base. If not provided, a default model will be used.
  </definition>
  <definition term="--ignore-security-labs">
    Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base. Defaults to `false`.
  </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>