-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathquery-compile.ts
More file actions
30 lines (28 loc) · 1.33 KB
/
query-compile.ts
File metadata and controls
30 lines (28 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* CodeQL query compile tool
*/
import { z } from 'zod';
import { CLIToolDefinition } from '../../lib/cli-tool-registry';
export const codeqlQueryCompileTool: CLIToolDefinition = {
name: 'codeql_query_compile',
description: 'Compile and validate CodeQL queries',
command: 'codeql',
subcommand: 'query compile',
inputSchema: {
query: z.string().describe('Path to the CodeQL query file (.ql)'),
database: z.string().optional().describe('Path to the CodeQL database'),
'dump-dil': z.boolean().optional()
.describe('Print the optimized DIL intermediate representation to standard output while compiling. Enabled by default; pass false or --no-dump-dil to disable.'),
library: z.string().optional().describe('Path to query library'),
output: z.string().optional().describe('Output file path'),
warnings: z.enum(['hide', 'show', 'error']).optional()
.describe('How to handle compilation warnings'),
verbose: z.boolean().optional().describe('Enable verbose output'),
additionalArgs: z.array(z.string()).optional().describe('Additional command-line arguments')
},
examples: [
'codeql query compile --database=/path/to/db MyQuery.ql',
'codeql query compile --dump-dil --database=/path/to/db MyQuery.ql',
'codeql query compile --library=/path/to/lib --output=compiled.qlo MyQuery.ql'
]
};