#!/bin/sh
#
# /usr/bin/fleetctl — MarlinOS fleet CLI wrapper (Linux).
#
# fleet-cli is stdlib-only Python, so no venv bootstrap is required
# on Linux — we just point python at the installed source tree and
# run the module.  FreeBSD uses a different wrapper that mirrors the
# uv-venv pattern used by the rest of the MarlinOS stack.
#
# Uses Python 3.14t (free-threaded, GIL-disabled) from the
# marlinos-python314t package installed at /opt/python314t/.

set -eu

FLEET_SRC="/usr/share/fleet-cli"
PYTHON_BIN="/opt/python314t/bin/python3.14t"

exec "${PYTHON_BIN}" -c "import sys; sys.path.insert(0, '${FLEET_SRC}'); from fleet_cli.cli import main; sys.exit(main())" "$@"
