datalab-cli 0.1.0

A powerful CLI for converting, extracting, and processing documents using the Datalab API
Documentation
# track-changes

Extract track changes from a Word document.

## Synopsis

```
datalab track-changes [OPTIONS] <FILE|URL>
```

## Description

Extract tracked changes (revisions) from Microsoft Word documents (.docx). Returns the changes in HTML and/or markdown format, showing insertions, deletions, and comments.

---

## Arguments

| Argument | Description |
|----------|-------------|
| `<FILE\|URL>` | DOCX file path or URL |

---

## Options

### Output Options

| Option | Description | Default |
|--------|-------------|---------|
| `--output-format <FORMATS>` | Output formats: `html`, `markdown` (comma-separated) | `html,markdown` |
| `--paginate` | Add page markers to output | - |
| `-o, --output <FILE>` | Write result to file | - |

### Cache Options

| Option | Description |
|--------|-------------|
| `--skip-cache` | Skip local cache lookup |

### Advanced Options

| Option | Description | Default |
|--------|-------------|---------|
| `--timeout <SECS>` | Request timeout in seconds | `300` |

---

## Examples

### Basic Usage

```bash
# Extract track changes (both HTML and markdown)
datalab track-changes document.docx
```

### HTML Only

```bash
datalab track-changes document.docx --output-format html
```

### Markdown Only

```bash
datalab track-changes document.docx --output-format markdown
```

### Save to File

```bash
datalab track-changes document.docx --output changes.json
```

### With Page Markers

```bash
datalab track-changes document.docx --paginate
```

---

## Output Schema

```json
{
  "html": "<p>Original text <del>deleted text</del> <ins>inserted text</ins></p>",
  "markdown": "Original text ~~deleted text~~ **inserted text**",
  "metadata": {
    "total_changes": 15,
    "insertions": 8,
    "deletions": 5,
    "comments": 2,
    "processing_time": 1.2
  }
}
```

---

## Supported Change Types

| Type | HTML | Markdown |
|------|------|----------|
| Insertions | `<ins>text</ins>` | `**text**` |
| Deletions | `<del>text</del>` | `~~text~~` |
| Comments | `<span class="comment">text</span>` | `[comment: text]` |

---

## Related Commands

- [`convert`]convert.md - Convert documents without track changes
- [`create-document`]create-document.md - Create new documents

---

## See Also

- [Output Formats]../concepts/output-formats.md