Jido.Browser.Installer (Jido Browser v2.1.0)

Copy Markdown View Source

Binary installer for Jido.Browser adapters.

This module handles downloading and installing the browser automation binaries (vibium, web) for all supported platforms. It follows the same patterns as Phoenix's Tailwind installer for a familiar experience.

Supported Platforms

  • macOS (Apple Silicon and Intel)
  • Linux (x86_64 and ARM64)
  • Windows (x86_64)

Usage

Typically you won't call this module directly. Instead use:

mix jido_browser.install

Or configure automatic installation in your mix.exs:

defp aliases do
  [
    setup: ["deps.get", "jido_browser.install --if-missing", ...]
  ]
end

Summary

Functions

Returns the path to the binary if installed, or nil.

Returns the configured version for a binary.

Returns the default installation path for binaries.

Ensures the binary is installed. Returns :ok if already installed, or attempts to install if missing.

Installs the specified binary.

Returns whether a given binary is installed and available.

Returns the detected platform for the current system.

Types

platform()

@type platform() ::
  :darwin_arm64 | :darwin_amd64 | :linux_amd64 | :linux_arm64 | :windows_amd64

Functions

bin_path(binary)

@spec bin_path(atom()) :: String.t() | nil

Returns the path to the binary if installed, or nil.

configured_version(atom)

@spec configured_version(atom()) :: String.t()

Returns the configured version for a binary.

default_install_path()

@spec default_install_path() :: String.t()

Returns the default installation path for binaries.

Binaries are installed into _build/jido_browser-TARGET where TARGET is the platform identifier (e.g., darwin_arm64). This follows the same pattern as Phoenix's Tailwind installer.

ensure_installed(opts \\ [])

@spec ensure_installed(keyword()) :: :ok | {:error, term()}

Ensures the binary is installed. Returns :ok if already installed, or attempts to install if missing.

Options

  • :adapter - The adapter to check/install (:vibium or :web)
  • :force - Force reinstallation even if already installed

install(binary, opts \\ [])

@spec install(
  atom(),
  keyword()
) :: :ok | {:error, term()}

Installs the specified binary.

installed?(binary)

@spec installed?(atom()) :: boolean()

Returns whether a given binary is installed and available.

target()

@spec target() :: platform()

Returns the detected platform for the current system.