|
| 1 | +## Commit0 |
| 2 | + |
| 3 | +Commit0 provides several commands to facilitate the process of cloning, building, testing, and evaluating repositories. Here's an overview of the available commands: |
| 4 | + |
| 5 | +### Setup |
| 6 | + |
| 7 | +Use `commit0 setup [OPTIONS] REPO_SPLIT` to clone a repository split. |
| 8 | +Available options include: |
| 9 | + |
| 10 | +| Argument | Type | Description | Default | |
| 11 | +|----------|------|-------------|---------| |
| 12 | +| `repo_split` | str | Split of repositories to clone | | |
| 13 | +| `--dataset-name` | str | Name of the Huggingface dataset | `wentingzhao/commit0_combined` | |
| 14 | +| `--dataset-split` | str | Split of the Huggingface dataset | `test` | |
| 15 | +| `--base-dir` | str | Base directory to clone repos to | `repos/` | |
| 16 | +| `--commit0-dot-file-path` | str | Storing path for stateful commit0 configs | `.commit0.yaml` | |
| 17 | + |
| 18 | +### Build |
| 19 | + |
| 20 | +Use `commit0 build [OPTIONS]` to build the Commit0 split chosen in the Setup stage. |
| 21 | +Available options include: |
| 22 | + |
| 23 | +| Argument | Type | Description | Default | |
| 24 | +|----------|------|-------------|---------| |
| 25 | +| `--num-workers` | int | Number of workers | `8` | |
| 26 | +| `--commit0-dot-file-path` | str | Path to the commit0 dot file | `.commit0.yaml` | |
| 27 | +| `--verbose` | int | Verbosity level (1 or 2) | `1` | |
| 28 | + |
| 29 | +### Get Tests |
| 30 | + |
| 31 | +Use `commit0 get-tests REPO_NAME` to get tests for a Commit0 repository. |
| 32 | + |
| 33 | +| Argument | Type | Description | Default | |
| 34 | +|----------|------|-------------|---------| |
| 35 | +| `repo_name` | str | Name of the repository to get tests for | | |
| 36 | + |
| 37 | +### Test |
| 38 | + |
| 39 | +Use `commit0 test [OPTIONS] REPO_OR_REPO_PATH [TEST_IDS]` to run tests on a Commit0 repository. |
| 40 | +Available options include: |
| 41 | + |
| 42 | +| Argument | Type | Description | Default | |
| 43 | +|----------|------|-------------|---------| |
| 44 | +| `repo_or_repo_path` | str | Directory of the repository to test | | |
| 45 | +| `test_ids` | str | Test IDs to run | | |
| 46 | +| `--branch` | str | Branch to test | | |
| 47 | +| `--backend` | str | Backend to use for testing | `modal` | |
| 48 | +| `--timeout` | int | Timeout for tests in seconds | `1800` | |
| 49 | +| `--num-cpus` | int | Number of CPUs to use | `1` | |
| 50 | +| `--reference` | bool | Test the reference commit | `False` | |
| 51 | +| `--coverage` | bool | Get coverage information | `False` | |
| 52 | +| `--rebuild` | bool | Rebuild an image | `False` | |
| 53 | +| `--commit0-dot-file-path` | str | Path to the commit0 dot file | `.commit0.yaml` | |
| 54 | +| `--verbose` | int | Verbosity level (1 or 2) | `1` | |
| 55 | +| `--stdin` | bool | Read test names from stdin | `False` | |
| 56 | + |
| 57 | +### Evaluate |
| 58 | + |
| 59 | +Use `commit0 evaluate [OPTIONS]` to evaluate the Commit0 split chosen in the Setup stage. |
| 60 | +Available options include: |
| 61 | + |
| 62 | +| Argument | Type | Description | Default | |
| 63 | +|----------|------|-------------|---------| |
| 64 | +| `--branch` | str | Branch to evaluate | | |
| 65 | +| `--backend` | str | Backend to use for evaluation | `modal` | |
| 66 | +| `--timeout` | int | Timeout for evaluation in seconds | `1800` | |
| 67 | +| `--num-cpus` | int | Number of CPUs to use | `1` | |
| 68 | +| `--num-workers` | int | Number of workers to use | `8` | |
| 69 | +| `--reference` | bool | Evaluate the reference commit | `False` | |
| 70 | +| `--coverage` | bool | Get coverage information | `False` | |
| 71 | +| `--commit0-dot-file-path` | str | Path to the commit0 dot file | `.commit0.yaml` | |
| 72 | +| `--rebuild` | bool | Rebuild images | `False` | |
| 73 | + |
| 74 | +### Lint |
| 75 | + |
| 76 | +Use `commit0 lint [OPTIONS] REPO_OR_REPO_DIR` to lint files in a repository. |
| 77 | +Available options include: |
| 78 | + |
| 79 | +| Argument | Type | Description | Default | |
| 80 | +|----------|------|-------------|---------| |
| 81 | +| `repo_or_repo_dir` | str | Directory of the repository to test | | |
| 82 | +| `--files` | List[Path] | Files to lint (optional) | | |
| 83 | +| `--commit0-dot-file-path` | str | Path to the commit0 dot file | `.commit0.yaml` | |
| 84 | +| `--verbose` | int | Verbosity level (1 or 2) | `1` | |
| 85 | + |
| 86 | +### Save |
| 87 | + |
| 88 | +Use `commit0 save [OPTIONS] OWNER BRANCH` to save the Commit0 split to GitHub. |
| 89 | +Available options include: |
| 90 | + |
| 91 | +| Argument | Type | Description | Default | |
| 92 | +|----------|------|-------------|---------| |
| 93 | +| `owner` | str | Owner of the repository | | |
| 94 | +| `branch` | str | Branch to save | | |
| 95 | +| `--github-token` | str | GitHub token for authentication | | |
| 96 | +| `--commit0-dot-file-path` | str | Path to the commit0 dot file | `.commit0.yaml` | |
| 97 | + |
| 98 | +## Agent |
| 99 | + |
| 100 | +### Config |
| 101 | + |
| 102 | +Use `agent config [OPTIONS] AGENT_NAME` to set up the configuration for an agent. |
| 103 | +Available options include: |
| 104 | + |
| 105 | +| Argument | Type | Description | Default | |
| 106 | +|----------|------|-------------|---------| |
| 107 | +| `agent_name` | str | Agent to use, we only support [aider](https://aider.chat/) for now. | `aider` | |
| 108 | +| `--model-name` | str | LLM model to use, check [here](https://aider.chat/docs/llms.html) for all supported models. | `claude-3-5-sonnet-20240620` | |
| 109 | +| `--use-user-prompt` | bool | Use a custom prompt instead of the default prompt. | `False` | |
| 110 | +| `--user-prompt` | str | The prompt sent to agent. | See code for details. | |
| 111 | +| `--run-tests` | bool | Run tests after code modifications for feedback. You need to set up `docker` or `modal` before running tests, refer to commit0 docs. | `False` | |
| 112 | +| `--max-iteration` | int | Maximum number of agent iterations. | `3` | |
| 113 | +| `--use-repo-info` | bool | Include the repository information. | `False` | |
| 114 | +| `--max-repo-info-length` | int | Maximum length of the repository information to use. | `10000` | |
| 115 | +| `--use-unit-tests-info` | bool | Include the unit tests information. | `False` | |
| 116 | +| `--max-unit-tests-info-length` | int | Maximum length of the unit tests information to use. | `10000` | |
| 117 | +| `--use-spec-info` | bool | Include the spec information. | `False` | |
| 118 | +| `--max-spec-info-length` | int | Maximum length of the spec information to use. | `10000` | |
| 119 | +| `--use-lint-info` | bool | Include the lint information. | `False` | |
| 120 | +| `--max-lint-info-length` | int | Maximum length of the lint information to use. | `10000` | |
| 121 | +| `--pre-commit-config-path` | str | Path to the pre-commit config file. This is needed for running `lint`. | `.pre-commit-config.yaml` | |
| 122 | +| `--agent-config-file` | str | Path to write the agent config. | `.agent.yaml` | |
| 123 | + |
| 124 | +### Running |
| 125 | + |
| 126 | +Use `agent run [OPTIONS] BRANCH` to execute an agent on a specific branch. |
| 127 | +Available options include: |
| 128 | + |
| 129 | +| Argument | Type | Description | Default | |
| 130 | +|----------|------|-------------|---------| |
| 131 | +| `branch` | str | Branch to run the agent on, you can specific the name of the branch | | |
| 132 | +| `--backend` | str | Test backend to run the agent on, ignore this option if you are not adding `run_tests` option to agent. | `modal` | |
| 133 | +| `--log-dir` | str | Log directory to store the logs. | `logs/aider` | |
| 134 | +| `--max-parallel-repos` | int | Maximum number of repositories for agent to run in parallel. Running in sequential if set to 1. | `1` | |
| 135 | +| `--display-repo-progress-num` | int | Number of repo progress displayed when running. | `5` | |
0 commit comments