Ajakfial/Wilfred 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 15 个 Star、3 次 Fork。
仓库全名
Ajakfial/Wilfred
README 摘要
(THIS README IS MADE BY CURSOR AI, EVERYTHING ELSE, INCLUDING CODE, IS WRITTEN BY HUMAN HAND.) Wilfred Website: https://ajakfial.github.io/Wilfred/ SourceForge: https://sourceforge.net/projects/wilfred/ GitLab mirror: https://gitlab.com/gakifdezel/WilfredLauncher Codeberg mirror: https://codeberg.org/fzdtestacc/Wilfred Languages: Deutsch · Español · Français · Italiano · 日本語 · 한국어 · Nederlands · Polski · Português ·…
Wilfred is a fast, lightweight, cross-platform desktop search engine and
application launcher. It is designed as a deep OS search layer: files, folders,
applications, browser integration, calculator, and filtered queries from a
single summonable search bar.
Wilfred is human-crafted. AI is a tool used only for a short list of
exceptions, never a contributor: see AI usage for what is
allowed, what is refused, and how the repository enforces it.
Features
Incremental, persistent filename/path/metadata index with a write-ahead log
Filesystem watchers (ReadDirectoryChangesW, FSEvents, inotify) plus rescan fallback
Fuzzy matching, acronyms, token/path ranking, recency and frequency signals
Typo safety: Damerau (transposition-aware) near-miss matching on names, tokens and paths, plus Did you mean correction (commands, history, filenames)
Inline autocomplete: ghost completion (→ to accept) + top-N candidates from history, commands and the index
Content indexing for source, config, and text documents
Real document text extraction (PDF, Office, RTF, HTML) into the content index
Optional semantic search: local embeddings (llama.cpp server/model or built-in hash) + HNSW vector index (vectors.bin next to WAL/snapshot) merged with trigram soft-match (providers.semantic, embedding.*)
Optional AI assistant (ai .../ask ..., screen-aware ai see ...) with your own keys: OpenAI, Anthropic, Gemini, Groq
Snippets with folders, {date}/{clipboard}/{query} placeholders, and optional global abbreviations in any app
Quick notes + todos (note ..., todo ..., persistent in the data dir)
Rich file previews (documents, CSV, images, folders) in the overlay (F3) plus wilfred preview
Calendar (.ics), contacts (.vcf), and notes (Markdown) sources + optional OCR indexing via tesseract (sources.*)
Cross-platform overlay (Windows WebView2 topmost, macOS floating panel, Linux WebKitGTK with automatic X11 canvas fallback, layer-shell anchored on Wayland compositors, all above/skip-taskbar) with Ctrl/⌘+K actions popover and matching shortcuts in both Linux backends
Browser bookmarks, history, and open tabs (bm, provider-backed)
Instant NTFS full-disk enumeration via the USN journal on Windows
Official OS index federation (os_search:): Windows Search, Spotlight,
Tracker/Baloo, locate fill gaps Wilfred’s index misses (os <query>
forces it, duplicates dropped)
Preview pane in the overlay (F3) plus wilfred preview, and chained result actions (open+copy_path) + named multi-step workflows (workflows:)
Mini results for weather, time, disk, RAM, CPU, processes, battery, windows, timers, notes, media, network, layouts, and more
Screen-aware AI (ai see ... sends a screenshot as vision input to your provider)
Quick notes now live as real Markdown files, searchable both as cards and through notes search
System-wide automation: extra global hotkeys (hotkeys:), wilfred workflow / wilfred exec CLI triggers
Search macros (!yt, gh, wiki, plus custom templates in config) + parameterized quicklinks (quicklinks: with {1}/{*}/{query})
Per-app extra context actions (app_actions:) on top of the built-in file actions
Large-file finder + duplicate candidates from the index (large, dupes)
File conversion (convert song.wav to mp3, convert photo.bmp to png: native WAV/RAW + BMP/PNG/PPM/TGA, ffmpeg for mp3/ogg/flac/jpg/webp) + background removal (bgremove photo.png to transparent PNG, no model needed)
Process killer (kill <pid|name>), native media keys (media play/next/mute/vol – no helpers to install), network tools (ping, dns, myip), speech-to-text (transcribe via whisper CLI or the built-in spoke engine)
Composable filters (*.cpp in Projects, type:image, size:>10mb, named scopes)
Application discovery (Start Menu / .app bundles / .desktop files)
Rich file actions (copy path flavors, SHA-256 hash, zip, terminal/editor here, new file/folder, Open With)
Move to trash and extract archives from the overlay (inline confirm before deleting; zip entries are path-traversal checked)
Inline audio/video previews in the details pane (browser-playable formats up to 10 MB, no external player)
Multi-select results (Ctrl/⌘-click to toggle, Shift-click or Shift+arrows for ranges) and batch actions, plus drag files out of the overlay onto other apps
Configurable overlay keybindings (keybinds:), saved searches (searches: + saved mini), a recent mini, and custom_metadata: surfaced by meta
wilfred doctor health report (config, data dir, index, hotkey, overlay, services) with [ok]/[warn]/[FAIL] checks
Default-browser detection, URL open, and web-search fallback
Native and stdio plugins, plus extra search backends via providers
Calculator plus unit, currency, color, date, and small dev utilities
System commands from the overlay (lock, sleep, shutdown, restart, logout, empty trash)
System toggles (wifi on/off, bluetooth toggle, volume 50/mute, brightness 70) + settings deep-links (settings wifi/bluetooth/sound/display/...) – real OS backends on Windows/macOS/Linux, honest unsupported errors on mobile/BSD gaps
Package-manager search (winget firefox, brew switch, apt vlc – Enter installs, Tab copies the command; packages lists detected managers)
Settings + setup (settings config open/validate, settings edit <key> <value>, setup, wilfred setup --overwrite, wilfred config-get/set/reset, wilfred config-validate/open/path) and opt-in remote search backends (remotes: – your endpoints only, off by default; per-source headers: + max_results:)
Android app (Kotlin UI + C++ core via NDK → .apk): floating W button, search bar, same index/search/ranking – see docs/android.md
iOS app (SwiftUI + same C++ core → simulator .app): same search UI as Android (app-icon entry; iOS forbids overlay buttons), sandbox-only index – see docs/ios.md
Local backup/restore and optional remote sync (backup, restore, sync-push, sync-pull)
Import from other launchers (wilfred import --list/--detect/auto --dry-run/--overwrite): Alfred, Raycast, PowerToys Run, Flow Launcher/Wox, Keypirinha, Listary, Ulauncher, Albert, KRunner, Rofi – see docs/import.md
YAML configuration with validation, Did you mean hints, and human-readable errors
Global hotkey: Ctrl+Alt+W (Windows/Linux), ⌘+Alt+W (macOS), configurable
Local search history (optional; disable or wilfred history-clear)
Overlay UI plus CLI (search, launch, index, status, backup/sync, import)
Screens
The overlay, summoned anywhere
Instant calculator results (Did you mean fixes included)
help lists every mini command
AI usage
Wilfred is human-crafted. The implementation is written by hand, reviewed by
hand, and owned by the person who submits it. AI has not written the search
engine, the ranking pipeline, the index structures, the fuzzy matcher, the
query parser, the platform backends, the overlay UI, or any security or
performance-critical path. The repository is deliberately arranged so that
the forbidden path is the hard path.
This README is the documented exception: its prose is AI-assisted. The code
is not.
What AI may do
Only these tasks, each with a written workflow in .agents/allowed.md:
Documentation (docs/, README.md, *.md) expanded from a human
outline, with every word reviewed for technical accuracy.
Minor minis added to src/search/minis.cpp only after a human has
written the enum value, parser hook, and switch-case skeleton.
Small fixes such as one-line bug fixes, typos, missing includes, and
const corrections, identified and applied by a human.
Moderate refactors confined to one file, with no public API or data
structure changes.
Test additions for existing behavior, with the human defining the test
name and the expected result.
Build and CI tweaks such as warning flags, matrix entries, timeouts,
and flaky-test retries.
Localization of lang/*.yml, with placeholders and command syntax kept
byte-identical and translations spot-checked by a human.
Even for these, a human defines the content or skeleton and reviews every
line. Humans write commit messages and PR descriptions, sign their commits,
and include Human-authored: yes in pull requests. AI-authored commits, PRs,
and PR descriptions are explicitly banned.
What AI may not do
The zero-tolerance list lives in .agents/forbidden.md. It covers core
algorithms and ranking, index and query structures, platform backends,
filesystem watchers, hotkeys, overlays, autostart, power actions, toggles,
window management, media keys, security-sensitive code, performance-critical
paths, architecture decisions, and new dependencies. An agent may not produce
this work as a patch, draft, pseudocode, example, or test.
How the rules are enforced
AGENTS.md is the canonical policy. It defines the allowed exceptions,
the forbidden areas, the human review requirement, and the consequences.
.agents/ contains the detailed rules: allowed.md, forbidden.md,
workflows.md, helper scripts, and code templates.
.agents/skills/ contains loadable skills for Claude Code and other
agents. wilfred-ai-policy is the entry skill: it tells an agent to stop
before touching a forbidden path and to hand back a plan instead of code.
Task skills encode the documentation, tests, minor-mini, localization,
build/CI, and commit workflows.
Ignore files for Cursor, Gemini CLI, Aider, Codeium/Windsurf, Google
AI, Cline, Roo Code, Augment, Copilot, Antigravity, and scc live in
.agents/ai-ignore/. They carry the same forbidden-path list and mirror
.agents/ai-ignore/.cursorignore. AI tools only discover these files at
the repository root, so they are dormant in this checkout; see
.agents/README.md for the restore step.
Instruction files (CLAUDE.md, GEMINI.md, and
.github/copilot-instructions.md) point agents back to AGENTS.md, the
policy skill, and the allowed workflows instead of restating the rules in
ten different dialects.
.githooks/pre-commit checks AI policy compliance before a commit
lands, and SHAME.md is the public record for violations.
Violations mean a permanent ban and a public entry in SHAME.md. The policy
has no “I only used it a little” exception.
These guardrails are not a sandbox. An AI tool can ignore an ignore file, and
a terminal can bypass it. That is why the policy, the hooks, the human review
requirement, and the public violation record exist: the editor defaults are
the first layer, not the only one. In practice, refusal is the default: an
agent has to deliberately bypass a documented rule to touch a forbidden path,
and the result still has to pass human review.
Build
Requires CMake 3.16+ and a C++20 compiler (MSVC, Apple Clang, or GCC).
On Linux, X11 development headers enable the overlay (libx11-dev); on
Wayland sessions the WebKit overlay additionally becomes a native
layer-shell surface when libgtk-layer-shell-dev is installed
(Sway/wlroots, KDE Plasma). GNOME has no layer-shell protocol, so a
companion GNOME Shell extension (packaging/gnome-shell-extension/)
keeps the Wilfred window on top and out of the taskbar there.
Run
# Background daemon: overlay, indexer, hotkey
wilfred
# One-shot search against the local index
wilfred search firefox
# Search and open the top result
wilfred launch firefox
# Index configured roots now
wilfred index
# Statistics
wilfred status
# Import settings from another launcher
wilfred import --list
wilfred import --detect
wilfred import auto --dry-run
wilfred import alfred --from Alfred.alfredpreferences --dry-run
User config is created on first run:
Platform
Config
Index data
Windows
%APPDATA%\Wilfred\wilfred.yml
%LOCALAPPDATA%\Wilfred\
macOS
~/Library/Application Support/Wilfred/
same
Linux
~/.config/wilfred/wilfred.yml
~/.local/share/wilfred/
BSD
~/.config/wilfred/wilfred.yml
~/.local/share/wilfred/
See config/wilfred.default.yml for the full schema (index roots, excludes,
system directories, ranking weights, aliases, hotkey, history, browser).
Migrating from another launcher
wilfred import brings hotkeys, custom web searches (as macros: +
quicklinks:), snippets, aliases, theme, and the default search template
into wilfred.yml. Merging is the default; --overwrite replaces
conflicts, --dry-run previews, and a .pre-import.bak backup is written
before every real import.
OS
Supported sources
macOS
Alfred (Alfred.alfredpreferences bundle), Raycast (quicklinks JSON)
Tests cover index CRUD, persistence/recovery, fuzzy/rank/filter, math, query
classification, config validation, history, paths, IPC, and application discovery.
Performance
Wilfred is a single C++20 binary with no vendored third-party libraries –
everything (JSON, YAML, mmap wrapper, CRC32) is implemented in-tree, so
there is nothing extra to install (the Linux overlay uses system X11/WebKit
libraries when present, plus gtk-layer-shell for native Wayland anchoring,
with an X11-canvas fallback). The
speed comes from the index design (see docs/architecture.md):
Compact memory-mapped record store with a string intern pool (no duplicate
path/name strings in RAM)
Trigram + token indexes so queries hit posting lists, not full scans
Write-ahead log with periodic snapshots and crash recovery – writes are
appends, reads never block on persistence
Incremental, debounced filesystem-watcher updates instead of rescans
Bounded result sets (top-40) with per-query timeouts on plugins
wilfred_bench (benches/bench_main.cpp) measures the hot paths on
synthetic 1K–100K filename datasets (10 timed iterations + 1 warmup, 5 for
the 100K insert) and reports Min / Median / Mean / P95 / Max milliseconds:
Benchmark
What it measures
String pool: intern 100K
Interning throughput (index memory efficiency)
Tokenizer: tokenize 100K
Filename tokenization
Index insert: 1K / 10K / 100K
Bulk index build
Index query: 10K / 100K records
Posting-list lookup
Fuzzy search: 10K targets
Damerau-aware scoring throughput
Ranking: 10K scored hits
Weight scoring + top-40 selection
Filter chain: 10K records
Extension/kind filter evaluation
Math evaluation: 1K expressions
Calculator parse + eval
Snapshot save / load: 10K
Persistence round-trip
Memory reporting: 100K index
Index footprint accounting
Run it on your own hardware before quoting numbers – results depend on CPU,
disk, and dataset shape:
Pushing a v*.*.* tag runs .github/workflows/release.yml, which builds
Release binaries and attaches one archive per platform to the GitHub Release
(see docs/building.md#packaging-what-ci-does):
Job
Artifacts
windows-x64
Portable .zip, .msi + Setup.exe wizard (WiX v3, per-user, no UAC), Chocolatey .nupkg (embedded portable, no downloads at install)
linux-x64
Portable .tar.gz
freebsd-x64
Portable .tar.gz (FreeBSD release job; other BSDs build from source – see docs/bsd.md)
macos-arm64
Portable .tar.gz
android
.apk + .aab – signed when keystore secrets exist, otherwise -unsigned suffixed (see docs/android.md)
ios
Unsigned simulator .zip (see docs/ios.md)
Desktop archives stage the binary with ui/overlay/, README.md, and
config/wilfred.default.yml. Windows binaries always carry the publisher
stamp Wilfred Open Contributors via VERSIONINFO; Authenticode trust comes
from PFX or Azure Trusted Signing secrets when configured
(see docs/signing.md, docs/installer.md).
Production deployment
Run the daemon, not one-shots.wilfred daemon (bare wilfred) is the
long-lived process: indexer + watcher + hotkey + overlay + IPC server.
Run it as a login item / autostart entry (wilfred autostart enable
registers this binary on Windows/macOS/Linux/BSD); the tray icon
(Windows) quits it.
CLI subcommands (search, launch, status, …) talk to the running
daemon over the local IPC socket when available (see docs/cli.md,
docs/ipc-and-api.md).
Config is code. First run writes a validated wilfred.yml
(locations table above); invalid keys fail with human-readable errors and
Did you mean hints, never silent defaults. For fleets, distribute a
baseline wilfred.yml (roots, excludes, weights, aliases – full schema in
docs/configuration.md and config/wilfred.default.yml) and let users
override locally.
Data and DR. Index, history, clips, notes, and logs live in the per-OS
data dir (table above). backup / restore move a machine’s state;
sync-push / sync-pull replicate it (see docs/sync-and-backup.md).
Test restores before you need them.
Observe it.wilfred status reports index health; logging.* keys
control log verbosity/retention; the optional local HTTP API (api.*,
authenticated) exposes /search, /status, /index, /launch, and
backup/sync endpoints for dashboards and automation.
Privacy posture. Local-first: no account, no telemetry, no network
calls unless you enable them (weather/AI/sync). Disable or cap history
via history.* where policy requires; AI providers need the user’s own
API keys (ai.*, off by default).
Mobile is experimental (as of v46.5.8). The Android (.apk) and iOS
(simulator .app) builds install and run but are not daily-driver ready
pending further testing and development – deploy desktop first
(see docs/android.md, docs/ios.md).
评论