### Run Windows setup script Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Run the checked-in setup script from the repository root. It keeps an existing compatible Visual Studio installation and installs only missing prerequisites. The script also installs rustfmt, Clippy, and rust-analyzer, fetches Cargo dependencies, and runs cargo check --all-targets. ```powershell powershell -ExecutionPolicy Bypass -File .\scripts\setup-windows.ps1 ``` -------------------------------- ### Build and install Hex from source Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Clone the Hex repository, run the Linux install script, install the model, and launch Hex. Do not run as root; the installer creates a user-local binary and marks the build as source-build. ```sh git clone https://github.com/anomalyco/hex.git cd hex ./scripts/install-linux.sh ~/.local/bin/hex model install ~/.local/bin/hex ``` -------------------------------- ### Install dependencies and inspect installer before running Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Installs required runtime libraries (Arch package names) and downloads the installer for inspection before running it. The installer names missing packages if a runtime library is missing. After installation, run ~/.local/bin/hex; its first run downloads a speech model. ```sh sudo pacman -S --needed alsa-lib curl jq \ libxkbcommon libxkbcommon-x11 libx11 libxcb openblas openssl util-linux \ vulkan-icd-loader wl-clipboard wtype xxd curl --proto '=https' --tlsv1.2 -fsSLO \ https://anoma.ly/hex/files/install-linux.sh less install-linux.sh sh install-linux.sh ~/.local/bin/hex model install ~/.local/bin/hex ``` -------------------------------- ### Uninstall Hex while preserving logs and settings Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Removes the application but keeps logs and settings. The installer uses no root access and does not start recording during installation. ```sh sh install-linux.sh uninstall ``` -------------------------------- ### macOS Setup Commands Source: https://github.com/anomalyco/hex/blob/dev/CONTRIBUTING.md Run these commands after installing Rust, Xcode 26 with the Metal toolchain, and uv on macOS to set up the Hex development environment. ```sh ./scripts/setup.sh ./scripts/setup-parakeet.sh ``` -------------------------------- ### NixOS module import and enable Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Import the NixOS module and enable the package system-wide. Does not start a root service or enable autostart for every account. ```nix { imports = [ hex.nixosModules.hex ]; programs.hex.enable = true; } ``` -------------------------------- ### Development and testing commands Source: https://github.com/anomalyco/hex/blob/dev/AGENTS.md Common commands for setup, running the Hex daemon, CLI, meeting recording, MCP, app snapshots, and checks. Includes macOS and Linux test scripts. ```sh ./scripts/setup.sh ./scripts/setup-parakeet.sh cargo run -- listen cargo run -- status --json # asks the running Hex (docs/cli.md) cargo run -- dev dashboard # debug recognition TUI cargo run -- meeting record --title "Design sync" cargo run -- meeting probe cargo run -- mcp --meetings-dir tests/fixtures/meetings cargo run -- app -- --list-scenes cargo run -- app -- --snap /tmp/hex-settings.png --scene mac-settings cargo run -- app -- --snap /tmp/hex-modes.png --scene modes --theme light cargo run -- app -- --snap /tmp/hex-onboarding.png --scene mac-onboarding ./scripts/install-app.sh scripts/check # fmt, clippy, every test scripts/check meeting::query # fmt, then only matching tests git diff --check ./scripts/test-app-identity.sh # macOS only ./scripts/test-install-linux-release.sh # x86_64 or aarch64 Linux cd sdk/typescript && bun run check && bun run test && bun run build ``` -------------------------------- ### Install, check, and transcribe a model Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Install the selected model (with Hex stopped), check it, and transcribe a WAV file. The model install downloads in this process. ```powershell cargo run -- model install cargo run -- model check cargo run -- model transcribe .\sample.wav ``` -------------------------------- ### Upgrade from HEX 2.3.1 Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Removes 2.3.1's files and installs the current build. The new build is a separate install in ~/.local/share/hex and imports nothing from 2.3.1's ~/.local/share/voice-control, so set up the model and settings again. The installer refuses to replace 2.3.1's files, so remove them first. The paths assume default XDG directories. ```sh systemctl --user disable --now hex.service rm -f ~/.config/systemd/user/hex.service ~/.local/bin/hex \ ~/.local/share/applications/hex.desktop ~/.config/autostart/HEX.desktop systemctl --user daemon-reload rm -rf ~/.local/share/voice-control # optional: 2.3.1's settings, logs, and models curl -fsSL https://anoma.ly/hex/files/install-linux.sh | sh ~/.local/bin/hex model install ~/.local/bin/hex ``` -------------------------------- ### Open the desktop application Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Launch the desktop app after the model is installed. ```powershell cargo run -- app ``` -------------------------------- ### TypeScript SDK Validation Commands Source: https://github.com/anomalyco/hex/blob/dev/CONTRIBUTING.md Run these commands for TypeScript SDK changes in sdk/typescript, which requires Bun. They install dependencies, check, test, and build the SDK. ```sh cd sdk bun install --frozen-lockfile cd typescript bun run check bun run test bun run build ``` -------------------------------- ### Hex Linux CLI commands Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Commands to open, start, query, quit, restart, and configure Hex on Linux. Use `hex status [--json]` to query the running process, `hex quit` and `hex restart` refuse while dictation records or transcribes unless `--force`, and `journalctl --user -u hex.service` shows diagnostics of the supervised process. ```sh hex # open the window, starting Hex if needed hex start # start Hex in the background; no window hex status [--json] # query the running Hex, not an old log entry hex quit [--force] # finish accepted work, release the microphone, exit hex restart [--force] # restart the systemd unit in this desktop's environment # (over SSH: the one it last ran in) hex settings set sound_effects off # every control command (docs/cli.md) journalctl --user -u hex.service # diagnostics of the supervised process ``` -------------------------------- ### Download and Installation Flow Diagram Source: https://github.com/anomalyco/hex/blob/dev/docs/features/README.md Overview of the download and installation process for Hex across platforms, including macOS, Windows, Linux, and phone. Highlights platform-specific requirements, mirror sources, and the separate network dependency for local model preparation. ```ts Download Hex // setup.download-recovery ├── anoma.ly/hex names the visitor's platform // setup.download-button │ ├── Mac -> DMG | Intel Mac -> disabled, "needs Apple silicon" │ ├── Windows x64 / ARM64 (UA-CH) -> hex-setup--windows-.exe + SmartScreen note │ ├── Linux -> copyable `curl … install-linux.sh | sh` + Arch/glibc requirement │ ├── Phone -> Send yourself the link │ └── Other platforms -> every build, Homebrew, the GitHub release ├── Website, README, installers, apps, feeds, appcast -> anoma.ly/hex/files -> R2 bytes (Worker hex-production-site) ├── Releases up to 2.3.1 -> downloads.hex.kitlangton.dev (Kit's frozen bucket) -> the same bytes ├── GitHub v (app-v through 2.3.1) -> identical DMG, Setup.exe, and Linux bytes └── Older app cannot reach its update feed -> manually install the DMG Install on Windows // setup.windows-installer ├── Setup.exe, per user, no admin -> managed versions\\hex.exe │ ├── x64 without vulkan-1.dll -> stop with driver guidance │ ├── another version installed (e.g. self-updated) -> install this one over it │ └── finish -> Open Hex -> first-run tour downloads a model └── Settings › Apps -> uninstall every version, shortcut, Launch at login; keep data Install on Linux // setup.linux-installer └── curl … | sh -> signed feed -> verified artifact -> launcher + hex.service └── cannot start -> name the glibc floor or the missing Arch packages Prepare local models // separate network dependency └── Dictation -> huggingface.co and its download CDN └── Transfer fails -> host-specific guidance -> restore access -> Retry ``` -------------------------------- ### Run test binary on Linux Source: https://github.com/anomalyco/hex/blob/dev/docs/test-builds.md Starts the test build directly as the instance, bypassing the installed Hex's systemd unit. Run the service command in the foreground, then open the window in another terminal. ```sh hex quit chmod +x hex-*-linux-x64 ./hex-*-linux-x64 service # runs Hex in the foreground; Ctrl-C quits ./hex-*-linux-x64 # in another terminal: opens the window ``` -------------------------------- ### Install Hex on Arch Linux with yay Source: https://github.com/anomalyco/hex/blob/dev/README.md Install the hex-bin package from the AUR using yay. ```sh yay -S hex-bin ``` -------------------------------- ### Install Hex from .deb or .rpm package Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Installs the hex package on Debian/Ubuntu, Fedora, or openSUSE. The package installs /usr/bin/hex, the desktop entry, and the systemd user unit hex.service. There is no apt or dnf repository yet; download the package for your architecture from the provided URLs. ```sh sudo apt install ./hex.deb # Debian, Ubuntu sudo dnf install ./hex.rpm # Fedora (zypper install on openSUSE) systemctl --user enable hex.service # optional: start Hex at login ``` -------------------------------- ### Install Hex Linux beta via curl script Source: https://github.com/anomalyco/hex/blob/dev/README.md Installs the signed release on x86_64 Arch Linux (glibc 2.44 or later). Until Hex has a stable release on the release service, this installs the newest dev build, which keeps updating from the Dev channel. Use HEX_INSTALL_CHANNEL=stable or =dev to pick a channel explicitly. ```sh curl -fsSL https://anoma.ly/hex/files/install-linux.sh | sh ``` -------------------------------- ### List WASAPI inputs and compute backends Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Run from the project root to list available devices and model devices. Use before installing a model. ```powershell cargo run -- devices cargo run -- model devices ``` -------------------------------- ### Hex dictation CLI commands for Wayland without portal Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Commands to bind in a desktop without the GlobalShortcuts portal (e.g., Sway). They talk to the running Hex and never start it; starting while recording, stopping while idle, and cancelling while idle do nothing. `--raw` dictates without processing. ```sh hex dictation start # bind to a key's press: start recording hex dictation stop # bind to the same key's release: stop and transcribe hex dictation toggle # one key: start, then stop and transcribe hex dictation cancel # discard the recording hex paste-last # paste the last dictation again hex dictation toggle --raw # dictate without processing: paste the words as heard ``` -------------------------------- ### Pre-release SDK checks Source: https://github.com/anomalyco/hex/blob/dev/AGENTS.md Run from the sdk workspace root before releasing the TypeScript SDK. Installs dependencies, runs checks, tests, build, and a dry-run pack. ```sh cd sdk bun install --frozen-lockfile cd typescript bun run check bun run test bun run build npm pack --dry-run ``` -------------------------------- ### Install Hex from AUR package hex-bin Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Installs the AUR package hex-bin, which installs /usr/bin/hex, the desktop entry, and the systemd user unit hex.service. It is not on the AUR yet. pacman updates it; Hex never replaces a package-installed executable. ```sh yay -S hex-bin systemctl --user enable hex.service # optional: start Hex at login ``` -------------------------------- ### Install native build dependencies on Arch Linux Source: https://github.com/anomalyco/hex/blob/dev/AGENTS.md Install required packages for building Hex on x86_64 Arch Linux, the supported Linux beta host. Sets Rust to stable. ```sh sudo pacman -S --needed base-devel git rustup python alsa-lib curl jq openssl xxd \ util-linux libxkbcommon libxkbcommon-x11 libx11 libxcb openblas \ vulkan-headers vulkan-icd-loader \ shaderc spirv-headers clang cmake pkgconf wl-clipboard wtype rustup default stable ``` -------------------------------- ### Model card layout for setup picker Source: https://github.com/anomalyco/hex/blob/dev/docs/features/README.md Describes the layout of the model card in the setup picker, shared by every desktop root. Shows the title row with name and tags, detail line, warning for unsupported saved language, trailing edge actions, preparing progress, and speed/size/accuracy metrics. The recommendation tag uses the saved language from the catalog (English: Unified English first), and the Streams tag is only for the pinned artifact advertising streaming. ```plaintext Settings picker or setup > model card // setup.model-card; shared by every desktop root ├── Title row -> Name, recommendation tag, "Streams" tag // at most two tags │ ├── Recommendation -> For the saved language from the catalog (English: Unified English first) │ └── Streams -> Catalog `streams` (pinned artifact advertises streaming) ├── Detail line -> "Transcribes while you speak" (non-macOS: "… on a GPU"), │ coverage, benchmark, timestamps, Installed ├── Saved language unsupported -> Warning line naming the language it switches to ├── Trailing edge -> Active as dot + label; Cancel while preparing; else Use/Download ├── Preparing -> Progress bar with its "Downloading 37%" / "Loading model" label └── Speed · Size · Accuracy -> 100% minus the benchmark word error rate ``` -------------------------------- ### Register Hex.app with Launch Services for login-item smoke test Source: https://github.com/anomalyco/hex/blob/dev/AGENTS.md Use this command when replacing a local bundle outside Finder during a login-item smoke test. Register the new bundle with Launch Services before launching; pass the actual installed Rust host path if renamed. Verify registration and unregistration with `sfltool dumpbtm` and restore the user's original login-item state after the test. ```sh '/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister' \ -f /Applications/Hex.app ``` -------------------------------- ### Activation flow states Source: https://github.com/anomalyco/hex/blob/dev/docs/plans/single-process.md Shows the three possible activation paths: connecting to an existing instance, starting the systemd unit, or becoming the instance in-process. The systemd path writes session.env and starts hex.service with Type=notify. ```typescript connect(socket) ok -> Activate{token from XDG_ACTIVATION_TOKEN / DESKTOP_STARTUP_ID, session, show} -> exit 0 no instance, managed unit -> write session.env; systemctl --user start hex.service (Type=notify) -> Activate{token, show} no instance, otherwise -> become the instance in this process (custom data root, cargo run, non-systemd) ``` -------------------------------- ### Build and Run Hex with Nix Flakes Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Use these commands from a checkout with Nix flakes enabled to build Hex and run the model install and app commands. ```sh nix build nix run . -- model install nix run . -- app ``` -------------------------------- ### Validate Changes with Cargo and Git Source: https://github.com/anomalyco/hex/blob/dev/CONTRIBUTING.md Run these commands to validate Rust changes: format check, tests, clippy with warnings as errors, a snapshot run, and a git diff check. ```sh cargo fmt --check cargo test cargo clippy --all-targets --all-features -- -D warnings cargo run -- app -- --snap /tmp/hex-modes.png --scene modes git diff --check ``` -------------------------------- ### Home Manager module with autostart Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Import the Home Manager module and enable per-user autostart. Autostart defaults to false; when enabled, the unit is wanted by graphical-session.target by default. ```nix { imports = [ hex.homeManagerModules.hex ]; programs.hex = { enable = true; autostart = true; # Use your compositor's session target when appropriate: # systemdTarget = "sway-session.target"; }; } ``` -------------------------------- ### Sway key bindings for hold-to-dictate and toggle Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Example Sway config binds for hold-to-dictate on F9 and a toggle on Ctrl+Alt+d. These commands are safe to bind anywhere, including X11 beside the grabs. ```sh bindsym F9 exec hex dictation start bindsym --release F9 exec hex dictation stop bindsym Ctrl+Alt+d exec hex dictation toggle ``` -------------------------------- ### Scripted install of Hex on Windows Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Use this PowerShell command to install Hex without the installer. It downloads and runs install-windows.ps1, creating the same managed layout as the installer. Uninstall with install-windows.ps1 -Uninstall. ```powershell powershell -ExecutionPolicy Bypass -Command "iwr https://anoma.ly/hex/files/install-windows.ps1 -OutFile install-windows.ps1; ./install-windows.ps1" ``` -------------------------------- ### Install Hex with Homebrew Source: https://github.com/anomalyco/hex/blob/dev/README.md Install the Hex cask from the anomalyco tap. The cask installs the same signed app and keeps its built-in updater; it does not migrate or forcibly replace an existing Hex.app. ```sh brew install --cask anomalyco/tap/hex ``` -------------------------------- ### Launch Hex Setup Incomplete Flow Source: https://github.com/anomalyco/hex/blob/dev/docs/features/README.md Flow for launching Hex when setup is incomplete, covering upgrade scenarios from 2.3.1 or earlier on macOS. Notes the new identity 'anomaly.hex' and the migration check for 'anomaly-hex-identity'. ```ts Launch Hex, setup incomplete // setup.tour; full-window, own column ├── Upgrading from 2.3.1 or earlier (same `hex` folder) // setup.upgrade; macOS │ ├── `anomaly.hex` is a new identity: macOS kept none of the old grants │ ├── Settings without `anomaly-hex-identity` in `migrations` -> checked once at launch ``` -------------------------------- ### Recorder::start Source: https://github.com/anomalyco/hex/blob/dev/crates/capture-core/README.md Starts a new recording session based on the provided Plan. Validates the plan, refuses names that already exist in the directory, and starts sources 1..n before source 0, which owns audio. ```APIDOC ## Recorder::start ### Description Starts a new recording session based on the provided Plan. Validates the plan, refuses names that already exist in the directory, and starts sources 1..n before source 0, which owns audio. ### Method start ### Signature `Recorder::start(Plan) -> Result` ### Parameters - **plan** (Plan) - Required - The recording plan specifying sources, audio, input, frames, exclusions, fps, directory, and names. ### Returns - **Result** - A `Recording` instance on success, or an `Error` if validation fails or a name already exists. ### Example ```rust let mut recording = Recorder::start(Plan { sources: vec![ SourcePlan { source: Source::Display(display_id), long_edge: Some(2560) }, SourcePlan { source: Source::Window(window_id), long_edge: Some(1280) }, ], cursor: CursorDrawing::Hidden, audio: AudioPlan { mic: Mic::External(ExternalMic::default()), system: false }, input: Input::Host(input_rx), frames: Some(frames), exclude: Exclusions { windows: vec![my_overlay_window], apps: vec![] }, fps: 60, dir: bundle_dir, names: Names { videos: vec!["recording.mp4".into(), "window.mp4".into()], microphone: Some("audio.wav".into()), cursor: Some("cursor.json".into()), input: Some("input.json".into()), ..Names::default() }, })?; ``` ``` -------------------------------- ### Nix development shell commands Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Enter the Nix development shell and run the standard build, test, and run commands. The shell shares the native build environment and runtime library/plugin paths with the package. ```sh nix develop cargo build --locked cargo test --locked cargo run --locked -- app ``` -------------------------------- ### Install and use multilingual Parakeet model for Polish Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Name the multilingual Parakeet model for Polish. Use --language pl and --copy for recording. ```powershell cargo run -- model install parakeet_v3 --language pl cargo run -- model check parakeet_v3 --language pl cargo run -- record --model parakeet_v3 --language pl --copy ``` -------------------------------- ### Inspect hex service with systemctl and journalctl Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Check the status and logs of the hex user service. Use these commands to inspect failures. ```sh systemctl --user status hex.service journalctl --user -u hex.service ``` -------------------------------- ### model-install Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Installs a model, optionally specifying a language. ```APIDOC ## model-install ### Description Installs a model, optionally specifying a language. ### Method model-install ### Endpoint model-install ### Parameters #### Query Parameters - **model** (string) - Required - Model ID. - **language** (string) - Optional - Language code. ### Request Example ```json {"version": 4, "command": "model-install", "model": "parakeet_v3", "language": "en"} ``` ### Response #### Success Response (done) - **version** (number) - Protocol version. - **status** (string) - Always "done". - **message** (string) - Human-readable message. - **changed** (boolean) - Whether the command changed state. #### Response Example ```json {"version": 4, "status": "done", "message": "Model installed", "changed": true} ``` ``` -------------------------------- ### hex settings get Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Gets one setting, or every key under a prefix. ```APIDOC ## hex settings get ### Description Gets one setting, or every key under a prefix. ### Command `hex settings get ` ### Arguments - `` - The setting key or prefix (e.g., `meetings`). ``` -------------------------------- ### GET /models Source: https://github.com/anomalyco/hex/blob/dev/docs/specs/local-transcription-service.md Returns the list of available models. The optional `language` query parameter is used for readiness metadata, not to filter the catalog. ```APIDOC ## [GET] /models ### Description Returns the list of available models. The optional `language` query parameter is used for readiness metadata, not to filter the catalog. ### Method GET ### Endpoint /models ### Parameters #### Query Parameters - **language** (string) - Optional - Language for readiness metadata, defaults to "en" ### Response #### Success Response (200) - **models** (array of object) - List of available models #### Response Example { "models": [ { "id": "model-id", "name": "Model Name" } ] } ``` -------------------------------- ### hex.dictation.start() Source: https://github.com/anomalyco/hex/blob/dev/sdk/typescript/README.md Starts a dictation recording using the desktop capture. Returns a recording handle that provides access to audio levels, transcript, and cancellation. ```APIDOC ## hex.dictation.start() ### Description Starts a dictation recording using the desktop capture. Returns a recording handle that provides access to audio levels, transcript, and cancellation. ### Method start ### Endpoint hex.dictation.start() ### Parameters #### Request Body - **source** (string) - Required - Identifier for the source of the recording. ### Request Example ```ts const recording = await hex.dictation.start({ source: "my-app" }) ``` ### Response #### Success Response - **recording** (object) - Recording handle with properties: levels, audio, sampleRate, finish, cancel. #### Response Example ```ts const recording = await hex.dictation.start({ source: "my-app" }) ``` ``` -------------------------------- ### hex model list | use | install [id] | cancel Source: https://github.com/anomalyco/hex/blob/dev/docs/features/control-cli.md Manages models. `use` selects an installed model only, never downloads or repairs, and keeps the model's remembered language and hints (--language overrides). On Linux/Windows, `install` with Hex stopped downloads here; status, devices, check, and transcribe run here (macOS unsupported). ```APIDOC ## [POST] /control ### Description Manages models. `use` selects an installed model only, never downloads or repairs, and keeps the model's remembered language and hints (--language overrides). On Linux/Windows, `install` with Hex stopped downloads here; status, devices, check, and transcribe run here (macOS unsupported). ### Method POST ### Endpoint /control ### Parameters #### Path Parameters - **id** (string) - Required for use and optional for install - The model identifier. ### Request Body - **action** (string) - Required - The model action: "list", "use", "install", or "cancel". - **id** (string) - Optional - The model identifier. - **language** (string) - Optional - Overrides the model's remembered language. ### Response #### Success Response (200) - **models** (array) - List of models when listing. - **status** (string) - Status of the operation. #### Response Example { "models": ["model1", "model2"] } ``` -------------------------------- ### hex model install Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Downloads a model and switches to it. Defaults to the selected model. ```APIDOC ## hex model install ### Description Downloads a model and switches to it. Defaults to the selected model. ### Command `hex model install [id] [--language L]` ### Arguments - `[id]` - The model ID (optional, defaults to selected model). ### Options - `--language L` - Language for the model. ``` -------------------------------- ### create() Source: https://github.com/anomalyco/hex/blob/dev/sdk/typescript/README.md Creates a transcriber instance by starting the native helper and preparing the model. It waits for download, verification, and model loading, and returns a ready-to-use transcriber. ```APIDOC ## create() ### Description Creates a transcriber instance by starting the native helper and preparing the model. It waits for download, verification, and model loading, and returns a ready-to-use transcriber. ### Method create ### Parameters #### Options - **command** (string[]) - Required - The native helper command, e.g., `["/path/to/hex-service", "service", "--embedded"]`. - **model** (string) - Required - The model identifier, e.g., `"parakeet_unified_en"`. - **language** (string) - Optional - Language code, defaults to `"en"`. - **onProgress** (function) - Optional - Callback for progress events (`downloading`, `verifying`, `loading`). - **signal** (AbortSignal) - Optional - Abort signal for startup and preparation. ### Returns - **transcriber** (object) - A transcriber instance with `transcribe()` and `close()` methods, and properties `model`, `language`, and `pid`. ### Example ```ts const transcriber = await Hex.create({ command: ["/path/to/hex-service", "service", "--embedded"], model: "parakeet_unified_en", language: "en", onProgress: console.log, }) ``` ``` -------------------------------- ### Ready Transcriber with @kitlangton/hex Source: https://github.com/anomalyco/hex/blob/dev/docs/specs/local-transcription-service.md SDK 0.3.0 model-bound operation. Creation resolves after preparation; reuse across recordings. Cancelling an in-flight request closes the helper; an already-aborted request does not. Progress callbacks describe model setup, not inference percentage. ```ts import { create } from "@kitlangton/hex" const transcriber = await create({ command: ["/path/to/hex-service", "service", "--embedded"], model: "parakeet_unified_en", language: "en", onProgress, }) try { const result = await transcriber.transcribe(wav, { signal }) input.insert(result.transcript) } finally { await transcriber.close() } ``` -------------------------------- ### create() Source: https://github.com/anomalyco/hex/blob/dev/sdk/typescript/README.md Creates a HEX client with a custom command. Used to run an installed Hex as a direct child when no packaged helper is available. ```APIDOC ## create() ### Description Creates a HEX client with a custom command. Used to run an installed Hex as a direct child when no packaged helper is available. ### Method create ### Endpoint create() ### Parameters #### Request Body - **command** (array) - Required - Command to run, e.g., ["hex", "service", "--embedded"]. ### Request Example ```ts const hex = await create({ command: ["hex", "service", "--embedded"] }) ``` ### Response #### Success Response - **hex** (object) - HEX client instance. ``` -------------------------------- ### Recorder::start with Plan and audio sink Source: https://github.com/anomalyco/hex/blob/dev/crates/capture-core/README.md Starts a recording with multiple sources, audio, input, and frame tap. The microphone sink is bounded and never blocks; gaps are recorded when audio is dropped. The finishing handle returns immediately and can be waited on or polled. ```rust use capture_core::*; let (input, input_rx) = host_channel(1024, KeyPolicy::Chords); let (frames, frame_rx) = FrameTap::new(8, Duration::from_millis(500), 640); let mut recording = Recorder::start(Plan { sources: vec![ SourcePlan { source: Source::Display(display_id), long_edge: Some(2560) }, SourcePlan { source: Source::Window(window_id), long_edge: Some(1280) }, ], cursor: CursorDrawing::Hidden, audio: AudioPlan { mic: Mic::External(ExternalMic::default()), system: false }, input: Input::Host(input_rx), frames: Some(frames), exclude: Exclusions { windows: vec![my_overlay_window], apps: vec![] }, fps: 60, dir: bundle_dir, names: Names { videos: vec!["recording.mp4".into(), "window.mp4".into()], microphone: Some("audio.wav".into()), cursor: Some("cursor.json".into()), input: Some("input.json".into()), ..Names::default() }, })?; let mut mic = recording.external_audio().unwrap(); // ExternalAudioSink mic.offer(&pcm_16k_mono, HostTime::from_nanos(core_audio_ns)); // never blocks mic.gap(from, through); // the host lost audio input.send(HostTime::now(), event); // never blocks let finishing = recording.stop(); // returns at once // ... frame_rx already holds the last frame of each source let finished = finishing.wait()?; // or poll with finishing.try_wait() ``` -------------------------------- ### Configure Hex Flake Input to Follow System nixpkgs Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Add this to your NixOS configuration to make Hex's nixpkgs follow your system's, ensuring both use the same glibc to avoid Vulkan adapter issues. ```nix { inputs.hex = { url = "github:anomalyco/hex"; # Use the name of your own nixpkgs input here. inputs.nixpkgs.follows = "nixpkgs"; }; } ``` -------------------------------- ### Low-Level TypeScript Host Flow Source: https://github.com/anomalyco/hex/blob/dev/docs/specs/local-transcription-service.md Explicit preparation before transcription. 'transcribe()' never downloads a model; returns 'model-not-ready' if not prepared. May reload an installed but cold model. ```typescript await client.models.prepare("parakeet_unified_en", { onProgress }); // The host records, meters, and encodes the clip. const result = await client.transcribe({ audio: { data: wav, contentType: "audio/wav" }, model: "parakeet_unified_en", signal, }); input.insert(result.transcript); ``` -------------------------------- ### Declarative settings for programs.hex Source: https://github.com/anomalyco/hex/blob/dev/docs/nix.md Configure Hex declaratively with shortcut, model, language, and settings. The settings option takes dotted keys from 'hex settings list' with JSON values. ```nix { programs.hex = { enable = true; shortcut = "control+option+space"; # dictation_hotkey model = "parakeet_v3"; language = "de"; installModel = true; settings = { shortcut_mode = "toggle"; sound_effect_volume = 0.4; paste_with_shift = true; "meetings.enabled" = true; }; }; } ``` -------------------------------- ### Initialize Hex commands config with hex commands init Source: https://github.com/anomalyco/hex/blob/dev/docs/plans/personal-commands.md Run `hex commands init` to create the configuration folder. The command creates `~/.config/hex/` with `hex.config.ts` (only when no config exists), `hex.d.ts` (rewritten by Hex when it changes), `AGENTS.md` (rewritten by Hex), and `tsconfig.json` (only when missing). Nothing is installed. ```sh hex commands init ``` -------------------------------- ### Run display-free single-instance service test Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Display-free, device-free single-instance check for the Hex service. Commands fail fast without Hex, second launches forward and exit 0, and it verifies socket permissions, version-1 client errors, invalid/oversized/stalled frames, crash recovery, racing launches, and custom data directory behavior. ```bash python3 scripts/test-linux-service.py /path/to/hex ``` -------------------------------- ### GET /streams/{id}/events Source: https://github.com/anomalyco/hex/blob/dev/docs/streams.md Subscribes to server-sent events for the stream. Each subscriber receives all segments from the start, then live events, then the end, and the response closes. ```APIDOC ## GET /streams/{id}/events ### Description Subscribes to server-sent events for the stream. Each subscriber receives all segments from the start, then live events, then the end, and the response closes. ### Method GET ### Endpoint /streams/{id}/events ### Parameters #### Path Parameters - **id** (integer) - Required - Stream ID. ### Response #### Success Response (200) Server-sent events, one JSON object per `data:` line, with `: keep-alive` comments every 15 s. #### Event Types - **ready** - Sent first: the stream's model and format. - **partial** - The window being transcribed. `stable` is committed text; `tentative` may change. Only when `partials` is true. - **segment** - A finished window's final text. - **final** - Every segment joined; the stream has ended. - **error** - `{"code","message"}`; the stream has ended. - **cancelled** - The stream was cancelled. #### Response Example ```text data: {"type":"ready","id":3,"model":"parakeet_v3","language":"auto","sampleFormat":"f32le","partials":true} data: {"type":"partial","segment":0,"stable":"so the plan for","tentative":" today"} data: {"type":"segment","segment":0,"startMs":0,"endMs":7420,"text":"So the plan for today is the release."} data: {"type":"final","text":"So the plan for today is the release. …","segments":[…],"durationMs":31250} ``` ``` -------------------------------- ### Hex App Launch and Runtime Flow Diagram Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md Shows the behavior of the `hex app` command on Windows, including handling of an already-held named event, the runtime and main threads, tray actions, and update/quit behavior. ```text hex app ├── named event already held -> signal it (the running app shows its window) -> exit └── becomes the app // windows::rune::open ├── the local API's POST /control -> control::host::answer ├── runtime thread: WindowsDesktopHost (listener, model preparation, OpenCode, transformations, updater), publishes every 250 ms ├── main thread: rune::App's winit loop and the window; rune::Tray runs on its own thread ├── --hidden -> windowless start; close -> hide (keep_running) ├── tray Show or a relaunch -> AppHandle::open (shows and focuses) └── tray Quit / Ctrl-C / restart into an update -> AppHandle::quit -> runtime stops the listener ``` -------------------------------- ### Site deploy pipeline steps Source: https://github.com/anomalyco/hex/blob/dev/docs/releasing.md Outlines the build, deploy, and verify steps for the Hex site, split by mode. The deploy step treats the artifact as untrusted and only deploys the Build Output files if the Worker config matches the expected mode. ```text Site deploy (mode dev | production) ├─ build bun install + site/scripts/build.ts --mode , no environment or secret; [build] │ uploads site/.cloudflare/output (Build Output) with its SHA256SUMS digest ├─ deploy sparse checkout of .github/release/; npm ci the pinned cf CLI; verify the [release] │ artifact's digest; deploy-site.sh └─ verify the live site answers 200 and bun run check:downloads, no secret [build] ``` -------------------------------- ### meetings record Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Starts a CLI-started meeting, which is the same recording the menu bar starts. Replies once the recording has started (or after 8 s). ```APIDOC ## [CLI] meetings record ### Description Starts a CLI-started meeting, which is the same recording the menu bar starts. The menu-bar state, the recording capsule, and Stop & Transcribe all apply to it. Replies once the recording has started (or after 8 s). ``` -------------------------------- ### hex onboarding reset Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Replays the first run now; every OS. ```APIDOC ## hex onboarding reset ### Description Replays the first run now; every OS. ### Command `hex onboarding reset` (alias: `hex restart`) ``` -------------------------------- ### Run headless scene listing and snapshot commands Source: https://github.com/anomalyco/hex/blob/dev/docs/plans/rune-ui.md Run these commands headlessly on any OS to list available scenes or capture a golden snapshot. The `--snap` command writes a PNG to the specified path; `--scene` selects the surface and `--theme` sets light or dark. `cargo test rune_ui` runs the UI tests. ```sh cargo run -- app -- --list-scenes cargo run -- app -- --snap /tmp/hex-modes.png --scene modes --theme light cargo test rune_ui ``` -------------------------------- ### Create ready transcriber and transcribe audio Source: https://github.com/anomalyco/hex/blob/dev/docs/plans/typescript-sdk.md Creates a ready transcriber with an explicit command and model, then transcribes a PCM WAV buffer. The host captures and encodes audio; the helper does not capture or paste. Cancellation via signal closes the helper, and cleanup failures remain visible. ```TypeScript import { create } from "@kitlangton/hex" const transcriber = await create({ command: ["/path/to/hex-service", "service", "--embedded"], model: "parakeet_unified_en", language: "en", onProgress: renderModelProgress, }) try { // Host captures and encodes PCM WAV. No capture or paste occurs in the helper. const result = await transcriber.transcribe(wav, { signal }) insertIntoHostInput(result.transcript) } finally { await transcriber.close() } ``` -------------------------------- ### Headless renders of named fixture scenes Source: https://github.com/anomalyco/hex/blob/dev/docs/design-system.md Commands to render fixture scenes headlessly. Use --list-scenes to see available scenes, --snap to capture a specific scene, and --theme to switch themes. The OUT variable and scripts/snap-set.sh capture multiple scenes into one folder. ```sh cargo run -- app -- --list-scenes ``` ```sh cargo run -- app -- --snap /tmp/hex-modes.png --scene modes ``` ```sh cargo run -- app -- --snap /tmp/hex-modes-light.png --scene modes --theme light ``` ```sh cargo run -- app -- --snap /tmp/hex-mac-settings.png --scene mac-settings ``` ```sh OUT=/tmp/hex-snaps scripts/snap-set.sh modes mac-settings ``` -------------------------------- ### Install matching skill for Hex 2.3.1 Source: https://github.com/anomalyco/hex/blob/dev/skills/hex-personal-commands/SKILL.md Use this command to install the hex-personal-commands skill for Hex 2.3.1, which uses an older runtime. ```bash npx skills add anomalyco/hex#app-v2.3.1 --skill hex-personal-commands ``` -------------------------------- ### Install Hex personal commands skill Source: https://github.com/anomalyco/hex/blob/dev/README.md Installs the official Hex skill for teaching coding agents to configure personal transformations. Targets current Hex dev builds and the next stable release; on Hex 2.3.1 use the versioned command shown in the second block. ```sh npx skills add anomalyco/hex --skill hex-personal-commands ``` ```sh npx skills add anomalyco/hex#app-v2.3.1 --skill hex-personal-commands ``` -------------------------------- ### Run autocrop serve Source: https://github.com/anomalyco/hex/blob/dev/crates/capture/src/autocrop-playground.html Run the command to serve the autocrop playground for live tuning, showing the last crop. ```bash scrawl autocrop --serve ``` -------------------------------- ### Run command-line listener with settings from app Source: https://github.com/anomalyco/hex/blob/dev/docs/windows.md The command-line listener uses the settings saved by the app. Specify the model and language. ```powershell cargo run -- listen --model parakeet_v3 --language pl ``` -------------------------------- ### Run Wayland paste validation script Source: https://github.com/anomalyco/hex/blob/dev/docs/linux.md Runs real paste helpers against a GTK target under an isolated headless Sway compositor. Requires GTK development libraries, Sway, wl-clipboard, wtype, dbus-run-session, and a Vulkan driver (Mesa's software driver is sufficient). Must run as a non-root user. ```bash scripts/test-wayland-paste.sh /path/to/compiled-test-executable /path/to/hex ``` -------------------------------- ### model-cancel Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Cancels a model installation or download. ```APIDOC ## model-cancel ### Description Cancels a model installation or download. ### Method model-cancel ### Endpoint model-cancel ### Request Example ```json {"version": 4, "command": "model-cancel"} ``` ### Response #### Success Response (done) - **version** (number) - Protocol version. - **status** (string) - Always "done". - **message** (string) - Human-readable message. - **changed** (boolean) - Whether the command changed state. #### Response Example ```json {"version": 4, "status": "done", "message": "Model download cancelled", "changed": true} ``` ``` -------------------------------- ### POST /models/{id}/prepare Source: https://github.com/anomalyco/hex/blob/dev/docs/specs/local-transcription-service.md Prepares a model for transcription. Returns SSE progress updates, then a final ok or error response. ```APIDOC ## [POST] /models/{id}/prepare ### Description Prepares a model for transcription. Returns SSE progress updates, then a final ok or error response. ### Method POST ### Endpoint /models/{id}/prepare ### Parameters #### Path Parameters - **id** (string) - Required - Model identifier #### Query Parameters - **language** (string) - Optional - Language for preparation, defaults to "en" ### Response #### Success Response (200) - **type** (string) - "ok" or "error" - **message** (string) - Optional error message #### Response Example { "type": "ok" } ``` -------------------------------- ### meeting-record Source: https://github.com/anomalyco/hex/blob/dev/docs/cli.md Starts a meeting recording with an optional title. ```APIDOC ## meeting-record ### Description Starts a meeting recording with an optional title. ### Method meeting-record ### Endpoint meeting-record ### Parameters #### Query Parameters - **title** (string) - Optional - Title of the meeting. ### Request Example ```json {"version": 4, "command": "meeting-record", "title": "Design sync"} ``` ### Response #### Success Response (done) - **version** (number) - Protocol version. - **status** (string) - Always "done". - **message** (string) - Human-readable message. - **changed** (boolean) - Whether the command changed state. #### Response Example ```json {"version": 4, "status": "done", "message": "Recording “Design sync”; …", "changed": true} ``` ``` -------------------------------- ### hex start Source: https://github.com/anomalyco/hex/blob/dev/docs/features/control-cli.md Starts the Hex application if it is not already running. If already running, does nothing. On Linux and Windows, launches a detached `hex app --hidden` process and waits up to 20 seconds. The caller's HEX_* environment variables are passed via `--env` and are never logged. ```APIDOC ## [POST] /control ### Description Starts the Hex application if it is not already running. If already running, does nothing. On Linux and Windows, launches a detached `hex app --hidden` process and waits up to 20 seconds. The caller's HEX_* environment variables are passed via `--env` and are never logged. ### Method POST ### Endpoint /control ### Request Body - **action** (string) - Required - The action to perform, set to "start". ### Response #### Success Response (200) - **status** (string) - "started" or "already-running". #### Response Example { "status": "started" } ```