TUI reader

codex can read books directly in the terminal. The reader is TUI-only — open a book from the Library (there is no CLI equivalent). Text is reflowed to the viewport and recomputed on resize.

Supported formats

FormatNotes
EPUBSpine extraction + HTML→text
TXT / MarkdownMarkdown via CommonMark; TXT read directly
MOBIPalmDOC / uncompressed; HUFF/CDIC is refused with a clear message
AZW3 (KF8)Dual-stream AZW3 reads the legacy stream; KF8-only is refused with a suggestion to convert to EPUB
PDFSingle-column text; multi-column is best-effort with a warning

DRM-protected books (Amazon Topaz / KFX / protected AZW) are detected and refused — codex does not remove DRM. Only sideloaded, DRM-free files work.

Vim-style cursor and paging:

KeysAction
h j k lMove the cursor
w b e 0 $Word / line motions
gg GTop / bottom
Space Ctrl+f Ctrl+bPage down / up
Ctrl+d Ctrl+uHalf-page down / up
[ ]Previous / next chapter
:NJump to absolute page N
:cNJump to chapter N
?Contextual help
EscBack to the Library

The footer shows chapter X/Y · page A/B. For PDF, each page is a chapter, so :cN jumps to the real document page.

Reading progress

Progress (last chapter, offset, and time) is saved when you change chapters, page, or leave the reader, and restored when you reopen the book.

Performance

Conversion results (PDF/EPUB/MOBI/AZW3) are cached on disk under the XDG cache dir and invalidated by source mtime + size. Opening runs in a background thread with an animated loading screen; the TUI stays responsive and Esc cancels.