|
| 1 | +# Installing and running Gitxray |
| 2 | + |
| 3 | +gitxray was written with no use of external package dependencies other than the `requests` library. |
| 4 | + |
| 5 | +## PyPI (PIP) Way |
| 6 | + |
| 7 | +`gitxray` is on PyPI and can be installed with: |
| 8 | + |
| 9 | +```bash |
| 10 | +pip install gitxray |
| 11 | +``` |
| 12 | + |
| 13 | +Once installed, simply run gitxray from your command line by typing: |
| 14 | +```bash |
| 15 | +gitxray -h |
| 16 | +``` |
| 17 | + |
| 18 | +## Installing from source |
| 19 | + |
| 20 | +You may also run `gitxray` directly by cloning or downloading its GitHub [repository](https://github.com/kulkansecurity/gitxray/) and running: |
| 21 | + |
| 22 | +```bash |
| 23 | +python3 -m pip install -r requirements.txt |
| 24 | +cd src/ |
| 25 | +python3 -m gitxray.gitxray |
| 26 | +``` |
| 27 | + |
| 28 | +## Command Line Arguments |
| 29 | + |
| 30 | +### Required Arguments |
| 31 | + |
| 32 | +One of the following must be specified: |
| 33 | + |
| 34 | +* `-r, --repository [URL]` - Specify a single repository URL to check. The URL must begin with `https://`. **Example**: `--repository https://github.com/example/repo` |
| 35 | + |
| 36 | +* `-rf, --repositories-file [FILEPATH]` - Provide a file path containing a list of repositories, each on a new line. The file must exist. **Example**: `--repositories-file ./list_of_repos.txt` |
| 37 | + |
| 38 | +* `-o, --organization [URL]` - Specify an organization URL to check all repositories under that organization. The URL must begin with `https://`. **Example**: `--organization https://github.com/exampleOrg` |
| 39 | + |
| 40 | +### Optional Arguments |
| 41 | + |
| 42 | +You'll find these optional but very handy in common gitxray usage. |
| 43 | + |
| 44 | +- `-l, --list` - List contributors if a repository is specified or list repositories if an organization is specified. Useful for further focusing on specific entities. **Example**: `--list` |
| 45 | + |
| 46 | +- `-c, --contributor [USERNAMES]` - A comma-separated list of GitHub usernames to focus on within the specified repository or organization. **Example**: `--contributor user1,user2` |
| 47 | + |
| 48 | +- `-f, --filters [KEYWORDS]` - Comma-separated keywords to filter the results by, such as 'user_input', 'association', or 'mac'. **Example**: `--filters user_input,association,mac` |
| 49 | + |
| 50 | +#### Verbose and Debug |
| 51 | +- `-v, --verbose` - Enable verbose output which, for example, provides a detailed list of public events instead of a summary. **Example**: `--verbose` |
| 52 | + |
| 53 | +- `--debug` - Enable Debug mode for a detailed and extensive output. **Example**: `--debug` |
| 54 | + |
| 55 | +#### Output and Formats |
| 56 | + |
| 57 | +- `-out, --outfile [FILEPATH]` - Specify the file path for the output log. Cannot be a directory. **Example**: `--outfile ./output.log` |
| 58 | + |
| 59 | +- `-outformat, --output-format [FORMAT]` - Set the format for the log file. Supported formats are `text` and `json`. Default is `text`. **Example**: `--output-format json` |
| 60 | + |
| 61 | +### Usage Examples |
| 62 | +Refer to [Use cases](index.md#use-cases-when-using-gitxray) for combinations of commands aligned with specific use-cases. |
| 63 | + |
| 64 | +``` bash |
| 65 | +# Analyze a single repository with verbose output |
| 66 | +gitxray --repository https://github.com/example/repo --verbose |
| 67 | + |
| 68 | +# List all repository names under a given Organization |
| 69 | +gitxray --organization https://github.com/exampleOrg --list |
| 70 | + |
| 71 | +# Analyze all repositories under an Organization with filters capturing user_input and associations |
| 72 | +gitxray -org https://github.com/exampleOrg -f user_input,association |
| 73 | +``` |
| 74 | + |
0 commit comments