> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# moorcheh delete-file

> Remove a file from the search index. The file on disk is kept.

## Overview

Deletes all chunks and summaries for one indexed file. Provide **exactly one** of `--path` or `--file-id`.

Poll with [moorcheh file-job-status](/on-prem/cli/files/file-job-status) (`job_type`: `file_delete`).

## Synopsis

```bash theme={null}
moorcheh delete-file --namespace-name NAME \
  (--path HOST_PATH | --file-id ID) \
  [--base-url URL]
```

## Options

| Flag        | Description                                                         |
| ----------- | ------------------------------------------------------------------- |
| `--path`    | Host path under `~/.moorcheh/uploads` (converted to `/uploads/...`) |
| `--file-id` | Id from `moorcheh list-files`                                       |

## Examples

```bash theme={null}
moorcheh delete-file --namespace-name my-documents \
  --path "%USERPROFILE%\.moorcheh\uploads\document.pdf"

moorcheh delete-file --namespace-name my-documents --file-id a1b2c3d4e5f67890
```

<Warning>
  Deleting a **namespace** (`moorcheh namespace-delete`) removes all indexed data in that namespace, including every file. That is separate from per-file delete.
</Warning>

## Related

* [API: Delete file index](/on-prem/api-references/files/delete)
