# A-Team [![Crates.io](https://img.shields.io/crates/v/ateam.svg)](https://crates.io/crates/ateam) [![Crates.io](https://img.shields.io/crates/d/ateam.svg)](https://crates.io/crates/ateam) [![CI](https://github.com/frisoft/ateam/workflows/CI/badge.svg)](https://github.com/frisoft/ateam/actions) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/frisoft/ateam/blob/master/LICENSE) The tool that helps optimize the code review process. ## Install `cargo install ateam` Create a GitHub API token and store it in the GITHUB_API_TOKEN env variable. You can also use a .env file. The token needs `repo` and `read:org` selected scopes. In case your organization has enforced some sort of authorization like SAML, you need to authorize your PAT like this https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on ## Configuration A-team needs to connect to GitHub's API using your GitHub API token. You can use this [guide to create one](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token#creating-a-token). The token needs read access to GitHub. You need to set the token as env variable in your shell. You can add it to your `~.bashrc`, or you can use a `.env` file in the directory you will use ateam from (or one of the parent directories): ```bash export GITHUB_API_TOKEN=YOUR_TOKEN ``` ATeam gives you two sub-commands: `pr` and `todo`. ## ateam pr This command helps the developers determine which pull request should be reviewed next. To get all the pull requests of your organization (any repo), use the following command: ```bash ❯ ateam pr --org OrgName --include-mine --include-reviewed-by-me ``` The previous list also includes your pull requests and all the ones you already reviewed. You probably want to exclude them: ``` ❯ ateam pr --org OrgName ``` The pull requests are in the order they are supposed to be reviewed. The first one is probably the one you should review first. You can also search for specific pull requests. You can use the `--query` option for this. It allows you to use any condition you can use int GitHub search. The most common search is by text: ``` ❯ ateam pr --org OrgName --query 'urgent' ``` Unfortunately, the `--query` option does not allow to combine texts with the OR operator. In the case you want to search for two or more strings, you can use the `--regex` option: ``` ❯ ateam pr --org OrgName --regex 'urgent|bugfix|awesome' ``` You can also filter by labels: ``` ❯ ateam pr --org OrgName --label LABEL1 --label LABEL2 ``` To see all the possible options, you can use `--help`: ``` ❯ ateam pr --help Usage: ateam pr [OPTIONS] Options: -r, --repo Repositiy. Can be used multiple times to select more than one --org Selest all the repositoris of the organization -q, --query GitHub query. Can be used multiple times -n, --num Number of pull requests to display -s, --short Short version. No table --json Output in JSON --label