Process and executable utilities for Apero.
Provides helpers for checking command availability, finding executables, inspecting running processes, sending signals, and viewing process logs.
Summary
Functions
Filters a list of commands to only those available on the system.
Returns true if the given command exists in the system PATH.
Lists processes using a specific file or port (fuser wrapper).
Sends a signal to a process by PID.
Returns a map of command => path for all found commands.
Shows recent logs for a process via journalctl (Linux systemd) or log (macOS).
Lists files opened by a process (lsof wrapper). Linux/macOS only.
Returns the OS process ID of the BEAM VM.
Lists running processes (cross-platform via ps).
Returns the number of scheduler threads.
Returns the VM memory usage in bytes.
Returns the VM uptime in milliseconds.
Returns the full path of a command if found, or nil.
Functions
Filters a list of commands to only those available on the system.
Returns true if the given command exists in the system PATH.
@spec fuser(String.t()) :: {:ok, [non_neg_integer()]} | {:error, term()}
Lists processes using a specific file or port (fuser wrapper).
@spec kill(non_neg_integer(), atom()) :: :ok | {:error, term()}
Sends a signal to a process by PID.
Returns a map of command => path for all found commands.
Shows recent logs for a process via journalctl (Linux systemd) or log (macOS).
@spec lsof(non_neg_integer()) :: {:ok, [String.t()]} | {:error, term()}
Lists files opened by a process (lsof wrapper). Linux/macOS only.
@spec os_pid() :: non_neg_integer()
Returns the OS process ID of the BEAM VM.
Lists running processes (cross-platform via ps).
@spec scheduler_count() :: non_neg_integer()
Returns the number of scheduler threads.
@spec vm_memory() :: non_neg_integer()
Returns the VM memory usage in bytes.
@spec vm_uptime() :: non_neg_integer()
Returns the VM uptime in milliseconds.
Returns the full path of a command if found, or nil.