From d19dfa969ec8ff21e84cefd7e6631171132b0fac Mon Sep 17 00:00:00 2001 From: Vatsal Solanki Date: Sun, 1 Feb 2026 13:36:38 -0800 Subject: [PATCH] feat: display note IDs in CLI output Add note ID display to formatter output so users can easily find IDs for use with the `read` command: - formatNote(): show ID on folder line - formatSearchResult(): show ID on folder line - Update read command help text to clarify where to find IDs --- src/cli.ts | 2 +- src/formatter.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 71943b8..2ce3f23 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -72,7 +72,7 @@ program program .command('read ') - .description('Read a note by ID') + .description('Read a note by ID (shown in search/recent output)') .action(async (id: string) => { try { const noteId = parseInt(id, 10); diff --git a/src/formatter.ts b/src/formatter.ts index 4bff8ce..137d5e5 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -23,8 +23,8 @@ export function formatNote(note: IndexedNote, showBody = false): string { const lockSuffix = note.isLocked ? chalk.red(' 🔒') : ''; lines.push(titlePrefix + chalk.bold.cyan(note.title || 'Untitled') + lockSuffix); - // Folder - lines.push(chalk.dim(`📁 ${note.folder}`)); + // Folder and ID + lines.push(chalk.dim(`📁 ${note.folder} | ID: ${note.id}`)); // Snippet if (note.snippet) { @@ -55,8 +55,8 @@ export function formatSearchResult( const highlightedTitle = highlightMatches(result.title || 'Untitled', query); lines.push(chalk.green('▶ ') + titlePrefix + chalk.bold.cyan(highlightedTitle) + lockSuffix); - // Folder - lines.push(chalk.dim(` 📁 ${result.folder}`)); + // Folder and ID + lines.push(chalk.dim(` 📁 ${result.folder} | ID: ${result.id}`)); // Highlighted snippet if (result.snippet) {