{"meta":{"title":"pack add","intro":"Adds a list of QL library packs with optional version\nranges as dependencies of the current package, and then installs them.","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/pack-add","title":"pack add"}],"documentType":"article"},"body":"# pack add\n\nAdds a list of QL library packs with optional version\nranges as dependencies of the current package, and then installs them.\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 pack add <options>... -- <scope/name[@range]>...\n```\n\n## Description\n\nAdds a list of QL library packs with optional version ranges as\ndependencies of the current package, and then installs them.\n\nThis command modifies the qlpack.yml file of the current package.\nFormatting and comments will be removed.\n\nAvailable since `v2.6.0`.\n\n## Options\n\n### Primary Options\n\n#### `<scope/name[@range]>...`\n\n\\[Mandatory] The scope, name, and optional version range of the pack to\nadd to the dependency list.\n\nIf no version range is specified, or if the version range is specified\nas 'latest', the latest version of the pack is downloaded, and a\ndependency is added to qlpack.yml that allows any version that is\ncompatible with the downloaded version.\n\nIf a single version is specified, that version of the pack is\ndownloaded, and a dependency is added to qlpack.yml that allows any\nversion that is compatible with the specified version.\n\nIf a version range is specified, the latest version of the pack that\nsatisfies the specified range is downloaded, and a dependency is added\nto qlpack.yml with the specified version range.\n\n#### `--dir=<dir>`\n\nThe root directory of the package.\n\n#### `--registries-auth-stdin`\n\nAuthenticate to GitHub Enterprise Server Container registries by passing\na comma-separated list of \\<registry\\_url>=\\<token> pairs.\n\nFor example, you can pass\n`https://containers.GHEHOSTNAME1/v2/=TOKEN1,https://containers.GHEHOSTNAME2/v2/=TOKEN2`\nto authenticate to two GitHub Enterprise Server instances.\n\nThis overrides the CODEQL\\_REGISTRIES\\_AUTH and GITHUB\\_TOKEN environment\nvariables. If you only need to authenticate to the github.com Container\nregistry, you can instead authenticate using the simpler\n`--github-auth-stdin` option.\n\n#### `--github-auth-stdin`\n\nAuthenticate to the github.com Container registry by passing a\ngithub.com GitHub Apps token or personal access token via standard\ninput.\n\nTo authenticate to GitHub Enterprise Server Container registries, pass\n`--registries-auth-stdin` or use the CODEQL\\_REGISTRIES\\_AUTH environment\nvariable.\n\nThis overrides the GITHUB\\_TOKEN environment variable.\n\n#### `--[no-]allow-prerelease`\n\nAllow packs with pre-release version qualifiers (e.g.,\n`X.Y.Z-qualifier`) to be used. Without this flag, pre-release packs will\nbe ignored.\n\nAvailable since `v2.11.3`.\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`."}