CLI tool to sync your Markdown to Leaflet
leafletpub atproto cli markdown

There's no need to resolve to DID in config cmd

Changed files
+1 -7
src
commands
+1 -7
src/commands/config-cmd.ts
··· 1 import { defineCommand } from "citty"; 2 import { consola } from "consola"; 3 import { colorize, leftAlign, type ColorName } from "consola/utils"; 4 - import type { Did } from "@atcute/lexicons"; 5 import { exists, loadConfig } from "../utils.ts"; 6 7 export const configCmd = defineCommand({ ··· 40 publicationStatus = "HandleNotProvided"; 41 throw new Error("BSKY_HANDLE not provided in .env"); 42 } 43 - const didRes = (await ( 44 - await fetch( 45 - `https://quickdid.smokesignal.tools/xrpc/com.atproto.identity.resolveHandle?handle=${process.env.BSKY_HANDLE}` 46 - ) 47 - ).json()) as { did: Did }; 48 49 const rkey = config.publicationUri.split("/").at(-1) as string; 50 51 const recordRes = await fetch( 52 - `https://slingshot.microcosm.blue/xrpc/com.atproto.repo.getRecord?repo=${encodeURIComponent(didRes.did)}&collection=pub.leaflet.publication&rkey=${rkey}` 53 ); 54 55 if (recordRes.status == 400) {
··· 1 import { defineCommand } from "citty"; 2 import { consola } from "consola"; 3 import { colorize, leftAlign, type ColorName } from "consola/utils"; 4 import { exists, loadConfig } from "../utils.ts"; 5 6 export const configCmd = defineCommand({ ··· 39 publicationStatus = "HandleNotProvided"; 40 throw new Error("BSKY_HANDLE not provided in .env"); 41 } 42 43 const rkey = config.publicationUri.split("/").at(-1) as string; 44 45 const recordRes = await fetch( 46 + `https://slingshot.microcosm.blue/xrpc/com.atproto.repo.getRecord?repo=${encodeURIComponent(process.env.BSKY_HANDLE)}&collection=pub.leaflet.publication&rkey=${rkey}` 47 ); 48 49 if (recordRes.status == 400) {