Skip to content

TUI

The TUI (Text User Interface) provides an interactive, keyboard-driven workflow for organizing and renaming audiobooks directly in your terminal.

The TUI offers a middle ground between the visual GUI and the scriptable CLI:

  • Interactive keyboard navigation - Visual feedback without requiring a mouse
  • Step-by-step workflow - Guided screens like the GUI
  • Real-time filtering - Type to filter directories and options
  • Visual progress - Color-coded output and progress tracking
  • SSH-friendly - Works over remote connections
  • No X11 required - Pure terminal-based interface

Best for: Power users who prefer keyboard navigation, SSH/remote sessions, interactive workflow without GUI overhead

Not ideal for: Automation, batch processing, users unfamiliar with terminals (use GUI or CLI instead)


The TUI is included with the main audiobook-organizer CLI binary:

Terminal window
# macOS/Linux via Homebrew
brew tap jeeftor/tap
brew install audiobook-organizer
# Debian/Ubuntu
sudo apt install audiobook-organizer
# RedHat/Fedora
sudo yum install audiobook-organizer
# Alpine
sudo apk add audiobook-organizer
# Go install
go install github.com/jeeftor/audiobook-organizer@latest

See also: INSTALLATION.md for platform-specific instructions


Generate local TUI documentation captures from the repository root:

Terminal window
make docs-tui-captures

The workflow builds the binary, stages committed LibriVox sample media from testdata/mp3flat/ under output/docs-tui-sample/, runs scripted VHS sessions for the organize and rename TUIs, and writes ignored artifacts under output/docs-visuals/tui/.

Current capture names are organize-preview and rename-field-mapping. Each capture writes an animated GIF plus a static PNG extracted from the final frame. Regenerate one or more specific captures with:

Terminal window
ABO_DOCS_TUI_CAPTURES=organize-preview make docs-tui-captures

The TUI capture workflow requires VHS, ffmpeg, and cwebp on Linux. Animated GIF captures are optimized with gifsicle -O3 when gifsicle is available; set ABO_DOCS_GIF_OPTIMIZE=0 to skip that pass. On macOS, make docs-tui-captures builds and uses the local audiobook-organizer-vhs:local Docker image so VHS runs in Linux instead of launching the local Chrome app. Use make docs-tui-image to rebuild that image directly. Set ABO_DOCS_TUI_VHS_IMAGE to use a different local or mirrored image. Set ABO_DOCS_TUI_VHS_MODE=native only on hosts where native VHS is known to use a safe headless browser.

The aggregate make docs-visuals target includes these TUI captures, and CI uploads the generated files as docs visual artifacts.


The Organization TUI guides you through organizing audiobooks into structured directories.

Terminal window
# Interactive directory picker
audiobook-organizer tui
# Pre-selected directories (skip picker)
audiobook-organizer tui --dir=/path/to/audiobooks --out=/path/to/organized
# With specific layout
audiobook-organizer tui --layout=author-title
# Verbose output
audiobook-organizer tui --verbose

The organization TUI follows a 6-screen workflow:

Purpose: Select or configure output directory if not provided via --out flag

Navigation:

  • Tab - Switch between input field and buttons
  • Enter - Confirm selection
  • Ctrl+Q - Quit

Tips:

  • Can be same as input directory (organize in-place)
  • Leave empty to use input directory

Purpose: Browse and select input directory containing audiobooks

Features:

  • Hierarchical directory tree - Visual directory structure
  • Real-time filtering - Type to filter visible directories
  • Current directory indicator - Highlighted path
  • Breadcrumb trail - Shows current location

Keyboard shortcuts:

  • ↑/↓ or j/k - Navigate directories
  • Enter - Open/navigate into directory
  • Ctrl+S - Select current directory
  • Type to filter - Start typing to filter directories
  • ESC - Clear filter
  • Ctrl+B - Go up one level (parent directory)
  • Ctrl+H - Jump to home directory
  • Ctrl+R - Jump to root directory
  • Ctrl+Q - Quit

Tips:

  • Use filter to quickly find deeply nested directories
  • Press ESC to clear filter and see all directories

Purpose: Scan selected directory for audiobooks

Display:

  • Progress spinner
  • Files/directories scanned count
  • Audiobooks found count

What happens:

  • Searches for metadata.json files (if using metadata.json mode)
  • Extracts metadata from EPUB, MP3, M4B files (if using embedded mode)
  • Groups files into books/albums

Duration: Depends on directory size and file count

Purpose: Review discovered audiobooks and select which to organize

Display:

  • List of all discovered audiobooks
  • Metadata for each book (title, author, series)
  • Selection checkboxes
  • Summary counts

Navigation:

  • ↑/↓ - Navigate list
  • Space - Toggle selection
  • a - Select all
  • n - Deselect all
  • Enter - Continue to settings (with selected books)
  • q - Back to directory picker

Tips:

  • Review metadata before proceeding
  • Use Space to deselect books with incorrect metadata

Purpose: Configure organization options

Available settings:

  • Layout - Directory structure pattern
    • author-series-title (default)
    • author-series-title-number
    • author-title
    • author-only
    • series-title
    • series-title-number
  • Use Embedded Metadata - Extract from audio files instead of metadata.json
  • Flat Mode - Process files individually vs. by directory
  • Remove Empty Directories - Clean up after moving
  • Replace Spaces - Character to replace spaces (or leave blank)
  • Verbose Output - Detailed logging

Navigation:

  • ↑/↓ - Navigate settings
  • Enter / Space - Toggle or edit setting
  • Tab - Move between fields
  • Enter on "Continue" - Proceed to preview
  • q - Back to book list

Tips:

  • Change layout to match your preferred organization style
  • Enable verbose for troubleshooting

Purpose: Review all proposed file operations before executing

Display:

  • FromTo paths for each operation
  • Color-coded paths (if terminal supports):
    • Author in orange
    • Series in cyan
    • Title in green
  • Summary - Total operations, conflicts detected
  • Action choice - Execute or cancel

Navigation:

  • Scroll - Review all operations
  • Enter on "Execute" - Perform organization
  • Enter on "Cancel" - Return to settings
  • q - Back to settings

Tips:

  • Review carefully before executing
  • Look for conflicts or incorrect paths
  • Use q to go back and adjust settings

Purpose: Show real-time progress during file organization

Display:

  • Current operation
  • Files processed / total
  • Progress bar
  • Success/error messages

What happens:

  • Creates target directories
  • Moves/copies files
  • Logs operations to .abook-org.log
  • Shows final summary

Duration: Depends on file count and sizes

Success: Shows summary and exits Errors: Displays error messages with details

Undo: Use CLI undo command if needed:

Terminal window
audiobook-organizer --dir=/path --undo

The Rename TUI provides an interactive workflow for renaming audiobook files based on metadata templates.

Terminal window
# Interactive rename workflow
audiobook-organizer rename-tui --dir=/path/to/audiobooks
# With specific directory
audiobook-organizer rename-tui --dir=/media/audiobooks
# Preview mode (no changes)
audiobook-organizer rename-tui --dir=/path --dry-run

The rename TUI follows a 6-screen workflow:

Purpose: Discover audiobook files and extract metadata

What happens:

  • Scans directory recursively for audio files
  • Extracts metadata from files
  • Displays progress

Purpose: Configure which metadata fields to use for different purposes

Display:

  • Hybrid Metadata Display - Shows both metadata.json fields (📁) and embedded audio fields (🎵)
  • Visual indicators - Icons show field source
  • Field selectors - Configure author, title, series, track fields

Available fields:

  • Author Fields - Priority list: authors, narrators, album_artist, artist, etc.
  • Title Field - Single field: album, title, track_title, etc.
  • Series Field - Single field: series, album, etc.
  • Track Field - Single field: track, track_number, etc.

Navigation:

  • ↑/↓ - Navigate field selectors
  • Enter / Space - Edit field
  • Tab - Move between sections
  • Enter on "Continue" - Proceed to command screen
  • q - Back to scan

Tips:

  • Review sample metadata to see which fields are populated
  • Order author fields by priority (tried first to last)

See also: METADATA.md for field mapping guide

Purpose: Generate CLI commands based on current configuration

Display:

  • Complete CLI command with all flags
  • Copy-pasteable for future use
  • Option to continue or exit

Navigation:

  • c - Copy command to clipboard (if supported)
  • Enter on "Continue" - Proceed to template builder
  • Enter on "Exit" - Quit TUI (command shown for manual use)
  • q - Back to field mapping

Example command:

Terminal window
audiobook-organizer rename \
--dir=/path/to/audiobooks \
--template="{author} - {series} {series_number} - {title}" \
--author-fields="narrators,authors" \
--title-field="album"

Purpose: Design filename template with live preview

Features:

  • Template builder - Select fields and separators
  • Available fields:
    • {author} - First author (formatted)
    • {authors} - All authors (comma-separated)
    • {title} - Book title
    • {series} - Series name
    • {series_number} - Series number only
    • {track} - Track number (zero-padded)
    • {album} - Album field
    • {year} - Publication year
    • {narrator} - Narrator (if available)
  • Live preview - Shows how template will look with sample data
  • Separator configuration - Choose between -, /, , ., _

Navigation:

  • ↑/↓ - Navigate field list
  • Enter / Space - Add field to template
  • Backspace - Remove last field
  • Tab - Change separator
  • Enter on "Continue" - Proceed to preview
  • q - Back to command screen

Example template:

Template: {author} - {track} - {title}
Preview: Brandon Sanderson - 01 - The Final Empire.m4b

Purpose: Review all proposed renames before executing

Display:

  • BeforeAfter filenames
  • Color-coded indicators - Show changed portions
  • Conflict detection - Highlights duplicate filenames
  • Summary - Total renames, conflicts found

Navigation:

  • Scroll - Review all renames
  • Enter on "Execute" - Perform renames
  • Enter on "Cancel" - Return to template
  • q - Back to template screen

Tips:

  • Check for conflicts (duplicate target filenames)
  • Verify template produces desired results
  • Use q to adjust template if needed

Purpose: Execute renames with progress tracking

Display:

  • Current file being renamed
  • Progress bar
  • Success/error messages
  • Operation log path

What happens:

  • Renames files according to template
  • Logs operations to .abook-org.log
  • Shows final summary

Undo support: Operations logged for reversal:

Terminal window
audiobook-organizer rename --dir=/path --undo

The Metadata Viewer lets you explore metadata for audiobook files interactively.

Terminal window
# Interactive metadata exploration
audiobook-organizer metadata-tui --dir=/path/to/audiobooks
  • Browse files - Navigate directory tree
  • View metadata - See all extracted fields
  • Multiple formats - Supports metadata.json, EPUB, MP3, M4B
  • Field indicators - Shows which fields are populated
  • Export options - Copy metadata to clipboard
  • Understand metadata structure - Before designing field mappings
  • Troubleshoot extraction - Verify which fields are populated
  • Compare formats - See differences between metadata.json and embedded tags
  • Plan templates - Determine which fields to use in rename templates
  • ↑/↓ - Navigate files
  • Enter - View metadata details
  • q - Back / Exit
  • Tab - Switch between list and detail view

NEW Feature: When metadata.json files exist alongside audio files (MP3, M4B), the TUI automatically merges:

  • Book-level metadata from metadata.json:
    • Title, authors, series, description
    • Publisher, publication date, genres
  • File-level metadata from embedded audio tags:
    • Track numbers, disc numbers
    • Individual chapter titles

Benefits:

  • Complete picture with proper track numbering
  • Best of both metadata sources
  • Essential for multi-file audiobooks

How it works:

  1. TUI reads metadata.json for book details
  2. TUI reads audio files for track information
  3. Merges data, preferring metadata.json for book fields
  4. Uses embedded tags for track/disc numbers

KeyAction
qBack / Previous screen
Ctrl+CQuit TUI immediately
Ctrl+QQuit TUI (some screens)
KeyAction
/ kMove up
/ jMove down
EnterOpen directory / Navigate into
Ctrl+SSelect current directory
TypeFilter directories
ESCClear filter
Ctrl+BGo up one level (parent)
Ctrl+HJump to home directory
Ctrl+RJump to root directory
KeyAction
/ kMove up
/ jMove down
SpaceToggle selection
aSelect all
nDeselect all
EnterContinue with selected
KeyAction
/ kPrevious field
/ jNext field
TabMove between sections
EnterEdit field / Toggle option
SpaceToggle checkbox
ESCCancel edit
KeyAction
/ kScroll up
/ jScroll down
PgUpPage up
PgDnPage down
HomeTop of list
EndBottom of list

When in the directory picker, start typing to filter:

/home/user/media/audiobooks/
Type: "fantasy" → Shows only directories with "fantasy" in path

Press ESC to clear filter and see all directories again.

Use shortcuts to jump to common locations:

  • Ctrl+H - Home directory (~)
  • Ctrl+R - Root directory (/)
  • Ctrl+B - Parent directory (..)

Always review the preview screen carefully:

  • Check for incorrect paths
  • Look for conflicts
  • Verify metadata extracted correctly

Use q to go back and adjust settings if needed.

For non-standard MP3 files:

  1. Use metadata viewer to explore available fields
  2. Identify which fields contain author, title, series
  3. Configure field mapping in rename TUI
  4. Verify with template preview before executing

Test your configuration without making changes:

Terminal window
audiobook-organizer tui --dir=/path --dry-run

Or use the preview screen to review operations before executing.


Symptoms: Garbled output, broken boxes, missing colors

Solutions:

  • Update terminal emulator to latest version
  • Try different terminal (iTerm2, Alacritty, Windows Terminal)
  • Check $TERM environment variable:
    Terminal window
    echo $TERM
    # Should be: xterm-256color or similar
  • Force 256-color mode:
    Terminal window
    TERM=xterm-256color audiobook-organizer tui

Symptoms: TUI broken over SSH connection

Solutions:

  • Ensure terminal supports 256 colors on both client and server
  • Use -t flag with SSH to force TTY allocation:
    Terminal window
    ssh -t user@server audiobook-organizer tui
  • Consider using tmux/screen for better compatibility

Symptoms: Keys like Ctrl+H trigger wrong actions

Solutions:

  • Check terminal key bindings (may conflict)
  • Use mouse if terminal supports it (for directory picker)
  • Use alternative navigation (↑/↓ instead of shortcuts)

Symptoms: Typing doesn’t filter directories

Solutions:

  • Ensure you’re on the directory picker screen
  • Press ESC to clear any existing filter first
  • Check keyboard layout (some keys may not register)

FeatureGUITUICLI
Visual Interface✓ Modern desktop✓ Terminal UI✗ Text only
Mouse Support✓ FullLimited✗ N/A
Keyboard Navigation✓ Full✗ N/A
SSH/Remote✗ Requires X11✓ Works great✓ Works
Interactive Workflow✗ Direct execution
Scriptable✓ Full
Field Mapping UI✓ Dialog✓ Screen✗ Config/flags
Real-time Preview✓ Live updates✓ Preview screen✗ Dry-run
Learning CurveLowMediumMedium-High

Use TUI when:

  • Working over SSH or remote connections
  • Prefer keyboard navigation over mouse
  • Want interactive workflow without GUI overhead
  • Need visual feedback but CLI is too bare

Use GUI when:

  • First time using the organizer
  • Prefer mouse-driven interface
  • Want most visual feedback

Use CLI when:

  • Automating with scripts
  • Batch processing
  • Non-interactive execution


When reporting TUI issues, please include:

  • Operating system and terminal emulator
  • Version (audiobook-organizer version)
  • $TERM environment variable value
  • Screenshot or text copy of broken rendering
  • Steps to reproduce