datalab-cli 0.1.0

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

Create a document from markdown.

## Synopsis

```
datalab create-document [OPTIONS] --markdown <MARKDOWN>
```

## Description

Generate a Microsoft Word document (.docx) from markdown content. Useful for programmatic document generation and templating.

---

## Options

### Input Options

| Option | Description |
|--------|-------------|
| `--markdown <MARKDOWN>` | Markdown content or path to markdown file **(required)** |

### Output Options

| Option | Description | Default |
|--------|-------------|---------|
| `--output-format <FORMAT>` | Output format (currently only `docx`) | `docx` |
| `-o, --output <FILE>` | Write created document 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

### From Inline Markdown

```bash
datalab create-document \
  --markdown "# Report Title\n\nThis is the content." \
  --output report.docx
```

### From Markdown File

```bash
datalab create-document --markdown content.md --output document.docx
```

### Complex Document

```bash
cat << 'EOF' > report.md
# Quarterly Report

## Executive Summary

This quarter showed strong performance across all metrics.

## Key Metrics

| Metric | Value | Change |
|--------|-------|--------|
| Revenue | $1.2M | +15% |
| Users | 50,000 | +22% |
| Retention | 85% | +3% |

## Conclusion

The team delivered excellent results.
EOF

datalab create-document --markdown report.md --output report.docx
```

---

## Supported Markdown Features

| Feature | Support |
|---------|---------|
| Headings (H1-H6) | Yes |
| Bold, italic | Yes |
| Lists (ordered/unordered) | Yes |
| Tables | Yes |
| Code blocks | Yes |
| Links | Yes |
| Images | Yes |
| Block quotes | Yes |
| Horizontal rules | Yes |

---

## Output

When using `--output`, the document is saved to the specified file.

The JSON response includes:

```json
{
  "output_base64": "UEsDBBQAAAAI...",
  "metadata": {
    "pages": 2,
    "processing_time": 0.8
  }
}
```

Without `--output`, the base64-encoded document is included in the JSON output.

---

## Related Commands

- [`convert`]convert.md - Convert documents back to markdown
- [`track-changes`]track-changes.md - Extract changes from Word documents

---

## See Also

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