atproto libraries implementation in ocaml
README.md

repo_inspector#

AT Protocol repository inspector for exploring repository contents, collections, and records.

Usage#

repo_inspector [OPTIONS] <DID>

Downloads and parses the repository for the given DID. The tool automatically resolves the user's PDS (Personal Data Server) from their DID document.

Options#

Option Description
--pds <URL> PDS URL (auto-resolved from DID document if not specified)
-c, --collections List all collections with record counts
-r, --records Show individual records
--collection <STRING> Filter records by collection prefix
-n, --limit <INT> Limit number of records shown (default: 20)
-v, --verify Show commit signature information
-h, --help Show help message

Examples#

Show repository summary:

dune exec examples/repo_inspector/repo_inspector.exe -- did:plc:z72i7hdynmk6r22z27h6tvur

List collections:

dune exec examples/repo_inspector/repo_inspector.exe -- \
  did:plc:z72i7hdynmk6r22z27h6tvur --collections

Show records:

dune exec examples/repo_inspector/repo_inspector.exe -- \
  did:plc:z72i7hdynmk6r22z27h6tvur --records --limit 10

Show only posts:

dune exec examples/repo_inspector/repo_inspector.exe -- \
  did:plc:z72i7hdynmk6r22z27h6tvur --records --collection app.bsky.feed.post

Verify commit signature:

dune exec examples/repo_inspector/repo_inspector.exe -- \
  did:plc:z72i7hdynmk6r22z27h6tvur --verify

Use a specific PDS (skip auto-resolution):

dune exec examples/repo_inspector/repo_inspector.exe -- \
  did:plc:z72i7hdynmk6r22z27h6tvur --pds https://puffball.us-east.host.bsky.network

Output#

Summary output:

Repository Inspector
====================

Resolving PDS for did:plc:z72i7hdynmk6r22z27h6tvur...
PDS: https://puffball.us-east.host.bsky.network

Fetching https://puffball.us-east.host.bsky.network/xrpc/com.atproto.sync.getRepo?did=...

CAR Header
----------
Version: 1
Roots:   1
  - bafyreib...
Blocks:  1234

Commit
------
DID:     did:plc:z72i7hdynmk6r22z27h6tvur
Version: 3
Rev:     3abc123def456
Data:    bafyreic...

Collections
-----------
  app.bsky.feed.post: 456
  app.bsky.feed.like: 789
  app.bsky.graph.follow: 123
  app.bsky.actor.profile: 1

Total records: 1369

Records output:

Records
-------
app.bsky.feed.post/3abc123
  CID: bafyreig...
  Text: Hello world, this is my first post...

app.bsky.feed.post/3def456
  CID: bafyreih...
  Text: Another post here...

... and 454 more

Verify output:

Commit Verification
-------------------
DID:       did:plc:z72i7hdynmk6r22z27h6tvur
Signature: MEUCIQDa7H8c9X...
Status:    Signature present but key resolution not implemented
           (would need to resolve DID document to verify)

Notes#

  • Automatically resolves the user's PDS from their DID document via PLC directory
  • Use --pds to skip auto-resolution and specify a PDS directly
  • Large repositories may take time to download
  • Record text preview is truncated to 60 characters
  • The --collection filter matches the start of the collection path