﻿---
title: stack kb cases add-case-file cli command
description: Attach a file to a case 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/cases/add-case-file
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb cases add-case-file cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb cases add-case-file --case-id <case-id> --file <file> [options]
```

Attach a file to a case
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--case-id string required">
    The caseId parameter
  </definition>
  <definition term="--file string required">
    The file being attached to the case.
  </definition>
  <definition term="--filename string">
    The desired name of the file being attached to the case, it can be different than the name of the file in the filesystem. **This should not include the file extension.**
  </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>