jdx/mise · error

GitHub relay requires Linux or macOS

Error message

GitHub relay requires Linux or macOS

What it means

`mise ssh` scoped relay/remote execution (src/cli/ssh.rs:191) requires a POSIX platform. When a relay scope is supplied on a non-Unix build, the `#[cfg(not(unix))]` branch discards the scope and bails unconditionally — the remote-scoped SSH path simply does not exist off POSIX.

Source

Thrown at src/cli/ssh.rs:191

            .destination
            .ok_or_else(|| eyre::eyre!("an SSH destination is required"))?;
        if let Some(scope) = scope {
            #[cfg(unix)]
            {
                let mut host = crate::system::remote::ad_hoc_host(
                    &destination,
                    std::env::current_dir()?,
                    &[],
                )?;
                host.port = self.port;
                host.identity_file = self.identity_file;
                host.ssh_options = self.ssh_option;
                return crate::system::remote::ssh(&host, scope, &self.command).await;
            }
            #[cfg(not(unix))]
            {
                let _ = scope;
                bail!("GitHub relay requires Linux or macOS");
            }
        }
        let mut command = tokio::process::Command::new("ssh");
        command.kill_on_drop(true);
        if let Some(port) = self.port {
            command.args(["-p", &port.to_string()]);
        }
        if let Some(identity) = self.identity_file {
            command.arg("-i").arg(identity);
        }
        for option in self.ssh_option {
            command.args(["-o", &option]);
        }
        command.arg("--").arg(destination);
        if !self.command.is_empty() {
            command.arg(shell_words::join(&self.command));
        }
        crate::ui::ctrlc::exit_on_ctrl_c(false);

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Use Linux or macOS for scoped relay commands.
  2. Omit the scope on Windows and invoke plain ssh directly.
  3. Gate scope-dependent automation on OS detection before calling mise ssh.

Example fix

// before (Windows)
mise ssh host --scope dotfiles -- command

// after
echo "scoped relay requires Linux/macOS" && mise ssh host -- command
Defensive patterns

Strategy: validation

Validate before calling

if (process.platform === 'win32' && args.some(a => a.startsWith('--scope'))) {
  throw new Error('scoped relay requires Linux or macOS');
}

Prevention

When it happens

Trigger: Passing a relay scope argument to `mise ssh` on Windows (non-unix target), where the scoped remote implementation is compiled out.

Common situations: Shared team scripts using scoped `mise ssh` relay commands run by Windows contributors; Windows CI executing relay-scoped dotfiles bootstrap commands; documentation examples copied verbatim to PowerShell.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/f90f959afab83b59. Report an issue: GitHub.