| 229 | } |
| 230 | |
| 231 | export 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 | |
| 260 | export function renderVersion(): string { |
| 261 | return `${cyan(bold('zn'))} ${dim('v' + HELP_VERSION)}\n` |