diff --git a/packages/cli/src/lib/atproto.ts b/packages/cli/src/lib/atproto.ts index af66579..3ceefdd 100644 --- a/packages/cli/src/lib/atproto.ts +++ b/packages/cli/src/lib/atproto.ts @@ -328,7 +328,16 @@ export async function updateDocument( textContent = stripMarkdownForText(post.content); } + // Fetch existing record to preserve PDS-side fields (e.g. bskyPostRef) + const existingResponse = await agent.com.atproto.repo.getRecord({ + repo: agent.did!, + collection: collection!, + rkey: rkey!, + }); + const existingRecord = existingResponse.data.value as Record; + const record: Record = { + ...existingRecord, $type: "site.standard.document", title: post.frontmatter.title, site: config.publicationUri,