LGUG2Z/komorebi · error

could not find autohotkey, please make sure it is installed

Error message

could not find autohotkey, please make sure it is installed before using the --ahk flag

What it means

Thrown during komorebic's pre-flight checks when --ahk was passed but the AutoHotkey executable (defaulting to autohotkey.exe, overridable via KOMOREBI_AHK_EXE) cannot be found via `which`. Generic guard: the missing input is either autohotkey.exe on PATH or the binary named by KOMOREBI_AHK_EXE; komorebic refuses to start a companion it cannot locate.

Source

Thrown at komorebic/src/main.rs:2386

                && which(&komorebi_ahk_exe).is_ok()
            {
                ahk = komorebi_ahk_exe;
            }

            if args.whkd && which("whkd").is_err() {
                bail!(
                    "could not find whkd, please make sure it is installed before using the --whkd flag"
                );
            }

            if args.masir && which("masir").is_err() {
                bail!(
                    "could not find masir, please make sure it is installed before using the --masir flag"
                );
            }

            if args.ahk && which(&ahk).is_err() {
                bail!(
                    "could not find autohotkey, please make sure it is installed before using the --ahk flag"
                );
            }

            let mut buf: PathBuf;

            // The komorebi.ps1 shim will only exist in the Path if installed by Scoop
            let exec =
                if let Ok(output) = Command::new("where.exe").arg("komorebi.ps1").output() {
                    let stdout = String::from_utf8(output.stdout)?;
                    match stdout.trim() {
                        "" => None,
                        // It's possible that a komorebi.ps1 config will be in %USERPROFILE% - ignore this
                        stdout if !stdout.contains("scoop") => None,
                        stdout => {
                            buf = PathBuf::from(stdout);
                            buf.pop(); // %USERPROFILE%\scoop\shims
                            buf.pop(); // %USERPROFILE%\scoop

View on GitHub (pinned to e0709f02bf)

Solutions

  1. Install AutoHotkey v1.x and ensure autohotkey.exe is on PATH
  2. If a custom binary is intended, set KOMOREBI_AHK_EXE to its full path and confirm the file exists
  3. Drop the --ahk flag if AutoHotkey integration is not required
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at komorebic/src/main.rs:2386 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of LGUG2Z/komorebi@e0709f02bf (2026-09-06). Data as JSON: /api/errors/ed0f3d442794f39f. Report an issue: GitHub.