Skip to content

Feature request: Allow gitignored files in file search #1535

Closed

Description

@whaaaley

Right now .gitignore files and dirs are hidden from opencode file search. I often like to save off audits and todo lists in project repos, but not commit them.

As a user... I'd like to be able to re-include specific gitignored files and dirs so I can reference them from the file search.

Activity

  1. changed the title [-]Allow gitignored files in file search[/-] [+]Feature request: Allow gitignored files in file search[/+] on Aug 2, 2025
  2. self-assigned this
    on Aug 3, 2025
  3. Yrds commented on Aug 16, 2025

    @Yrds

    opencode uses rg to file search. As as workaround you can use RIPGREP_CONFIG_PATH to configure search function. For example, I'm using this in my project:

    Create a file named .rgrc file with the following option in your project root:

    --no-ignore-vcs
    

    Then open opencode with:

    RIPGREP_CONFIG_PATH=.rgrc opencode

    Now you can search for gitignored files.

    In my opinion it might be better yet to support .rgrc (this is just a very common filename used by ripgrep users so it's just a suggestion). That way, users can customize file search beyond just allowing .gitignore files.

  4. thdxr commented on Aug 17, 2025

    @thdxr
    Member

    /oc are there any other issues like this one?

  5. opencode-agent commented on Aug 17, 2025

    @opencode-agent
    Contributor

    Based on my search, this appears to be a unique and valid feature request. Here's what I found:

    No Similar Issues Found

    There are currently no other issues in the repository requesting similar file search enhancements. This is the first request for:

    • Gitignore file visibility control
    • Ripgrep configuration customization
    • Search scope configuration

    Current Implementation Gaps

    The current file search system has significant limitations:

    • Hardcoded exclusions: Only .git/* is filtered out
    • No .gitignore awareness: Gitignored files are still shown/searchable
    • No configuration support: No .rgrc or RIPGREP_CONFIG_PATH support
    • No user customization: Search behavior can't be modified

    This is a Greenfield Opportunity

    The codebase shows this would be a valuable enhancement since:

    1. The search implementation is basic but functional
    2. There's already a robust config system that could be extended
    3. The suggested workaround confirms the technical feasibility
    4. No competing or conflicting features exist

    This issue represents a clear gap in expected developer tooling functionality that would benefit many users.

    %22Searching%20for%20similar%20gitignore%20file%20search%20issue
    opencode session  |  github run

  6. anmorgunov commented on Oct 29, 2025

    @anmorgunov

    would like to voice support for this feature request, I have a few LLM-specific guiding docs or plans that I don't need to commit to the repo, but obviously would want to use in opencode

  7. rekram1-node commented on Oct 29, 2025

    @rekram1-node
    Contributor

    @anmorgunov we may need to highlight this better in the docs but since we use ripgrep for file searches you can make exclusions using ignore files:
    https://opencode.ai/docs/tools/#ignore-patterns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions