# matrixone-docs

Search and read the [official MatrixOne](https://www.matrixorigin.cn/) SQL documentation from the terminal.

## Quick Start

```bash
bash scripts/fetch-index.sh
bash scripts/search-docs.sh "DATE_FORMAT"
bash scripts/search-docs.sh "JOIN" --kind sql --limit 5
bash scripts/read-doc.sh "MatrixOne/Reference/Functions-and-Operators/Datetime/date-format/"
```

## Prerequisites

- `curl` and `bash` (macOS/Linux)

## Configuration

| Method | Example |
|--------|---------|
| Environment variable | `export MO_DOCS_VERSION="3.0.13"` |
| CLI flag | `--version 3.0.13` |
| Default | `3.0.13` |

## Document Kinds

| Kind | Description |
|------|-------------|
| `sql` | SQL reference (DDL, DML, etc.) |
| `function` | Built-in functions |
| `operator` | Operators |
| `all` | Search across all kinds (default) |

## How It Works

The scripts download LLM-friendly indexes from `docs.matrixorigin.cn` and cache them under `cache/v{version}/` for subsequent searches.
