> For the complete documentation index, see [llms.txt](https://stemma.sh/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stemma.sh/docs/getting-started.md). Agents can also search and read this documentation through its [MCP server](https://stemma.sh/docs/~gitbook/mcp).

# Create your first redline

Use this guide when you have an original Word document and a revised version. By the end, you will have one new `.docx` containing native tracked changes that a reviewer can accept or reject in Microsoft Word.

## What you need

* Rust and Cargo, if the `stemma` CLI is not installed yet.
* The original `.docx`.
* The revised `.docx`.
* A new path for the output. The CLI never overwrites an existing file.

## 1. Install the CLI

```bash
cargo install stemma-cli
```

Confirm the command is available:

```bash
stemma --version
```

## 2. Create the redline

```bash
stemma compare as-sent.docx as-returned.docx \
  -o what-changed.docx \
  --author "Approved Reviewer"
```

Stemma reports the created artifact on stderr:

```
wrote redline to what-changed.docx (<n> tracked revisions); bytes=<n> sha256=<hex> collision_policy=create_new disposition=created
```

The output contract is:

* rejecting every discovered change reconstructs `as-sent.docx`;
* accepting every discovered change reconstructs `as-returned.docx`;
* neither input is modified;
* an existing output path is refused.

Omit `--author` if the comparison should be anonymous. Passing an empty author is an error.

## 3. Inspect and validate the result

List the pending revisions:

```bash
stemma extract what-changed.docx --format json
```

Validate the package and print its exact byte identity:

```bash
stemma validate what-changed.docx
```

Success starts with `OK:` and includes the document's byte count and SHA-256. Open `what-changed.docx` in Word to step through the tracked changes.

## What to do next

* Have a list of exact approved replacements instead of two documents? [Apply approved changes](https://stemma.sh/docs/guides/apply-approved-changes.md).
* Need to accept or reject some of the revisions? [Review and resolve changes](https://stemma.sh/docs/guides/review-and-resolve.md).
* Want an agent to inspect and edit documents? [Use Stemma with an agent](https://stemma.sh/docs/guides/use-with-an-agent.md).
* Hit an error? [Troubleshooting](https://stemma.sh/docs/help/troubleshooting.md).

For every flag and output guarantee, see the [CLI reference](https://stemma.sh/docs/reference/cli.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://stemma.sh/docs/getting-started.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
