Skip to content

feat: add bettersearch extension - #428

Open
selfxplanatorium wants to merge 2 commits into
vicinaehq:mainfrom
selfxplanatorium:add-bettersearch
Open

selfxplanatorium wants to merge 2 commits into
vicinaehq:mainfrom
selfxplanatorium:add-bettersearch

Conversation

@selfxplanatorium

Copy link
Copy Markdown

What it does

BetterSearch adds search inside files to Vicinae, backed by fff, an indexed, typo-tolerant search engine.

Command Purpose
Search File Contents Plain text, regex or fuzzy search inside text files. Matches are grouped by file, the surrounding lines are previewed, and Enter opens the configured editor at the matching line and column.
Search Files File and folder name search with git status tags, .gitignore-aware indexing, and ranking that learns from the files you open for each query. name:42 opens the editor at line 42.
Manage File Index Shows indexing status, and rescans, restarts or stops the index.

How it differs from built-in functionality

Vicinae's built-in file search covers file names, and does it well, including typos. BetterSearch does not try to replace it:

  • Content search has no built-in equivalent. On a 38,000-file home folder it answers in about 5 ms per keystroke, against about 180 ms for a ripgrep run over the same folder.
  • Search Files is scoped differently. It respects .gitignore and skips hidden and dependency folders, while the built-in index includes them (300,000+ files against 5,300 on the test machine). It adds git status, editor line jumps and per-query ranking.

Measurements and an honest list of limitations: https://github.com/selfxplanatorium/bettersearch-vicinae/blob/main/docs/comparison.md

Notes for review

Native code. The index comes from @ff-labs/fff-node, the official npm package published by fff's author, with prebuilt binaries for each platform from fff's npm packages. Nothing is downloaded at runtime. Binaries are installed at build time by scripts/install-daemon.mjs and verified against the integrity hashes in assets/daemon/package-lock.json. When CI=true, the binaries for all 8 supported platforms are included, so the single store bundle runs on Linux (x64/arm64, glibc/musl), macOS (x64/arm64) and Windows (x64/arm64). The bundle is about 73 MB.

Background process. Vicinae runs commands in short-lived workers, so the index lives in one small Node process (assets/daemon/daemon.mjs), started on first use with Vicinae's own Node runtime. It never outlives Vicinae:

  • It exits within 10 seconds of the Vicinae server or extension manager exiting, including when the extension manager lingers after the server stops.
  • It exits when the extension is uninstalled.
  • It can be stopped from Manage File Index.
  • A daemon from an older build is detected by a hash of its script and replaced.

It listens only on a per-user Unix socket (a named pipe on Windows) and makes no network connections. Architecture: https://github.com/selfxplanatorium/bettersearch-vicinae/blob/main/docs/architecture.md

Spawned programs. Only the user-configured editor command (for "Open in Editor at Line") and the daemon itself. Terminal editors run through runInTerminal. Opening, revealing and copying files use @vicinae/api.

Testing

  • vici lint and scripts/validate-extension.ts pass.
  • npm ci --legacy-peer-deps and bunx vici build with CI=true produce a bundle containing all 16 native packages.
  • End to end on Linux x64 (CachyOS, KDE Plasma 6.7, Vicinae 0.29.1): all three commands, previews, pagination across multiple indexed folders, editor command argument handling, daemon replacement after a rebuild, stale socket recovery, and exit when Vicinae exits.
  • macOS, Windows and ARM have not been run on real hardware. Their code paths (named pipe on Windows, .cmd editor shims, musl detection by fff) are implemented but untested.

Screenshots

Search File Contents

Search Files with a misspelled query

@clankus-aurelius

clankus-aurelius commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for contributing an extension to Vicinae! 👋

Before publication, this pull request receives two reviews:

  1. An automated review for extension guidelines, safety, error handling, and likely correctness issues.
  2. A final review from a Vicinae maintainer.

✅ Ready for human review. The automated reviewer approved the latest commit and a maintainer has been notified.

No blocking findings remain on the latest commit.

The automated reviewer examines only the current commit. New commits invalidate its previous decision and start another review.

@clankus-aurelius clankus-aurelius added the ai-reviewing Automated extension review is running label Oct 10, 2026

@clankus-aurelius clankus-aurelius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two cross-platform and manifest accuracy issues should be addressed.


Automated extension review passed. A maintainer review is still required.

This is an AI-generated first pass and may be mistaken. If a finding is unclear or incorrect, reply in the relevant thread and mention @aurelleb.

Comment thread extensions/bettersearch/package.json Outdated
{
"name": "roots",
"title": "Indexed Directories",
"description": "Comma-separated directories to index. Hidden folders and gitignored files are skipped outside git repositories.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Indexing preference describes .gitignore behavior incorrectly

Rule: MANIFEST-001

The preference says gitignored files are skipped outside Git repositories, while the supplied implementation documentation states that .gitignore rules are respected inside repositories and hidden files are skipped outside them.

Suggested resolution: Describe the inside- and outside-repository behavior separately.

Suggested change
"description": "Comma-separated directories to index. Hidden folders and gitignored files are skipped outside git repositories.",
"description": "Comma-separated directories to index. Hidden folders are skipped outside Git repositories; .gitignore rules are respected inside them.",

/>
<Action.CopyToClipboard
title="Copy Name"
content={path.split("/").pop() ?? path}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Copy Name returns the full path on Windows

Rule: CORRECTNESS-001

Splitting only on / does not separate Windows paths, which use \, so Copy Name copies the entire path on supported Windows installations.

Suggested resolution: Import basename from node:path and use basename(path) for the copied name.

@clankus-aurelius clankus-aurelius added human-reviewable Automated review passed; ready for maintainer review and removed ai-reviewing Automated extension review is running labels Oct 10, 2026
@clankus-aurelius

Copy link
Copy Markdown
Collaborator

@aurelleb automated review passed for e2cb586; this extension is ready for your review.

@clankus-aurelius clankus-aurelius added ai-reviewing Automated extension review is running and removed human-reviewable Automated review passed; ready for maintainer review labels Oct 10, 2026

@clankus-aurelius clankus-aurelius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Both previous findings are resolved by the incremental changes. No new actionable issues were introduced.


Automated extension review passed. A maintainer review is still required.

This is an AI-generated first pass and may be mistaken. If a finding is unclear or incorrect, reply in the relevant thread and mention @aurelleb.

@clankus-aurelius clankus-aurelius added human-reviewable Automated review passed; ready for maintainer review and removed ai-reviewing Automated extension review is running labels Oct 10, 2026

This branch has not been deployed

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

Labels

human-reviewable Automated review passed; ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants