Skip to content

Conversation

@EricGrill
Copy link

Summary

This PR adds fuzzy find capability to the file picker, addressing issue #603.

  • Adds a new --fuzzy flag that enables fuzzy search mode for the file picker
  • When enabled, users can type to filter files by name using fuzzy matching (similar to fzf)
  • Recursively collects all files from the base directory and displays a searchable list
  • Highlights matched characters in file names for visual feedback
  • Supports customizable styling for prompts, matches, and indicators

New Options

Flag Description Default
--fuzzy Enable fuzzy filtering mode false
--prompt Search prompt text >
--placeholder Placeholder text for search input Search files...
--indicator Character for selection indicator
--prompt.* Style options for the prompt
--placeholder.* Style options for placeholder
--match.* Style options for match highlights
--indicator.* Style options for the indicator

Usage Example

# Basic fuzzy file picker
gum file --fuzzy

# With hidden files
gum file --fuzzy --all

# Custom styling
gum file --fuzzy --match.foreground=green

Test plan

  • Test basic fuzzy search functionality with gum file --fuzzy
  • Verify file selection works correctly (Enter key)
  • Test with --all flag to include hidden files
  • Test with --directory flag for directory selection
  • Verify match highlighting displays correctly
  • Test navigation with arrow keys
  • Test quit with Esc and Ctrl+C
  • Verify styling options work as expected

Closes #603

🤖 Generated with Claude Code

Add a new --fuzzy flag to enable fuzzy search mode for the file picker.
When enabled, users can type to filter files by name using fuzzy matching,
similar to tools like fzf.

The fuzzy mode:
- Recursively collects all files from the base directory
- Displays a searchable list with fuzzy matching
- Highlights matched characters in file names
- Supports customizable styling for prompts, matches, and indicators
- Maintains feature parity with existing styling options

New options added:
- --fuzzy: Enable fuzzy filtering mode
- --prompt: Customize the search prompt
- --placeholder: Set placeholder text for the search input
- --indicator: Character for selection indicator
- Various style options (--prompt.*, --match.*, --indicator.*)

Closes charmbracelet#603

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@EricGrill EricGrill requested a review from a team as a code owner January 14, 2026 06:21
@EricGrill EricGrill requested review from aymanbagabas and raphamorim and removed request for a team January 14, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filepicker fuzzy find

1 participant