Skip to content

Commit 03c418c

Browse files
docs-botmchammer01Copilot
authored
Update CodeQL CLI manual (#62818)
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f4f0da8 commit 03c418c

3 files changed

Lines changed: 201 additions & 5 deletions

File tree

content/code-security/reference/code-scanning/codeql/codeql-cli-manual/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: CodeQL CLI commands manual
33
shortTitle: CodeQL CLI manual
44
allowTitleToDifferFromFilename: true
5-
intro: Reference information for the commands available in the most recent release of {% data variables.product.prodname_codeql_cli %}.
5+
intro: Reference information for the commands available in the most recent release of {% data variables.product.prodname_codeql_cli %}.
66
versions:
77
fpt: '*'
88
ghec: '*'
@@ -76,6 +76,7 @@ children:
7676
- /resolve-files
7777
- /resolve-languages
7878
- /resolve-library-path
79+
- /resolve-library-paths
7980
- /resolve-metadata
8081
- /resolve-ml-models
8182
- /resolve-packs

content/code-security/reference/code-scanning/codeql/codeql-cli-manual/resolve-library-path.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,9 @@ Exactly one of these options must be given.
173173

174174
#### `--query=<qlfile>`
175175

176-
The path to the QL file we want to compile.
177-
178-
Its directory and parent directories will be searched for qlpack.yml or
179-
legacy queries.xml files to determine necessary packs.
176+
The path to the QL file we want to compile. Its directory and parent
177+
directories will be searched for qlpack.yml or legacy queries.xml files
178+
to determine necessary packs.
180179

181180
#### `--dir=<dir>`
182181

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
---
2+
title: resolve library-paths
3+
versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖
4+
fpt: '*'
5+
ghec: '*'
6+
ghes: '*'
7+
contentType: reference
8+
product: '{% data reusables.gated-features.codeql %}'
9+
category:
10+
- Find CodeQL CLI commands
11+
autogenerated: codeql-cli
12+
---
13+
14+
<!-- Content after this section is automatically generated -->
15+
16+
{% data reusables.codeql-cli.man-pages-version-note %}
17+
18+
## Synopsis
19+
20+
```shell copy
21+
codeql resolve library-paths <options>... -- <query>...
22+
```
23+
24+
## Description
25+
26+
\[Deep plumbing] Determine QL library paths and dbschemes for multiple
27+
queries.
28+
29+
Determine which QL library path each query should be compiled against.
30+
This computation is implicit in several subcommands that may need to
31+
compile queries. It is exposed as a separate plumbing command in order
32+
to (a) help with troubleshooting, and (b) provide a starting point for
33+
modifying the path in extraordinary cases where exact control is needed.
34+
35+
The command will also detect a language and dbscheme to compile each
36+
query against, as these may also depend on autodetecting the language of
37+
a QL query.
38+
39+
**The command is deeply internal and its behavior or existence may
40+
change without much notice as the QL language ecosystem evolves.**
41+
42+
## Options
43+
44+
### Primary Options
45+
46+
#### `<query>...`
47+
48+
\[Mandatory] The path to the QL file we want to compile. Its directory
49+
and parent directories will be searched for qlpack.yml or legacy
50+
queries.xml files to determine necessary packs.
51+
52+
#### `--[no-]find-extractors`
53+
54+
\[Advanced] Include in the output a summary of `extractor` fields from
55+
the QL packs that the query depends on. This is used only for a few rare
56+
internal cases, and may require more work to compute, so is not turned
57+
on by default.
58+
59+
### Options from the invoking command's command line
60+
61+
#### `--search-path=<dir>[:<dir>...]`
62+
63+
A list of directories under which QL packs may be found. Each directory
64+
can either be a QL pack (or bundle of packs containing a
65+
`.codeqlmanifest.json` file at the root) or the immediate parent of one
66+
or more such directories.
67+
68+
If the path contains more than one directory, their order defines
69+
precedence between them: when a pack name that must be resolved is
70+
matched in more than one of the directory trees, the one given first
71+
wins.
72+
73+
Pointing this at a checkout of the open-source CodeQL repository ought
74+
to work when querying one of the languages that live there.
75+
76+
If you have checked out the CodeQL repository as a sibling of the
77+
unpacked CodeQL toolchain, you don't need to give this option; such
78+
sibling directories will always be searched for QL packs that cannot be
79+
found otherwise. (If this default does not work, it is strongly
80+
recommended to set up `--search-path` once and for all in a per-user
81+
configuration file).
82+
83+
(Note: On Windows the path separator is `;`).
84+
85+
#### `--additional-packs=<dir>[:<dir>...]`
86+
87+
If this list of directories is given, they will be searched for packs
88+
before the ones in `--search-path`. The order between these doesn't
89+
matter; it is an error if a pack name is found in two different places
90+
through this list.
91+
92+
This is useful if you're temporarily developing a new version of a pack
93+
that also appears in the default path. On the other hand, it is _not
94+
recommended_ to override this option in a config file; some internal
95+
actions will add this option on the fly, overriding any configured
96+
value.
97+
98+
(Note: On Windows the path separator is `;`).
99+
100+
#### `--library-path=<dir>[:<dir>...]`
101+
102+
\[Advanced] An optional list of directories that will be added to the
103+
raw import search path for QL libraries. This should only be used if
104+
you're using QL libraries that have not been packaged as QL packs.
105+
106+
(Note: On Windows the path separator is `;`).
107+
108+
#### `--dbscheme=<file>`
109+
110+
\[Advanced] Explicitly define which dbscheme queries should be compiled
111+
against. This should only be given by callers that are extremely sure
112+
what they're doing.
113+
114+
#### `--compilation-cache=<dir>`
115+
116+
\[Advanced] Specify an additional directory to use as a compilation
117+
cache.
118+
119+
#### `--no-default-compilation-cache`
120+
121+
\[Advanced] Don't use compilation caches in standard locations such as
122+
in the QL pack containing the query or in the CodeQL toolchain
123+
directory.
124+
125+
### Options for configuring the CodeQL package manager
126+
127+
#### `--registries-auth-stdin`
128+
129+
Authenticate to GitHub Enterprise Server Container registries by passing
130+
a comma-separated list of \<registry\_url>=\<token> pairs.
131+
132+
For example, you can pass
133+
`https://containers.GHEHOSTNAME1/v2/=TOKEN1,https://containers.GHEHOSTNAME2/v2/=TOKEN2`
134+
to authenticate to two GitHub Enterprise Server instances.
135+
136+
This overrides the CODEQL\_REGISTRIES\_AUTH and GITHUB\_TOKEN environment
137+
variables. If you only need to authenticate to the github.com Container
138+
registry, you can instead authenticate using the simpler
139+
`--github-auth-stdin` option.
140+
141+
#### `--github-auth-stdin`
142+
143+
Authenticate to the github.com Container registry by passing a
144+
github.com GitHub Apps token or personal access token via standard
145+
input.
146+
147+
To authenticate to GitHub Enterprise Server Container registries, pass
148+
`--registries-auth-stdin` or use the CODEQL\_REGISTRIES\_AUTH environment
149+
variable.
150+
151+
This overrides the GITHUB\_TOKEN environment variable.
152+
153+
### Common options
154+
155+
#### `-h, --help`
156+
157+
Show this help text.
158+
159+
#### `-J=<opt>`
160+
161+
\[Advanced] Give option to the JVM running the command.
162+
163+
(Beware that options containing spaces will not be handled correctly.)
164+
165+
#### `-v, --verbose`
166+
167+
Incrementally increase the number of progress messages printed.
168+
169+
#### `-q, --quiet`
170+
171+
Incrementally decrease the number of progress messages printed.
172+
173+
#### `--verbosity=<level>`
174+
175+
\[Advanced] Explicitly set the verbosity level to one of errors,
176+
warnings, progress, progress+, progress++, progress+++. Overrides `-v`
177+
and `-q`.
178+
179+
#### `--logdir=<dir>`
180+
181+
\[Advanced] Write detailed logs to one or more files in the given
182+
directory, with generated names that include timestamps and the name of
183+
the running subcommand.
184+
185+
(To write a log file with a name you have full control over, instead
186+
give `--log-to-stderr` and redirect stderr as desired.)
187+
188+
#### `--common-caches=<dir>`
189+
190+
\[Advanced] Controls the location of cached data on disk that will
191+
persist between several runs of the CLI, such as downloaded QL packs and
192+
compiled query plans. If not set explicitly, this defaults to a
193+
directory named `.codeql` in the user's home directory; it will be
194+
created if it doesn't already exist.
195+
196+
Available since `v2.15.2`.

0 commit comments

Comments
 (0)