Script reference¶
This is the index of every supported, operator-facing command in EntraBot: the scripts you run directly from a terminal to set up, operate, provision, authenticate, store, diagnose, or tear down an Agent Identity. Each command links to its own reference page with full usage, effects, and exit-behavior detail.
This index intentionally excludes internal migration helpers (for example, one-time state-format converters) and one-off research or spike scripts used to validate an approach before it became a supported command. If a script isn't listed here, it isn't part of the supported operator surface.
Operations¶
| Command | Platforms | Purpose |
|---|---|---|
status.sh |
macOS/Linux | Shell entry point that bootstraps the local Python venv if needed and delegates to show_agent_status.py for the consolidated Agent Identity status check. |
status-windows.ps1 |
Windows | Windows status wrapper — runs show_agent_status.py through the project's Python environment (supports -Json, -HealthOnly, -Strict). Read-only; installs nothing. Runs on Windows PowerShell 5.1. |
show_agent_status.py |
macOS/Linux/Windows | Shows consolidated Agent Identity status and health from local state and live Graph queries (Blueprint, Agent Identity, Agent User, Sponsors, Permissions, Certificates, Licenses, Storage), plus a local check that this computer's certificate is in its store with its key and in date. Supports --json and --health-only. |
health_check.py |
macOS/Linux/Windows | Compatibility wrapper that forwards to show_agent_status.py with --health-only for callers that still invoke the old health_check.py entry point. |
catch_up.py |
macOS/Linux/Windows | Pulls recent messages from all watched chats and the inbox, authenticated as the Agent User via the three-hop token, to see what arrived while the MCP server was not polling. |
dm.py |
macOS/Linux/Windows | Sends a one-off Teams message to a chat (by chat_id or a locally defined alias) using the Agent User's three-hop token, outside of an MCP session. |
read_email.py |
macOS/Linux/Windows | Fetches and prints the Agent User's most recent mailbox messages matching a subject substring, for a one-off check outside the MCP session. |
show_permissions.py |
macOS/Linux/Windows | Shows the delegated permission grants (oauth2PermissionGrants) scoped to the Agent Identity's service principal and Agent User. Supports --json. |
Setup¶
| Command | Platforms | Purpose |
|---|---|---|
setup.sh |
macOS/Linux | Setup for macOS and Linux. A bootstrap that needs only Python 3.12+ — builds the venv (the provisioning extra, reinstalled only when pyproject.toml changes), then starts the same setup wizard as Windows (python -m entrabot.winsetup), which signs in (offering a private Azure CLI when there is none), creates or joins the agent, keeps the agent's certificate and key as one Keychain or keyring item, registers it, writes .env, registers the MCP server, tests sign-in, walks the person through a missing licence, and switches on Word, Excel and OneDrive files if asked (no Agent 365 CLI). Interactive by default; --yes plus flags for unattended runs; --diagnose is read-only; --rotate-cert replaces this computer's certificate. Every older flag still works. |
setup-windows.ps1 |
Windows | Windows setup. A bootstrap that needs nothing installed first (Windows PowerShell 5.1, no admin rights) — finds or downloads Python, builds the venv, then starts the setup wizard (python -m entrabot.winsetup), which signs in, creates or joins the agent, creates and registers a non-exportable certificate (TPM first), writes .env, registers the MCP server, tests sign-in, then walks the person through getting the agent a licence when it has none and switches on Word, Excel and OneDrive files if asked (with no Agent 365 CLI, over SSH and unattended too). Interactive by default; -Yes plus parameters for unattended runs; -Diagnose is read-only. |
setup-windows.cmd |
Windows | The Windows setup entry point, and the file to double-click. Starts setup-windows.ps1 with the in-box Windows PowerShell and the execution policy lifted for that run, forwards every argument, and explains what to ask IT for when Group Policy blocks scripts. |
start-entrabot.cmd |
Windows | Starts the agent on Windows, and the file to double-click after setup. Finds Claude Code (on PATH or where its installer puts it), points it at a per-user Git Bash when needed, says what Claude Code asks the first time, and runs claude --dangerously-load-development-channels server:entrabot in the project folder. |
start-entrabot.sh |
macOS/Linux | Starts the agent on macOS and Linux after setup. Checks that setup has been run in the folder, finds Claude Code (on PATH or where its installer puts it), says what Claude Code asks the first time, and runs claude --dangerously-load-development-channels server:entrabot in the project folder, passing any extra arguments on. Setup's last screen names it and, at a terminal, offers to run it. |
prereqs-macos.sh |
macOS | Optional macOS helper — installs the Xcode Command Line Tools (via xcode-select --install) and, through Homebrew, Python 3.12+, git and the Azure CLI. setup.sh itself needs only Python. --with-a365-cli also installs the .NET SDK, Microsoft's a365 CLI and PowerShell 7, which setup does not need. Safe to re-run. |
prereqs-windows.ps1 |
Windows | Optional Windows extras, installed only on request — -WithGit and -WithClaudeCode (per-user, no admin rights or winget), -WithWorkIq (Microsoft's a365 CLI for using it yourself, which setup does not need, with the .NET SDK it runs on when the PC has none, per-user under %LOCALAPPDATA%\entrabot\tools with no admin rights and not on PATH; PowerShell 7 with winget), -WithBuildTools (VS Build Tools). Not a required step before setup. Runs from Windows PowerShell 5.1 and is safe to re-run. |
setup_delegated.sh |
macOS/Linux | Signs in interactively with MSAL (browser localhost redirect) using ENTRABOT_CLIENT_ID and persists the MSAL cache through OS-encrypted persistence (Keychain on macOS / Secret Service on Linux when available) so the MCP server picks it up silently — for delegated mode instead of the full Agent User chain. |
setup_ado_credentials.sh |
macOS | Prompts for an Azure DevOps PAT and stores it via git credential approve, which hands it to whichever credential.helper is configured — the macOS Keychain only receives it if that helper is osxkeychain — so git push/pull to dev.azure.com authenticates without further prompts. |
deploy-windows.ps1 |
Windows | Windows Blueprint certificate rotation — adds a new certificate beside the current one, proves it with a real sign-in, switches .env, then removes the old one from the Blueprint and deletes it locally with its key. The current certificate stays in use until the new one works. Exit 0 rotated, 1 failed, 3 rotated with cleanup pending. A -Status flag instead delegates to status-windows.ps1. |
Teardown¶
| Command | Platforms | Purpose |
|---|---|---|
teardown.sh |
macOS/Linux | Disconnects this computer from its agent by default, the same teardown as Windows — takes this computer's certificate off the Blueprint and deletes it with its key from the Keychain or keyring, removes the entrabot MCP entries, backs up then removes .env and the state file, and retires the setup certificate; --delete-agent and --purge-data widen it. The older tenant-wide teardown (the whole chain, the Provisioner app recorded for this machine, local state) runs only with --tenant-wide or its own flags (--agent-user-upn, --dry-run, --preserve-provisioner, --preserve-local-state). |
teardown-windows.ps1 |
Windows | Disconnects this Windows PC from an agent — removes this PC's certificate from the Blueprint and deletes it locally with its key, removes the entrabot MCP entries, and backs up then removes .env and the state file. The agent and the data folder are kept unless -DeleteAgent or -PurgeData is given. |
deprovision_entra_agent_identity.py |
macOS/Linux/Windows | Targeted teardown of one or more Agent User chains, identified by repeated --agent-user-upn flags — removes licenses, then deletes the Agent User, its Agent Identity, and the parent Blueprint, but refuses to delete a Blueprint still shared by other Agent Identities. Leaves local state and blob storage untouched. |
cleanup-orphans.sh |
macOS/Linux | Deletes orphaned Blueprint / Agent Identity resources by object ID using a Provisioner cert-auth Graph token, for cleanup after a teardown that failed because az CLI tokens are rejected by the Agent Identity APIs. |
Provisioning¶
| Command | Platforms | Purpose |
|---|---|---|
create_entra_agent_ids.py |
macOS/Linux/Windows | Creates the Blueprint, BlueprintPrincipal, Agent Identity, and Agent User in Entra (via the Provisioner cert token, never az CLI tokens) and persists the resulting IDs to .entrabot-state.json; idempotent on re-run. --licence-report and --assign-licence handle the Agent User's licence on its own. |
add_agent_sponsor.py |
macOS/Linux/Windows | Resolves an email/UPN to a user and adds them as a sponsor on the configured Agent Identity — the fix for SponsorGate rejecting inbound messages when the operator is not in the sponsor list. |
remove_agent_sponsor.py |
macOS/Linux/Windows | Inverse of add_agent_sponsor.py — resolves an email/UPN and removes that user from the Agent Identity's sponsor list, then prints the remaining sponsors. |
assign_agent_user_licenses.py |
macOS/Linux/Windows | Standalone Agent User license management — auto-selects the first available Teams/Copilot SKU candidate in Graph's returned order, or assigns a specific --sku, and can --list-available SKUs. |
remove_agent_user_licenses.py |
macOS/Linux/Windows | Removes directly-assigned licenses from the Agent User (--all or a specific --sku-id). --all excludes group-inherited licenses from the removal set, but an explicit --sku-id is sent to Graph even if that SKU is group-inherited. |
ensure_a365_work_iq_permissions.py |
macOS/Linux/Windows | Gives the agent's Blueprint what Microsoft Agent 365 Work IQ (Word, Excel and OneDrive files) needs, using the Provisioner token — the first-party resource service principals, the Blueprint-wide OAuth grants, and least-privilege inheritable permissions, each confirmed by reading it back. The setup wizard runs it instead of the Agent 365 CLI on Windows, macOS and Linux. |
ensure_a365_observability_permissions.py |
macOS/Linux/Windows | Gives the agent the delegated Agent365.Observability.OtelWrite permission for Agent 365 telemetry, using the Provisioner token. Setup runs it for Agent 365 integration. |
register_agent_instance.py |
macOS/Linux/Windows | Registers the agent in the Agent 365 registry, or updates the recorded registration; --check reads it, --delete deletes it. Setup runs it for Agent 365 integration. Dry run by default; --apply needs AgentRegistration.ReadWrite.All on the Provisioner app. |
Auth and certs¶
| Command | Platforms | Purpose |
|---|---|---|
grant_consent.py |
macOS/Linux/Windows | Creates or updates the oauth2PermissionGrant that lets the Agent Identity acquire delegated tokens with the specified --scopes (against Graph or another --resource-app-id) as the Agent User. The generalised CLI form of the consent logic in create_entra_agent_ids.py. |
grant_files_consent.py |
macOS/Linux/Windows | Ensures the Agent User's oauth2PermissionGrant carries the full default Agent User Graph scope set (Chat, User, Files, Sites, Mail — not only Files/Sites) by calling grant_agent_user_consent from create_entra_agent_ids.py, idempotently adding only the missing scopes via POST (new grant) or PATCH (existing grant); use when a Files MCP tool call raises MissingPermissionError. |
revoke_consent.py |
macOS/Linux/Windows | Revokes specific --scopes from, or --all of (deleting), the oauth2PermissionGrant that lets the Agent Identity act as the Agent User, on Microsoft Graph or another --resource-app-id. Inverse of grant_consent.py. |
provisioner-token.py |
macOS/Linux/Windows | Prints a Graph API access token minted with the Provisioner app's certificate (private key read in memory only from the OS keystore on macOS/Linux; signed in place by a non-exportable certificate-store key on Windows) for manual Graph calls during debugging. Token on stdout, errors on stderr. |
find_local_blueprint_cert.py |
macOS/Linux | For a macOS or Linux computer set up before the setup wizard — recovers the registered Blueprint cert thumbprint (SHA-256 b64url) matching the account's older single OS-keystore private key (entrabot / blueprint-private-key) for a given Blueprint object ID. Setup no longer runs it. Exits 1 without asking Graph while a pending key from an unfinished older run exists. Exit 0 found, 1 checked and no match (or a pending key), 2 usage error, 3 could not check. |
list_blueprint_certs.py |
macOS/Linux | Prints the count of certificates registered on a Blueprint app (stdout) plus one human-readable detail line per cert (stderr). If the list can't be read, it exits non-zero and prints no count. |
verify_blueprint_cert.py |
macOS/Linux/Windows | Checks whether a given thumbprint is still present on a Blueprint app's keyCredentials. The setup wizard uses it on every system to decide whether to reuse a certificate. Exit 0 present, 1 checked and not present, 2 usage error, 3 could not check. |
register_blueprint_cert.py |
macOS/Linux | The older macOS and Linux registration — generates a Blueprint certificate and registers it, keeping the private key in the account's single keystore item (under a pending entry until the certificate is confirmed on the Blueprint). Setup no longer runs it. Adds to the existing certificates by default; --remove-all-existing-certs replaces them all (it does not delete the Blueprint). Exit 0 registered, 1 nothing changed, 2 usage error, 3 outcome not confirmed. |
blueprint_certs.py |
macOS/Linux/Windows | Shared library behind the Blueprint certificate scripts and the Windows rotation. Reads keyCredentials (a failed read is never an empty list), merges without de-duplicating, and confirms each write by reading it back. Not a CLI. |
register_windows_blueprint_cert.py |
macOS/Linux/Windows | Registers this machine's Blueprint certificate on the Blueprint (by store thumbprint with --sha1 — Cert:\CurrentUser\My on Windows, the Keychain or keyring item on macOS and Linux — or from a DER file with --der), adding to the existing certificates and keeping every other machine's, and confirms the write by reading it back; --remove-all-existing-certs replaces them all. Called by the setup wizard and by rotation on every system. Exit 0 registered, 1 nothing changed, 2 usage error, 3 outcome not confirmed. |
generate_windows_cert.py |
Windows | Creates a signing certificate with a non-exportable key in the Windows certificate store — TPM first (tried by creating a key and signing with it), software key store otherwise. Prints thumbprint=, ksp= and x5t_s256= lines on stdout; --export-der also writes the public DER. A command line over entrabot.platform.wincert; needs no PowerShell 7 or elevation. |
rotate_cert_windows.py |
Windows | Runs the same Windows Blueprint certificate rotation as deploy-windows.ps1 (python -m entrabot.winsetup rotate-cert) — the current certificate stays in use until the new one is proven. Also keeps the older rotate() library function for existing callers; the command does not use it. |
Storage¶
| Command | Platforms | Purpose |
|---|---|---|
provision_blob_storage.py |
macOS/Linux/Windows | Idempotently provisions the resource group, storage account (deterministically named per tenant), per-Agent-User container, and Storage Blob Data Contributor RBAC for cloud-hosted operational memory. Requires az login. |
deprovision_blob_storage.py |
macOS/Linux/Windows | Removes cloud-memory resources created by provision_blob_storage.py — by default only the container, with --delete-account and --delete-resource-group to escalate. Requires az login. |
Diagnostics¶
| Command | Platforms | Purpose |
|---|---|---|
entrabot-mcp-debug.sh |
macOS/Linux | Debug wrapper around entrabot-mcp that tees the server's stderr to a log file (while still passing it through to the parent) for post-crash inspection; carries a self-reference marker so efferent-copy peer discovery skips it and avoids a duplicate-server spawn. |
diagnose-chat.py |
macOS/Linux/Windows | Tests Teams chat creation directly against the Graph API, bypassing the MCP server and logging every detail, to diagnose chat connectivity and permission problems. |
diagnose_sponsor_emails.py |
macOS/Linux/Windows | Read-only diagnostic that probes why an Agent Identity's sponsor email fields come back null (SponsorGate allowlist gaps), running nine Graph projections and token checks across the FIC and Agent User tokens. |
list_agent_identities.py |
macOS/Linux/Windows | Lists the Agent Identity service principals belonging to a Blueprint (from local state or an explicit --blueprint-app-id) via the Graph beta API. |
list_sponsors.py |
macOS/Linux/Windows | Lists the sponsors assigned to the configured (or --agent-object-id specified) Agent Identity via the Graph beta API. Supports --json. |