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

Function cmdRead

apps/desktop/src/cli/commands/notes.ts:80–94  ·  view source on GitHub ↗
(vault: string, args: ParsedArgs)

Source from the content-addressed store, hash-verified

78}
79
80export async function cmdRead(vault: string, args: ParsedArgs): Promise<void> {
81 const rel = requirePath(args)
82 const note = await readNote(vault, rel)
83 if (getBool(args, 'json')) {
84 emitJson(note)
85 return
86 }
87 if (getBool(args, 'meta')) {
88 const { body: _body, ...meta } = note
89 emitJson(meta)
90 return
91 }
92 process.stdout.write(note.body)
93 if (!note.body.endsWith('\n')) process.stdout.write('\n')
94}
95
96export async function cmdCreate(vault: string, args: ParsedArgs): Promise<void> {
97 const folder = parseFolderFlag(getString(args, 'folder')) ?? 'inbox'

Callers

nothing calls this directly

Calls 4

requirePathFunction · 0.85
getBoolFunction · 0.85
emitJsonFunction · 0.85
readNoteFunction · 0.50

Tested by

no test coverage detected