{"meta":{"title":"Scan from the command line","intro":"Run code scanning from the command line using the CodeQL CLI to configure scans, customize queries, and troubleshoot results.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/how-tos","title":"How-tos"},{"href":"/en/code-security/how-tos/find-and-fix-code-vulnerabilities","title":"Find and fix code vulnerabilities"},{"href":"/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line","title":"Scan from the command line"}],"documentType":"subcategory"},"body":"# Scan from the command line\n\nRun code scanning from the command line using the CodeQL CLI to configure scans, customize queries, and troubleshoot results.\n\n## Links\n\n* [Setting up the CodeQL CLI](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/setting-up-the-codeql-cli)\n\n  To get started with the CodeQL CLI, you need to download and set up the CLI so that it can access the tools and libraries required to create and analyze databases.\n\n* [Writing custom queries for the CodeQL CLI](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/write-custom-queries)\n\n  You can write your own CodeQL queries to find specific vulnerabilities and errors.\n\n* [Publishing and using CodeQL packs](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/publish-and-use-packs)\n\n  Share or download a CodeQL pack, then analyze your CodeQL database.\n\n* [Testing custom queries](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/testing-custom-queries)\n\n  Verify your custom CodeQL queries and catch breaking changes before they affect your code scanning results following new releases of the CodeQL CLI.\n\n* [Testing query help files](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/testing-query-help-files)\n\n  Ensure your CodeQL query help files are valid by previewing them as Markdown.\n\n* [Downloading CodeQL databases from GitHub](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/download-databases)\n\n  Expand the coverage of the CodeQL CLI by adding ready-made databases.\n\n* [Checking out the CodeQL CLI source code](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/check-out-source-code)\n\n  Set up the CodeQL CLI directly from the source code.\n\n* [Specifying command options in a CodeQL configuration file](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/specifying-command-options-in-a-codeql-configuration-file)\n\n  Save time by adding your frequently used command options and custom CodeQL packs to a CodeQL configuration file.\n\n* [Creating CodeQL CLI database bundles](/en/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-the-command-line/creating-database-bundle-for-troubleshooting)\n\n  Create a database bundle with CodeQL troubleshooting information."}