Interactive Mode
Reflex includes a terminal UI (TUI) for interactive code search. Launch it by running rfx query with no arguments:
Features
Section titled “Features”- 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
oto 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.
Keybindings
Section titled “Keybindings”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.
Search and focus
Section titled “Search and focus”| Key | Action |
|---|---|
Enter (in search box) | Run the search and move to results |
/ | Focus the search box |
Tab / Shift+Tab | Cycle focus between search box, filter bar and results |
Esc | Close the file preview, or leave the search box |
Ctrl+P / Ctrl+N | Previous / next query from history |
Navigation
Section titled “Navigation”| Key | Action |
|---|---|
j / ↓ | Next result (scrolls down in the preview) |
↑ | Previous result (scrolls up in the preview) |
PgDn / PgUp | Jump 10 results down / up |
Home | First result |
End / G | Last result |
Enter (in results) | Open the file preview |
o | Open the selected result in your editor |
Filters
Section titled “Filters”| Key | Action |
|---|---|
s | Toggle symbols-only mode |
r | Toggle regex mode |
c | Toggle contains (substring) mode |
e | Toggle expand mode (full definitions) |
l | Pick a language filter |
k | Pick a symbol kind filter |
Ctrl+L / Ctrl+K | Clear 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).
Actions
Section titled “Actions”| Key | Action |
|---|---|
i | Re-index the project |
I | Clear the index and rebuild it |
? | Toggle the help screen |
q | Quit (when the search box isn’t focused) |
Ctrl+C | Quit from anywhere |
Editor integration
Section titled “Editor integration”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:
$EDITOR | Command run |
|---|---|
vim, nvim | $EDITOR +LINE file |
emacs | emacs +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:
export EDITOR=nvim# orexport EDITOR=codeA value with arguments, such as "code --goto", won’t launch.
Symbol and language filters
Section titled “Symbol and language filters”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.
When to use interactive mode
Section titled “When to use interactive mode”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.
Next steps
Section titled “Next steps”- Full-Text Search — understand the search engine powering the TUI
- Symbol Search — filter results to definitions
- CLI Commands — all command-line options