status.sh¶
Purpose¶
Root-level status entry point for macOS and Linux. It exists so operators
never have to think about the local Python environment: it bootstraps a
.venv if one is missing, installs the dependencies the status check
needs, loads .env, and then delegates entirely to
scripts/show_agent_status.py, the canonical
Agent Identity status/health command.
Requirements¶
- macOS or Linux (Windows users run
status-windows.ps1instead). - A
bash-compatible shell (set -euo pipefail). - Python 3.12 or 3.13 available as
python3.12,python3.13, orpython3onPATH— only needed the first time, to create.venv. - Everything
show_agent_status.pyitself needs at runtime (a bootstrapped Provisioner app and its certificate in the OS keystore) —status.shdoes not check for these itself; it only prepares the Python environment.
Usage¶
Options¶
status.sh defines no options of its own. Every argument after the script
name is forwarded verbatim ("$@") to scripts/show_agent_status.py — see
show_agent_status.py for what --json,
--health-only, --strict, and --help do.
Effects¶
- If
.venv/bin/python3does not exist, searchespython3.12,python3.13, thenpython3for one whosesys.version_info >= (3, 12), printsCreating local Python environment at .venv...to stderr, and runs<python> -m venv .venv. - Checks whether
import azure.identity, entrabotsucceeds in the venv; if not, printsInstalling EntraBot status dependencies into .venv...to stderr and runspip install -e ".[provisioning]". - If a
.envfile exists at the project root, sources it (set -a/. .env/set +a) so every variable it defines is exported into the process environment. execs the venv'spython3runningscripts/show_agent_status.py "$@"— this replaces the shell process, sostatus.sh's own exit code becomes whatevershow_agent_status.pyreturns.
No Graph calls or local-state writes happen in status.sh itself; all of
that lives in show_agent_status.py.
Exit behavior¶
- Exits
1withERROR: Python 3.12+ is required to run EntraBot status.on stderr if no suitable interpreter is found to create.venv. - Otherwise, because of the final
exec, the process exits with whatever codescripts/show_agent_status.pyreturns (0on success,1when--strict/--health-onlychecks fail or the status script can't acquire a token).status.shhas no other exit paths of its own beyondset -euo pipefailaborting on the first failing command.
Common failures¶
- No Python 3.12+ found — install Python 3.12 or newer (see the platform prerequisites scripts) and re-run.
- First run is slow — expected; it's creating
.venvand installing.[provisioning]extras. Subsequent runs skip both steps. - Status check itself fails (Provisioner not bootstrapped, missing
Agent Identity state, expired cert) — see
show_agent_status.py→ Common failures.
Related commands¶
status-windows.ps1— Windows equivalent.show_agent_status.py— the command this wrapper delegates to.health_check.py— health-only compatibility wrapper around the same command../scripts/setup.sh --statusforwards its remaining arguments to this script; seesetup.sh.- Operations scripts index