## bee document edit

Edit a document

Update the title or emoji, or replace the entire document body. Pass an empty value to clear a field. Use `--body-file -` to read the body from stdin.

The body is the Pandoc Markdown that `bee document view --json plain` returns, which keeps the document structure in attributes such as `{#H-1}`. Edit that Markdown and send it back, keeping the attributes you do not mean to change: a heading sent without its ID loses it, which breaks links to it. Backlog applies only the difference, so untouched parts and people editing in the browser are not disturbed.

### Usage

```sh
bee document edit [flags] <DOCUMENT>
```

### Arguments

- `DOCUMENT`: Document ID

### Flags

- `-t, --title <text>`: New title of the document
- `--emoji <emoji>`: New emoji for the document
- `-b, --body <text>`: New Markdown body of the document
- `--body-file <path>`: Read the new Markdown body from a file or stdin
- `--json <fields>`: Output as JSON (optionally filter by field names, comma-separated)
- `-s, --space <hostname>`: Space hostname (e.g. xxx.backlog.com, or your own domain)
- `-y, --yes`: Skip confirmation prompt

### Examples

Update the title

```sh
bee document edit 12345 -t "Meeting Notes"
```

Remove the emoji

```sh
bee document edit 12345 --emoji ""
```

Save the body as Markdown to edit locally

```sh
bee document view 12345 --json plain | jq -r .plain > notes.md
```

Replace the body with the edited file

```sh
bee document edit 12345 --body-file notes.md
```

### Environment variables

- `BACKLOG_SPACE`: Space hostname (e.g. xxx.backlog.com, or your own domain)
- `BACKLOG_API_KEY`: Authenticate with an API key
- `BACKLOG_SPACE`: Space hostname
