Просмотр исходного кода

feat: show word count in status command

majx_mac 8 месяцев назад
Родитель
Сommit
16c094496c
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      packages/cli/src/commands/status.ts

+ 4 - 0
packages/cli/src/commands/status.ts

@@ -31,7 +31,11 @@ export const statusCommand = new Command("status")
         log(`  ${book.title} (${id})`);
         log(`    Status: ${book.status}`);
         log(`    Platform: ${book.platform} | Genre: ${book.genre}`);
+        const totalWords = index.reduce((sum, ch) => sum + ch.wordCount, 0);
+        const avgWords = index.length > 0 ? Math.round(totalWords / index.length) : 0;
+
         log(`    Chapters: ${nextChapter - 1} / ${book.targetChapters}`);
+        log(`    Words: ${totalWords.toLocaleString()} (avg ${avgWords}/ch)`);
         log(`    Approved: ${approved} | Pending: ${pending} | Failed: ${failed}`);
         log("");
       }