Skip to content

Feature: Integrate fuzzy finder for /add and /read-only commands#4344

Open
vk4s wants to merge 11 commits intoAider-AI:mainfrom
vk4s:vikash/fuzzy
Open

Feature: Integrate fuzzy finder for /add and /read-only commands#4344
vk4s wants to merge 11 commits intoAider-AI:mainfrom
vk4s:vikash/fuzzy

Conversation

@vk4s
Copy link

@vk4s vk4s commented Jul 13, 2025

This change improves the /add and /read-only commands by integrating a fuzzy finder, making it easier to add files to the chat.

Previously, adding files required typing out their full paths or using glob patterns. Now, you can simply run /add or /read-only without any arguments to open an interactive fuzzy finder (fzf). This allows you to quickly search for and select one or more files from your repository to add to the chat.

For the /read-only command, the original functionality is preserved as a convenient fallback. If you open the fuzzy finder and close it (ctrl+c) without selecting any files, the command will automatically convert all currently editable files in the chat to read-only.

Usage:

  • To add files for editing:

    /add
    

    This will open a fuzzy finder to select files.

  • To add files as read-only:

    /read-only
    

    This will open a fuzzy finder. If you select files, they will be added as read-only. If you close the finder (ctrl+c) without making a selection, all editable files in the chat will be converted to read-only (preserved existing behavior).

  • Search chat history (new)

    /history-search
    

    Search through chat history and select and apply search results, right in your terminal.

This change makes the process of adding files, improving the overall user experience.

Note: If fzf tool is not installed, the fuzzy finder features are gracefully disabled, and the commands fall back to their original behavior.


Documentation:

Add files:

image

Read-only files:

image

if all_files:
selected_files = run_fzf(all_files, multi=True)

if not selected_files:
Copy link
Author

@vk4s vk4s Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens when you close the fzf interface (ctrl+c or esc) without selecting any file.

stdout=subprocess.PIPE,
text=True,
)
# fzf expects a newline-separated list of strings
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I leave the comments or remove them?
I couldn't find the guidelines for this.


## Read-only files

You can also add files to the chat as "read-only" files. Aider can see these files for context, but can't edit them. This is useful for providing reference documentation, specifications, or examples of existing code that you don't want the AI to modify.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably line-break these lines to follow the existing form of the usage.md.

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.

2 participants

Comments