37 lines
942 B
Python
37 lines
942 B
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
import logging
|
|
|
|
from .config import Settings
|
|
from .worker import AutomationWorker
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description="LAI controlled coding-agent automation")
|
|
parser.add_argument("command", choices=["once", "worker", "check"])
|
|
args = parser.parse_args()
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s %(levelname)s %(name)s %(message)s",
|
|
)
|
|
settings = Settings.from_env()
|
|
|
|
if args.command == "check":
|
|
print(f"mode={settings.mode}")
|
|
print(f"source={settings.source_repository}")
|
|
print(f"model={settings.agent_model}")
|
|
print(f"direct_main_enabled={settings.allow_direct_main}")
|
|
return
|
|
|
|
worker = AutomationWorker(settings)
|
|
if args.command == "once":
|
|
worker.run_once()
|
|
else:
|
|
worker.run_forever()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|