|
| 1 | +--- |
| 2 | +title: Creating CodeQL CLI database bundles |
| 3 | +intro: 'You can create a database bundle with {% data variables.product.prodname_codeql %} troubleshooting information.' |
| 4 | +allowTitleToDifferFromFilename: true |
| 5 | +product: '{% data reusables.gated-features.codeql %}' |
| 6 | +versions: |
| 7 | + fpt: '*' |
| 8 | + ghes: '*' |
| 9 | + ghec: '*' |
| 10 | +topics: |
| 11 | + - Advanced Security |
| 12 | + - Code scanning |
| 13 | + - CodeQL |
| 14 | +--- |
| 15 | + |
| 16 | +> [!WARNING] |
| 17 | +> {% data variables.product.prodname_codeql_cli %} database bundles contain a copy of the source code being analyzed by {% data variables.product.prodname_codeql %}, therefore we suggest sharing these bundles only with people who are authorized to access that source code. |
| 18 | +
|
| 19 | +## About creating {% data variables.product.prodname_codeql_cli %} database bundles |
| 20 | + |
| 21 | +{% data reusables.code-scanning.codeql-cli-version-ghes %} |
| 22 | + |
| 23 | +The {% data variables.product.prodname_codeql_cli %} database bundle command can be used to create a relocatable archive of a {% data variables.product.prodname_codeql %} database. |
| 24 | + |
| 25 | +A copy of a database bundle can be used to share troubleshooting information with your team members or with {% data variables.contact.github_support %}. |
| 26 | + |
| 27 | +The following {% data variables.product.prodname_codeql_cli %} command syntax is suggested when creating a database bundle for troubleshooting purposes: |
| 28 | + |
| 29 | +> [!NOTE] |
| 30 | +> This sample `database bundle` command requires {% data variables.product.prodname_codeql_cli %} version {% data variables.product.codeql_cli_version_min_version_create_bundle %} or higher. |
| 31 | +
|
| 32 | +```shell |
| 33 | +codeql database bundle --output=codeql-debug-artifacts.zip --include-diagnostics --include-logs --include-results -- <dir> |
| 34 | +``` |
| 35 | + |
| 36 | +For this command, `<dir>` must be the path to the directory where the {% data variables.product.prodname_codeql %} database was created. |
| 37 | + |
| 38 | +The successful command execution creates a zip file called `codeql-debug-artifacts.zip` which contains {% data variables.product.prodname_codeql %} troubleshooting information. That file is the database bundle. |
| 39 | + |
| 40 | +This command assumes that the `--log-dir` command line argument was not used for the `database create` and `database analyze` commands. When that command line argument is used, the log files created by those commands will not be included with the database bundle. |
| 41 | + |
| 42 | +## Increasing the verbosity for `database create` and `database analyze` |
| 43 | + |
| 44 | +If the `database create` and `database analyze` commands are not detailed enough for troubleshooting purposes, you can increase their verbosity. |
| 45 | + |
| 46 | +Both commands support the `--verbosity` command line argument which can be set to `progress++` prior to creating a database bundle. |
0 commit comments