{"meta":{"title":"pack publish","intro":"Publishes a QL library pack to a package registry.","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-publish","title":"pack publish"}],"documentType":"article"},"body":"# pack publish\n\nPublishes a QL library pack to a package registry.\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 publish [--dry-run] [--threads=<num>] [--ram=<MB>] [--pack=<folder> | <package.tgz>] <options>... -- <dir>\n```\n\n## Description\n\nPublishes a QL library pack to a package registry.\n\nThis command publishes a pack to a package registry. Before publishing,\nthe pack is first compiled (if necessary) and bundled.\n\nAvailable since `v2.6.0`.\n\n## Options\n\n### Primary Options\n\n#### `<dir>`\n\nThe root directory of the package or workspace, defaults to the current\nworking directory. If this parameter points to a directory containing a\nqlpack.yml, then this operation will run on only that CodeQL package. If\nthis parameter points to a directory containing a codeql-workspace.yml,\nthen this operation will run on all CodeQL packages in the workspace.\n\n#### `-n, --[no-]dry-run`\n\nPrint what would have been done, but do not actually publish the\npackage.\n\n#### `--no-keep`\n\nDelete the pack bundle after publishing.\n\n#### `-j, --threads=<num>`\n\nUse this many threads to compile queries.\n\nDefaults to 1. You can pass 0 to use one thread per core on the machine,\nor -_N_ to leave _N_ cores unused (except still use at least one\nthread).\n\n#### `-M, --ram=<MB>`\n\nSet total amount of RAM that the compiler should be allowed to use.\n\n#### `--no-precompile`\n\n\\[Advanced] Avoid precompiling the compilation cache in the pack output\ndirectory. This will reduce the size of the pack and the time it takes\nto create it, but will require compilation before the pack can be run.\nOnly meaningful for query packs.\n\n#### `--no-validate-extensions`\n\n\\[Advanced] Avoid validating data extensions as part of the compile\nstep.\n\nAvailable since `v2.13.3`.\n\n#### `--no-overwrite`\n\n\\[Advanced] Avoid recompiling and overwriting any existing compiled\noutput from a previous invocation of this command.\n\n#### `-p, --pack=<folder> | <package.tgz>`\n\n\\[Advanced] The location to place the packaged tarball. If this option\nends in .tgz, then the tarball will be created with that name.\nOtherwise, a new directory is created at the specified path and one or\nmore tarballs are created there. Using .tgz is not allowed for\nworkspaces.\n\n#### `--file=<package.tgz>`\n\n\\[Advanced] Upload `package.tgz` directly to the package registry\nwithout trying to create or bundle anything new.\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### Options for configuring which CodeQL packs to apply this command to.\n\n#### `--format=<fmt>`\n\nSelect output format, either `text` _(default)_ or `json`.\n\n#### `--groups=[-]<group>[,[-]<group>...]`\n\nList of CodeQL pack groups to include or exclude from this operation. A\nqlpack in the given workspace is included if:\n\n* It is in at least one of the groups listed without a minus sign (this\n  condition is automatically satisfied if there are no groups listed\n  without a minus sign), and\n* It is not in any group listed with a minus sign\n\n### Options to set up compilation environment\n\n#### `--search-path=<dir>[:<dir>...]`\n\nA list of directories under which QL packs may be found. Each directory\ncan either be a QL pack (or bundle of packs containing a\n`.codeqlmanifest.json` file at the root) or the immediate parent of one\nor more such directories.\n\nIf the path contains more than one directory, their order defines\nprecedence between them: when a pack name that must be resolved is\nmatched in more than one of the directory trees, the one given first\nwins.\n\nPointing this at a checkout of the open-source CodeQL repository ought\nto work when querying one of the languages that live there.\n\nIf you have checked out the CodeQL repository as a sibling of the\nunpacked CodeQL toolchain, you don't need to give this option; such\nsibling directories will always be searched for QL packs that cannot be\nfound otherwise. (If this default does not work, it is strongly\nrecommended to set up `--search-path` once and for all in a per-user\nconfiguration file).\n\n(Note: On Windows the path separator is `;`).\n\n#### `--additional-packs=<dir>[:<dir>...]`\n\nIf this list of directories is given, they will be searched for packs\nbefore the ones in `--search-path`. The order between these doesn't\nmatter; it is an error if a pack name is found in two different places\nthrough this list.\n\nThis is useful if you're temporarily developing a new version of a pack\nthat also appears in the default path. On the other hand, it is _not\nrecommended_ to override this option in a config file; some internal\nactions will add this option on the fly, overriding any configured\nvalue.\n\n(Note: On Windows the path separator is `;`).\n\n#### `--library-path=<dir>[:<dir>...]`\n\n\\[Advanced] An optional list of directories that will be added to the\nraw import search path for QL libraries. This should only be used if\nyou're using QL libraries that have not been packaged as QL packs.\n\n(Note: On Windows the path separator is `;`).\n\n#### `--dbscheme=<file>`\n\n\\[Advanced] Explicitly define which dbscheme queries should be compiled\nagainst. This should only be given by callers that are extremely sure\nwhat they're doing.\n\n#### `--compilation-cache=<dir>`\n\n\\[Advanced] Specify an additional directory to use as a compilation\ncache.\n\n#### `--no-default-compilation-cache`\n\n\\[Advanced] Don't use compilation caches in standard locations such as\nin the QL pack containing the query or in the CodeQL toolchain\ndirectory.\n\n### Options for configuring the CodeQL package manager\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### 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`."}