Skip to content

feat: add explicit search backend selection for Linux/Arch support #55

@na-navi

Description

@na-navi

Background

se currently targets Windows and calls Everything's es.exe directly. This works well on Windows, but prevents Linux/Arch support because Everything is Windows-only.

The final goal is automatic backend selection by platform/config, but the first implementation should be guarded by an explicit --backend option to avoid unsafe or surprising behavior.

Goal

Introduce backend-aware search execution with explicit backend selection first.

Initial supported backends:

  • everything - existing Windows / Everything / es.exe backend
  • fd - Linux/Arch filename/path search backend
  • rg-files - portable fallback using rg --files

Automatic backend detection is a later step. This issue should only prepare the structure and require explicit backend selection for non-Windows backends.

Proposed CLI

# Existing Windows behavior should remain unchanged
se query

# Explicit backend selection
se --backend everything query
se --backend fd query
se --backend rg-files query

# Scope/path/budget should still work
se --backend fd -p "$HOME/project" -n 20 query
se --backend fd --scope project --max-seconds 5 query
se --backend fd --caller codex --no-interactive query

Safety checks

se should validate the selected backend before search execution.

everything backend

  • Requires Windows.
  • Requires configured es.exe path.
  • Should fail clearly if es.exe is missing.
  • Existing Everything behavior should remain unchanged.

fd backend

  • Requires fd available in PATH or configured path.
  • Should fail clearly if fd is missing.
  • Should support path-limited search.
  • Should preserve result budget and timeout behavior.

rg-files backend

  • Requires rg available in PATH.
  • Uses rg --files and filters paths in Python.
  • Intended as fallback, not as full content search.

Non-goals

  • Do not implement automatic backend detection yet.
  • Do not add full content search.
  • Do not claim full macOS support.
  • Do not change existing Windows default behavior.
  • Do not make plocate part of the MVP.

Acceptance criteria

  • --backend {everything,fd,rg-files} is parsed and validated.
  • Existing Windows default behavior still uses Everything.
  • --backend everything preserves the current es.exe path/search behavior.
  • --backend fd works on Linux when fd is installed.
  • --backend rg-files works when ripgrep is installed.
  • -p/--path, -n/--max, --scope, --max-seconds, --stats, --log, and --caller codex --no-interactive continue to work through the backend layer.
  • Non-interactive mode still rejects fzf.
  • Timeout still exits with 124.
  • Stats include the selected backend name.
  • Tests cover backend selection and missing-backend errors without requiring Everything.

Suggested implementation shape

cmd_search
  -> derive_backend(args, config, platform)
  -> validate_backend(backend)
  -> backend.search(query, paths, max, deadline)
  -> common observation/log/stats/exit

The current es_search() path can become the everything backend first, keeping the default Windows behavior stable. Automatic backend detection should be handled in a later issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions