#!/usr/bin/env python3 """Usage: tools/codex-runner [--config config/codex-runner.toml] Reviews the ready PRs of the configured repositories with the Codex CLI, after werkrevisor, and exits. A repository takes part only if the [codex] mode of its .werkrevisor.toml on the default branch is "advise" or "gate". Runs on the workstation that holds the login of the Codex CLI; tools/systemd/ starts it 1 minute after its last run. Reads the Gitea token from the variable that the config names, e.g. GITEA_BOT_TOKEN; it never prints a token. """ import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from werkrevisor.codexrunner import main # noqa: E402 if __name__ == "__main__": if any(a in ("-h", "--help") for a in sys.argv[1:]): print(__doc__.strip()) sys.exit(0) sys.exit(main(sys.argv[1:]))