A human-friendly DSL for ATProto Lexicons forked from stavola.xyz/mlf
mlf website content docs cli 09-diff.md
1.6 kB · 53 lines
Markdown
at main

+++ title = "Diff Command" description = "Show what would change on publish" weight = 9 +++

mlf diff prints a line-based unified diff between the Lexicon JSON your workspace currently produces and the record already published on the PDS, for one NSID or every changed lexicon in the package.

Read-only. No credentials needed.

Usage #

# Diff every changed / new / removed NSID
mlf diff

# Diff just one
mlf diff com.example.forum.thread

Output #

~ com.example.forum.thread  bafyREMOTE → bafyLOCAL
----------------------------------------------------
  {
    "$type": "com.atproto.lexicon.schema",
    "lexicon": 1,
    "id": "com.example.forum.thread",
    "defs": {
      "main": {
        "type": "record",
-       "description": "A thread"
+       "description": "A thread (v2)"
      }
    }
  }

Header symbols match mlf status:

  • ~ — changed (CID differs; both sides present)
  • + — new (no remote side yet)
  • - — removed (no local side, record still on PDS)
  • = — unchanged (only rendered when you explicitly target the NSID)

Notes #

  • The diff shows the record as it would be stored on the PDS — that is, the Lexicon JSON wrapped with "$type": "com.atproto.lexicon.schema". The CID header is the content-hash of that exact shape.
  • Key order inside JSON objects is serialiser-defined (alphabetical by default). CID comparison is independent of display order; the DAG-CBOR canonical form is what the hash is taken over.

See also #

  • mlf status — overview of every lexicon's state at a glance.