| 38 | |
| 39 | |
| 40 | def main_cli(argv: list[str] | None = None): |
| 41 | parser = argparse.ArgumentParser(description="CodeClash") |
| 42 | parser.add_argument( |
| 43 | "config_path", |
| 44 | type=Path, |
| 45 | help="Path to the config file.", |
| 46 | ) |
| 47 | parser.add_argument( |
| 48 | "-c", |
| 49 | "--cleanup", |
| 50 | action="store_true", |
| 51 | help="If set, do not clean up the game environment after running.", |
| 52 | ) |
| 53 | parser.add_argument( |
| 54 | "-o", |
| 55 | "--output-dir", |
| 56 | type=Path, |
| 57 | help="Sets the output directory (default is 'logs' with current user subdirectory).", |
| 58 | ) |
| 59 | parser.add_argument( |
| 60 | "-s", |
| 61 | "--suffix", |
| 62 | type=str, |
| 63 | help="Suffix to attach to the folder name. Does not include leading dot or underscore.", |
| 64 | default="", |
| 65 | ) |
| 66 | parser.add_argument( |
| 67 | "-k", |
| 68 | "--keep-containers", |
| 69 | action="store_true", |
| 70 | help="Do not remove containers after games/agent finish", |
| 71 | ) |
| 72 | args = parser.parse_args(argv) |
| 73 | main(**vars(args)) |
| 74 | |
| 75 | |
| 76 | if __name__ == "__main__": |