﻿---
title: stack kb security-ai-assistant-api post-knowledge-base cli command
description: Create a KnowledgeBase Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4120/reference/elastic-cli/cli/stack/kb/security-ai-assistant-api/post-knowledge-base
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

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

```bash
elastic stack kb security-ai-assistant-api post-knowledge-base [options]
```

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

## Options

<definitions>
  <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>