Sync documents to a workarea
Applies to OML v0.6.x · Status: Stable · Last verified 2026-11-06
oml sync keeps a workarea in step with committed markdown. It reads git's object store at one
commit and extracts memories through an adapter. It diffs them against what the workarea holds and
writes the difference. Each memory is anchored to the repository, commit, path, fragment and
fingerprint of the span it came from.
- Pick the source and the adapter.
adryields one memory per decision bullet, plus a summary and a rejected-alternatives memory.headingsyields one per heading of level 2 to 4.linesyields blocks of at most 40 lines. - Create the workarea and a writer key. Keep using the same sync key. A writer supersedes only its own tips.
- Preview.
oml sync docs/adr --workarea design --adapter adr --dry-runlists each item asnew,changed,removed,movedorunchangedand writes nothing. - Run. Drop
--dry-run. A run writes up to 200 items (--max-writes), so repeat for larger sources. The public server needs one--allow-public-serveropt-in per clone. That first run explains the disclosure and records consent in local git config; later runs need no flag. A source outside a git clone needs the flag each run. The server's admins can read submitted memories. Supersession or retirement does not erase submitted text or anchors. - Review in bulk. A person reads the batch with
oml review list --author-key <sync key>and approves it withoml review approve --ids -. - Check for drift.
oml sync … --checkwrites nothing and exits1onstale,removedoruntracked, so CI can run it after every merge. Add--recordto record the source checks. - Link memories.
--edgesproposes theamendsandsupersedeslinks the records state.--edges --ratifyunder a second person's key ratifies them.
Options
| Option | What it does |
|---|---|
--rev <REV> |
The commit read; default HEAD. Never the working tree. |
--repo <REPO> |
The anchor's repository name; omitted, derived from origin. |
--exclude <GLOB> |
Paths left out of the source, repeatable (docs/adr/**). The set is recorded for the source on this clone. |
--pr <N> |
Load the records pull request <n> adds or changes between --base and --rev into the draft workarea <workarea>-pr-<n>. |
--base <BASE> |
With --pr, the branch the pull request targets; default origin/main. |
--retire-all |
Propose retiring every memory this key wrote in the workarea under the source, as when a draft's pull request closes. |
Refusals
- A source that rewound needs
--allow-rollback. - Items already present without the sync's anchor need
--adopt. - A changed adapter or exclude set needs
--change-adapteror--change-exclude. - A file whose name matches a secret pattern (
.env*,*.pem,*id_*,*credentials*) is reportedunreadableand skipped.
We have not measured whether a reviewer catches a wrong extraction in a batch of 200. All flags are in the CLI reference.