Building from source
Prerequisites
- Rust (stable, 1.94 or newer)
- Bun. It is the only package manager; never use npm or yarn.
- The Tauri prerequisites for your OS
- Node.js, needed only to run the frontend tests (Vitest runs on Node)
Commands
src-tauri/target/release/bundle/. Windows builds bundle DirectML at build time, macOS builds use CoreML, and Linux builds run on CPU. See GPU and models.
ONNX Runtime staging
Echophrase loads ONNX Runtime dynamically (see ADR 0002), so the runtime library has to be on disk before the app starts. You do not do this by hand.scripts/ensure-ort.mjs runs before every tauri:dev* and tauri:build* command, and standalone as bun run setup:ort.
It is the only place the ORT version and the NuGet SHA-256 hashes live. It verifies each package hash before extracting (a mismatch fails loudly and stages nothing), and it is a fast no-op when the staged files still match the stamp in .ort/stamps/.
On Linux, WSL and macOS the script writes
ORT_DYLIB_PATH into the matching section of env.yaml, overwriting manual values. To use a custom ONNX Runtime build, call bun x tauri dev directly. On Windows only a placeholder value is removed; any other value in env.yaml is kept as a manual override (a warning prints if its path does not exist).
Environment configuration
env.yaml is gitignored. Create it from env.yaml.template. It is hierarchical (shared values first, then platform overrides), loaded by scripts/env/load.mjs before Tauri starts and validated by scripts/env/schema.ts. When you change env.yaml, update env.yaml.template too.
There are no CUDA variables and no server URL in it. The frontend link config in src/lib/config/environment.ts covers website and docs links only.
Dev server port
The Vite dev server usesDEV_PORT (default 8420), with HMR on DEV_PORT + 1. Tauri’s devUrl follows it. Do not edit ports in tracked files. If your machine cannot bind 8420, set DEV_PORT in your gitignored env.yaml (shared: or the platform section); for any non-default value the launcher generates a gitignored .tauri-dev-port.json and passes it to tauri dev --config.
Windows Hyper-V silently reserves random port ranges, and the reservations move. The symptom is a bind failure with nothing visible in netstat. Run python scripts/check-ports.py to check.
Windows
- Windows 11 is the supported version. Windows 10 should work but is untested.
- Install Visual Studio 2022 (or Build Tools) with the Desktop development with C++ workload.
- Run
bun run tauri:dev:windows, orscripts/win/dev.ps1. - DirectML is bundled; there is nothing else to install.
DirectML.dllis bundled rather than taken from System32 because even current Windows 11 ships a copy that is too old for ORT 1.24. SeeKNOWN_ISSUES.mdin the repo.
macOS (Apple Silicon)
- Apple Silicon only (M1 or newer). Intel Macs are not supported. macOS 13.3 or newer is required, because ONNX Runtime 1.24 uses C++20
std::to_chars. - Install the Xcode Command Line Tools (
xcode-select --install), then runbun run tauri:dev:mac. - Auto-paste sends a synthetic Cmd+V and needs the Accessibility permission. This is also why there is no Mac App Store build: the sandbox blocks that keystroke.
macOS dev-tool shortcuts and hotkey notes
macOS dev-tool shortcuts and hotkey notes
F5does nothing on macOS in the dev app: the function-key row is reserved by the OS. UseCtrl + Shift + R(a cache-clearing hard refresh) with the window focused. Use the literal Control key; Cmd-modified combos are swallowed by the responder chain before the web view sees them.ctrlin a stored hotkey maps to Tauri’sCommandOrControl, which resolves to Cmd on macOS. The defaultctrl+shift+spacetherefore fires as Shift+Cmd+Space, and the UI shows Mac glyphs. The macOS default hotkey is the dictation key; see macOS dictation key.
WKWebView rendering quirks
WKWebView rendering quirks
- Tailwind v4 gradients use
in oklabinterpolation, which needs Safari 16.2 or newer (macOS 13.1+). Override rules live insrc/app.css. - An element with both
overflow: hiddenandwill-change: transformclips itsbox-shadow. Putoverflow-hiddenon an inner wrapper. - Do not force
transform: translateZ(0)orwill-changeglobally; it can suppress gradient and shadow rendering.
Linux
Linux is community-supported: there are no official binaries, and CI only compile-checks it. Transcription runs on CPU. Audio capture links ALSA throughcpal, so builds need the ALSA development package (CI installs it too).
libasound2-plugins so ALSA can route to PulseAudio. The .deb package declares pulseaudio-utils and libasound2-plugins as dependencies.
On GNOME the tray icon needs the AppIndicator extension:
--no-default-features. The only optional cargo feature is devtools.
WSL
WSL2 works as a CPU-only development environment. There is no GPU setup: no NVIDIA driver, CUDA Toolkit, cuDNN or GCC pin is needed (see ADR 0001). Follow the Linux package list above, then:LD_LIBRARY_PATH keeps /usr/lib/wsl/lib only so the GPU probe can read VRAM size through NVML.
Microphone
WSLg exposes the Windows microphone as a PulseAudio source (RDPSource on /mnt/wslg/PulseServer), not as an ALSA device. When the app detects WSLg it captures through parec instead of opening a cpal stream. Install the tools if they are missing:
echophrase CLI still uses cpal directly, so cargo run -p echophrase-cli -- record on WSL can additionally need libasound2-plugins and an ALSA default that points at PulseAudio.
Rendering tearing
In the WSL dev app, rows can vanish or tear when you sweep the pointer across a list or scroll with the cursor over it, most visibly in the Settings modal. This is a WebKitGTK and WSLg DMA-BUF artifact, not a CSS bug.env.yaml.template sets WEBKIT_DISABLE_DMABUF_RENDERER: "1" under wsl:; copy that line into your env.yaml if it predates the template. If it still recurs, try in order:
WEBKIT_DISABLE_COMPOSITING_MODE: "1"(costs animation smoothness).- Dropping
LIBGL_ALWAYS_SOFTWAREso WSLg’s d3d12 passthrough provides hardware GL. Be ready to revert this one; a broken GL path can stop the window rendering at all.
src/app.css: that ships to every platform. It reproduces only in the WSL dev build; shipped Windows builds use WebView2.
Calling Windows from WSL
A few features have to reach Windows executables from inside WSL. The traps below are the reason the code looks the way it does.- Opening URLs in the Windows browser. The user’s default Windows browser is where links should open, so the app launches
cmd.exe /c start "" <url>with each argument passed separately,&,|,<and>escaped with^, and the working directory set to/mnt/c. WSL converts argv to a Windows command line using MSVC quoting rules, whichcmd.exedoes not share: an unquoted&becomes a command separator, and\"is not an escape forcmd.exe. The empty title argument stopsstarttreating the URL as a window title.rundll32.exe url.dll,FileProtocolHandleris the fallback; it uses standard argument parsing, so it needs no escaping. Approaches that fail:explorer.exe <url>(opens File Explorer), PowerShellStart-Process(slow cold start,&handling),wslview(discontinued, not preinstalled) andxdg-open(fails in headless WSL2). - UNC working directories. A Windows process spawned from WSL inherits
\\wsl.localhost\<distro>\...as its working directory, whichcmd.exeandstartcannot handle. Always spawn Windows executables with a/mnt/*working directory such as/mnt/c. - Showing a folder in Explorer. Convert the path with
wslpath -w;explorer.exehandles UNC paths fine for browsing. - Clipboard. The Linux-side clipboard does not bridge to Windows. Text can be piped to
clip.exeon stdin. 'DOSKEY' is not recognizedwarnings when spawningcmd.exeare harmless. They come from the Windows AutoRun registry key.
WSL detection
The backend treats the environment as WSL ifWSL_DISTRO_NAME or WSL_INTEROP is set, or /mnt/wslg/PulseServer exists. The frontend asks once at startup (through the get_system_info command) and caches the result in src/lib/stores/platformCache.ts, so later platform checks need no IPC round trip.