Skip to content

Commit ab6a689

Browse files
docubotfelicitymay
andauthored
Update CodeQL CLI manual (#35828)
Co-authored-by: Felicity Chapman <felicitymay@github.com>
1 parent 7f3974d commit ab6a689

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+11865
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
title: bqrs decode
3+
versions:
4+
fpt: '*'
5+
ghae: '*'
6+
ghec: '*'
7+
ghes: '*'
8+
topics:
9+
- Advanced Security
10+
- Code scanning
11+
- CodeQL
12+
type: reference
13+
product: '{% data reusables.gated-features.codeql %}'
14+
autogenerated: codeql-cli
15+
intro: Convert result data from BQRS into other forms.
16+
---
17+
18+
19+
<!-- Content after this section is automatically generated -->
20+
21+
{% data reusables.codeql-cli.man-pages-version-note %}
22+
23+
## Synopsis
24+
25+
```shell{:copy}
26+
codeql bqrs decode [--output=<file>] [--result-set=<name>] [--sort-key=<col>[,<col>...]] <options>... -- <file>
27+
```
28+
29+
## Description
30+
31+
Convert result data from BQRS into other forms.
32+
33+
The decoded output will be written to standard output, unless the
34+
`--output` option is specified.
35+
36+
## Primary options
37+
38+
#### `<file>`
39+
40+
\[Mandatory] BQRS file to decode.
41+
42+
#### `-o, --output=<file>`
43+
44+
The file to write the desired output to.
45+
46+
#### `-r, --result-set=<name>`
47+
48+
Select a particular result set from the BQRS file to decode. The
49+
available results sets can be listed by [codeql bqrs info](/code-security/codeql-cli/codeql-cli-manual/bqrs-info).
50+
51+
If no result set is selected, all result sets will be decoded, provided
52+
the selected output format and processing options support that.
53+
Otherwise an error results.
54+
55+
#### `-k, --sort-key=<col>[,<col>...]`
56+
57+
Sort the selected result set by the indicated columns.
58+
59+
#### `--sort-direction=<direction>[,<direction>...]`
60+
61+
Sort the selected result set using the indicated sort directions.
62+
63+
If sort directions are not specified, then ascending order will be used
64+
for all columns.
65+
66+
### Output format options
67+
68+
#### `--format=<fmt>`
69+
70+
Select output format. Choices include:
71+
72+
`text` *(default)*: A human-readable plain text table.
73+
74+
`csv`: Comma-separated values.
75+
76+
`json`: Streaming JSON.
77+
78+
`bqrs`: BQRS. This must be used with `--output`. Most useful together
79+
with `--sort-key`.
80+
81+
#### `--no-titles`
82+
83+
Omit column titles for `text` and `csv` formats
84+
85+
#### `--entities=<fmt>[,<fmt>...]`
86+
87+
\[Advanced] Control how result columns of entity type are shown. A
88+
comma-separated list of the following choices:
89+
90+
`url`: A URL referring to a source location, if the query was compiled
91+
to produce such URLs for entitity types.
92+
93+
`string`: A string computed by the toString() method in QL, if the query
94+
was compiled to produce such strings for the column.
95+
96+
`id`: The internal ID of the entity, which may not be informative.
97+
98+
`all`: Show columns with all the information the BQRS file provides.
99+
100+
All the selected options are shown, if possible.
101+
102+
### Options for pagination (for use by interactive front-ends)
103+
104+
#### `--rows=<num>`
105+
106+
\[Advanced] Output this many rows from the selected resultset, starting
107+
at the top, or at the location given by `--start-at`.
108+
109+
#### `--start-at=<offset>`
110+
111+
\[Advanced] Start printing the row defined at a particular byte offset
112+
in the BQRS file. The offset must be gotten from [codeql bqrs info](/code-security/codeql-cli/codeql-cli-manual/bqrs-info), or from the "next" pointer found in JSON output from a previous invocation with `--rows`
113+
set. Other offsets are likely to produce nonsense output and/or explicit
114+
errors.
115+
116+
Must always be used together with `--rows`, and is incompatible with
117+
`--sort-key`.
118+
119+
### Common options
120+
121+
#### `-h, --help`
122+
123+
Show this help text.
124+
125+
#### `-J=<opt>`
126+
127+
\[Advanced] Give option to the JVM running the command.
128+
129+
(Beware that options containing spaces will not be handled correctly.)
130+
131+
#### `-v, --verbose`
132+
133+
Incrementally increase the number of progress messages printed.
134+
135+
#### `-q, --quiet`
136+
137+
Incrementally decrease the number of progress messages printed.
138+
139+
#### `--verbosity=<level>`
140+
141+
\[Advanced] Explicitly set the verbosity level to one of errors,
142+
warnings, progress, progress+, progress++, progress+++. Overrides `-v`
143+
and `-q`.
144+
145+
#### `--logdir=<dir>`
146+
147+
\[Advanced] Write detailed logs to one or more files in the given
148+
directory, with generated names that include timestamps and the name of
149+
the running subcommand.
150+
151+
(To write a log file with a name you have full control over, instead
152+
give `--log-to-stderr` and redirect stderr as desired.)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: bqrs diff
3+
versions:
4+
fpt: '*'
5+
ghae: '*'
6+
ghec: '*'
7+
ghes: '*'
8+
topics:
9+
- Advanced Security
10+
- Code scanning
11+
- CodeQL
12+
type: reference
13+
product: '{% data reusables.gated-features.codeql %}'
14+
autogenerated: codeql-cli
15+
intro: Compute the difference between two result sets.
16+
---
17+
18+
19+
<!-- Content after this section is automatically generated -->
20+
21+
{% data reusables.codeql-cli.man-pages-version-note %}
22+
23+
## Synopsis
24+
25+
```shell{:copy}
26+
codeql bqrs diff <options>... -- <file1> <file2>
27+
```
28+
29+
## Description
30+
31+
Compute the difference between two result sets.
32+
33+
## Primary options
34+
35+
#### `<file1>`
36+
37+
\[Mandatory] First BQRS file to compare.
38+
39+
#### `<file2>`
40+
41+
\[Mandatory] Second BQRS file to compare.
42+
43+
#### `--left=<file>`
44+
45+
Write rows only present in `file1` to this file.
46+
47+
#### `--right=<file>`
48+
49+
Write rows only present in `file2` to this file.
50+
51+
#### `--both=<file>`
52+
53+
Write rows present in both `file1` and `file2` to this file.
54+
55+
#### `--retain-result-sets=<result-set>[,<result-set>...]`
56+
57+
Comma-separated list of result set names to copy directly to the
58+
corresponding output instead of comparing. If --both is given, that
59+
output is taken from `file1`. Defaults to 'nodes,edges,subpaths' to
60+
simplify handling of path-problem results.
61+
62+
#### `--[no-]compare-internal-ids`
63+
64+
\[Advanced] Include internal entity IDs in the comparison. Entity IDs
65+
are not comparable across databases, but for result sets that originate
66+
from the same database this can help distinguish entities with the same
67+
location and label.
68+
69+
### Common options
70+
71+
#### `-h, --help`
72+
73+
Show this help text.
74+
75+
#### `-J=<opt>`
76+
77+
\[Advanced] Give option to the JVM running the command.
78+
79+
(Beware that options containing spaces will not be handled correctly.)
80+
81+
#### `-v, --verbose`
82+
83+
Incrementally increase the number of progress messages printed.
84+
85+
#### `-q, --quiet`
86+
87+
Incrementally decrease the number of progress messages printed.
88+
89+
#### `--verbosity=<level>`
90+
91+
\[Advanced] Explicitly set the verbosity level to one of errors,
92+
warnings, progress, progress+, progress++, progress+++. Overrides `-v`
93+
and `-q`.
94+
95+
#### `--logdir=<dir>`
96+
97+
\[Advanced] Write detailed logs to one or more files in the given
98+
directory, with generated names that include timestamps and the name of
99+
the running subcommand.
100+
101+
(To write a log file with a name you have full control over, instead
102+
give `--log-to-stderr` and redirect stderr as desired.)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: bqrs hash
3+
versions:
4+
fpt: '*'
5+
ghae: '*'
6+
ghec: '*'
7+
ghes: '*'
8+
topics:
9+
- Advanced Security
10+
- Code scanning
11+
- CodeQL
12+
type: reference
13+
product: '{% data reusables.gated-features.codeql %}'
14+
autogenerated: codeql-cli
15+
intro: '[Plumbing] Compute a stable hash of a BQRS file.'
16+
---
17+
18+
19+
<!-- Content after this section is automatically generated -->
20+
21+
{% data reusables.codeql-cli.man-pages-version-note %}
22+
23+
## Synopsis
24+
25+
```shell{:copy}
26+
codeql bqrs hash <options>... -- <file>
27+
```
28+
29+
## Description
30+
31+
\[Plumbing] Compute a stable hash of a BQRS file.
32+
33+
## Primary options
34+
35+
#### `<file>`
36+
37+
\[Mandatory] BQRS file to hash.
38+
39+
### Common options
40+
41+
#### `-h, --help`
42+
43+
Show this help text.
44+
45+
#### `-J=<opt>`
46+
47+
\[Advanced] Give option to the JVM running the command.
48+
49+
(Beware that options containing spaces will not be handled correctly.)
50+
51+
#### `-v, --verbose`
52+
53+
Incrementally increase the number of progress messages printed.
54+
55+
#### `-q, --quiet`
56+
57+
Incrementally decrease the number of progress messages printed.
58+
59+
#### `--verbosity=<level>`
60+
61+
\[Advanced] Explicitly set the verbosity level to one of errors,
62+
warnings, progress, progress+, progress++, progress+++. Overrides `-v`
63+
and `-q`.
64+
65+
#### `--logdir=<dir>`
66+
67+
\[Advanced] Write detailed logs to one or more files in the given
68+
directory, with generated names that include timestamps and the name of
69+
the running subcommand.
70+
71+
(To write a log file with a name you have full control over, instead
72+
give `--log-to-stderr` and redirect stderr as desired.)

0 commit comments

Comments
 (0)