{"meta":{"title":"database add-diagnostic","intro":"[Experimental] Add a piece of diagnostic information to a database.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/reference","title":"Reference"},{"href":"/en/code-security/reference/code-scanning","title":"Code scanning"},{"href":"/en/code-security/reference/code-scanning/codeql","title":"CodeQL"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual","title":"CodeQL CLI manual"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/database-add-diagnostic","title":"database add-diagnostic"}],"documentType":"article"},"body":"# database add-diagnostic\n\n[Experimental] Add a piece of diagnostic information to a database.\n\n> [!NOTE]\n> This content describes the most recent release of the CodeQL CLI. For more information about this release, see https://github.com/github/codeql-cli-binaries/releases.\n>\n> To see details of the options available for this command in an earlier release, run the command with the <span style=\"white-space: nowrap;\">`--help`</span> option in your terminal.\n\n## Synopsis\n\n```shell copy\ncodeql database add-diagnostic --source-id=<id> --source-name=<name> <options>... -- <database>\n```\n\n## Description\n\n\\[Experimental] Add a piece of diagnostic information to a database.\n\nAvailable since `v2.12.6`.\n\n## Options\n\n### Primary Options\n\n#### `<database>`\n\n\\[Mandatory] Path to the CodeQL database to bundle.\n\n#### `--markdown-message=<markdownMessage>`\n\nMessage for the diagnostic, in GitHub-flavored Markdown format.\n\n#### `--plaintext-message=<plaintextMessage>`\n\nMessage for the diagnostic, in plain text. This option should only be\nused when populating a Markdown message with --markdown-message is not\npractical.\n\n#### `--severity=<severity>`\n\nSeverity of the diagnostic. Can be \"error\", \"warning\", or \"note\".\n\n#### `--help-link=<helpLinks>`\n\nHelp links relevant to the diagnostic.\n\n#### `--attributes-json=<attributesJson>`\n\nStructured metadata relevant to the diagnostic.\n\n### Options that indicate where the diagnostic message can be displayed\n\n#### `--ready-for-status-page`\n\nIndicate that the diagnostic is suitable for display on the status page.\n\n#### `--ready-for-cli-summary-table`\n\nIndicate that the diagnostic is suitable for display in the diagnostics\nsummary table printed by commands like `database analyze`.\n\n### Options describing the source of the diagnostic\n\n#### `--source-id=<id>`\n\n\\[Mandatory] An identifier for the source of this diagnostic.\n\n#### `--source-name=<name>`\n\n\\[Mandatory] A human-readable description of the source of this\ndiagnostic.\n\n#### `--extractor-name=<extractorName>`\n\nThe name of the CodeQL extractor, if this diagnostic was produced by a\nCodeQL extractor.\n\n### Options describing the diagnostic's location\n\n#### `--file-path=<file>`\n\nThe path of the file to which the diagnostic applies, relative to the\nsource root.\n\n#### `--start-line=<startLine>`\n\nThe 1-based line number (inclusive) where the diagnostic's location\nstarts.\n\n#### `--start-column=<startColumn>`\n\nThe 1-based column number (inclusive) where the diagnostic's location\nstarts.\n\n#### `--end-line=<endLine>`\n\nThe 1-based line number (inclusive) where the diagnostic's location\nends.\n\n#### `--end-column=<endColumn>`\n\nThe 1-based column number (inclusive) where the diagnostic's location\nends.\n\n### Common options\n\n#### `-h, --help`\n\nShow this help text.\n\n#### `-J=<opt>`\n\n\\[Advanced] Give option to the JVM running the command.\n\n(Beware that options containing spaces will not be handled correctly.)\n\n#### `-v, --verbose`\n\nIncrementally increase the number of progress messages printed.\n\n#### `-q, --quiet`\n\nIncrementally decrease the number of progress messages printed.\n\n#### `--verbosity=<level>`\n\n\\[Advanced] Explicitly set the verbosity level to one of errors,\nwarnings, progress, progress+, progress++, progress+++. Overrides `-v`\nand `-q`.\n\n#### `--logdir=<dir>`\n\n\\[Advanced] Write detailed logs to one or more files in the given\ndirectory, with generated names that include timestamps and the name of\nthe running subcommand.\n\n(To write a log file with a name you have full control over, instead\ngive `--log-to-stderr` and redirect stderr as desired.)\n\n#### `--common-caches=<dir>`\n\n\\[Advanced] Controls the location of cached data on disk that will\npersist between several runs of the CLI, such as downloaded QL packs and\ncompiled query plans. If not set explicitly, this defaults to a\ndirectory named `.codeql` in the user's home directory; it will be\ncreated if it doesn't already exist.\n\nAvailable since `v2.15.2`."}