promptprep.tui module

A friendly terminal interface for choosing which files to process.

class promptprep.tui.FileSelector(start_path: str)[source]

Bases: object

Lets you browse and select files using arrow keys and spacebar.

__init__(start_path: str)[source]

Gets everything ready for file selection.

Parameters:

start_path – Where to start browsing from

get_selections() Tuple[Set[str], Set[str], bool][source]

Get the current selections and return them.

Returns:

A tuple of (include_files, exclude_dirs, save_selections)

run(stdscr) Tuple[Set[str], Set[str], bool][source]

Starts up the file selector interface.

Parameters:

stdscr – The main screen object from curses

Returns:

  • Set of files to include

  • Set of directories to exclude

  • Whether to save these choices

promptprep.tui.select_files_interactive(directory: str) Tuple[Set[str], Set[str], bool][source]

Lets you pick files using an interactive menu.

Parameters:

directory – Where to start browsing

Returns:

  • Set of files you want to include

  • Set of directories you want to skip

  • Whether you want to save these choices