Skip to content

Interactive Mode

Reflex includes a terminal UI (TUI) for interactive code search. Launch it by running rfx query with no arguments:

  • Fast search — type a pattern and press Enter; trigram search returns results in milliseconds
  • Live filters — toggle symbols, regex, substring, language and kind filters; results refresh automatically half a second after a change
  • File preview — press Enter on a result to see the file around the match
  • Editor integration — press o to open the result in your editor at the matching line
  • Query history — recall earlier searches, with their filters, across sessions
  • Mouse support — click to select, double-click to preview, scroll to navigate

If the project has no index yet, the TUI builds one when it starts.

The search box has focus when the TUI starts. Type your pattern and press Enter to run the search; focus then moves to the results list, where the single-key shortcuts below apply. Press ? at any time for the built-in help screen.

KeyAction
Enter (in search box)Run the search and move to results
/Focus the search box
Tab / Shift+TabCycle focus between search box, filter bar and results
EscClose the file preview, or leave the search box
Ctrl+P / Ctrl+NPrevious / next query from history
KeyAction
j / ↓Next result (scrolls down in the preview)
↑Previous result (scrolls up in the preview)
PgDn / PgUpJump 10 results down / up
HomeFirst result
End / GLast result
Enter (in results)Open the file preview
oOpen the selected result in your editor
KeyAction
sToggle symbols-only mode
rToggle regex mode
cToggle contains (substring) mode
eToggle expand mode (full definitions)
lPick a language filter
kPick a symbol kind filter
Ctrl+L / Ctrl+KClear the language / kind filter

Glob and exclude patterns aren’t available in the TUI yet (g and x just point you to the CLI’s --glob and --exclude flags).

KeyAction
iRe-index the project
IClear the index and rebuild it
?Toggle the help screen
qQuit (when the search box isn’t focused)
Ctrl+CQuit from anywhere

When you press o on a result, Reflex suspends the TUI and opens the file in $EDITOR (falling back to vim), then returns to the TUI when the editor exits. It knows how to jump to the matching line for these editors:

$EDITORCommand run
vim, nvim$EDITOR +LINE file
emacsemacs +LINE:0 file
code, vscode$EDITOR -g file:LINE
anything else$EDITOR file (opens at the top)

$EDITOR is run as a single program name, so set it to the bare command:

Terminal window
export EDITOR=nvim
# or
export EDITOR=code

A value with arguments, such as "code --goto", won’t launch.

The TUI supports the core filters from CLI mode: symbols-only, regex, contains, expand, language and symbol kind. Filter changes re-run the current search after a 500 ms pause, so you can flip several toggles before it fires. Each search returns up to 500 results and times out after 10 seconds.

Queries are saved with their filters to ~/.reflex/interactive_history.json (the last 1,000), so Ctrl+P recalls them in later sessions too.

Interactive mode is best for:

  • Exploratory search — when you’re not sure exactly what you’re looking for
  • Code review — quickly scanning through occurrences of a pattern
  • Refactoring — reviewing all uses of a function before renaming it

For scripted workflows, use CLI mode with --json output instead. See AI Integration for agent-oriented usage.