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

Function renderHelp

apps/desktop/src/cli/help.ts:231–258  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229}
230
231export function renderHelp(): string {
232 const width = termWidth()
233 const out: string[] = []
234 out.push(...header(width))
235 out.push('')
236 out.push(bold(yellow('USAGE')))
237 out.push(' ' + cyan('zn') + ' ' + magenta('<command>') + ' ' + dim('[arguments] [flags]'))
238 out.push('')
239 for (const s of SECTIONS) {
240 out.push(...section(s.heading, s.rows, width))
241 out.push('')
242 }
243 out.push(...section('GLOBAL FLAGS', GLOBAL_FLAGS, width))
244 out.push('')
245 out.push(...section('ENVIRONMENT', ENVIRONMENT, width))
246 out.push('')
247 out.push(bold(yellow('EXAMPLES')))
248 for (const line of EXAMPLES) {
249 out.push(' ' + dim('$') + ' ' + line)
250 }
251 out.push('')
252 out.push(
253 italic(dim(' Install `zn` from Settings → CLI in the ZenNotes app. Quote note paths that contain spaces.'))
254 )
255 out.push(italic(dim(' Run `zn <command>` to try one out.')))
256 out.push('')
257 return out.join('\n')
258}
259
260export function renderVersion(): string {
261 return `${cyan(bold('zn'))} ${dim('v' + HELP_VERSION)}\n`

Callers 2

help.test.tsFile · 0.90
mainFunction · 0.85

Calls 9

termWidthFunction · 0.85
headerFunction · 0.85
boldFunction · 0.85
yellowFunction · 0.85
cyanFunction · 0.85
magentaFunction · 0.85
dimFunction · 0.85
sectionFunction · 0.85
italicFunction · 0.85

Tested by

no test coverage detected