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

Function cmdVaultInfo

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

Source from the content-addressed store, hash-verified

19import { emitJson, emitLine, formatRelativeAge, pad } from '../format.js'
20
21export async function cmdVaultInfo(vault: string, args: ParsedArgs): Promise<void> {
22 const [notes, subfolders] = await Promise.all([listNotes(vault), listFolders(vault)])
23 const counts = {
24 inbox: 0,
25 quick: 0,
26 archive: 0,
27 trash: 0
28 }
29 for (const n of notes) counts[n.folder] += 1
30
31 const summary = {
32 vaultRoot: vault,
33 counts,
34 subfolderCount: subfolders.length
35 }
36 if (getBool(args, 'json')) {
37 emitJson(summary)
38 return
39 }
40 emitLine(`Vault: ${vault}`)
41 emitLine(` inbox: ${counts.inbox}`)
42 emitLine(` quick: ${counts.quick}`)
43 emitLine(` archive: ${counts.archive}`)
44 emitLine(` trash: ${counts.trash}`)
45 emitLine(` subfolders: ${subfolders.length}`)
46}
47
48export async function cmdVaultList(_vault: string, args: ParsedArgs): Promise<void> {
49 const known = await readKnownVaultsFromConfig()

Callers

nothing calls this directly

Calls 5

getBoolFunction · 0.85
emitJsonFunction · 0.85
emitLineFunction · 0.85
listNotesFunction · 0.50
listFoldersFunction · 0.50

Tested by

no test coverage detected