MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / cmdBacklinks

Function cmdBacklinks

apps/desktop/src/cli/commands/search.ts:50–63  ·  view source on GitHub ↗
(vault: string, args: ParsedArgs)

Source from the content-addressed store, hash-verified

48}
49
50export async function cmdBacklinks(vault: string, args: ParsedArgs): Promise<void> {
51 const rel = getString(args, 'path') ?? args.positionals[0]
52 if (!rel) throw new Error('zn backlinks requires a note path.')
53 const refs = await backlinks(vault, rel)
54 if (getBool(args, 'json')) {
55 emitJson(refs)
56 return
57 }
58 if (refs.length === 0) {
59 emitLine(`No notes link to ${rel}.`)
60 return
61 }
62 for (const ref of refs) emitLine(ref.path)
63}

Callers

nothing calls this directly

Calls 5

getStringFunction · 0.85
backlinksFunction · 0.85
getBoolFunction · 0.85
emitJsonFunction · 0.85
emitLineFunction · 0.85

Tested by

no test coverage detected