Available Functions:
File Functions:
fileExists(path) Check if file exists
fileLength(path) Count non-empty lines in file
dirLength(path) Count directory entries
readFile(path) Read file contents
readLines(path) Read file as array of lines
writeFile(path, content) Write content to file
appendFile(path, content) Append content to file
fileContains(path, pattern) Check if file contains pattern
regexExtract(path, regex) Extract lines matching regex
String Functions:
trim(str) Remove leading/trailing whitespace
split(str, sep) Split string into array
join(array, sep) Join array into string
replace(str, old, new) Replace all occurrences
contains(str, substr) Check if string contains substring
startsWith(str, prefix) Check if string starts with prefix
endsWith(str, suffix) Check if string ends with suffix
toLowerCase(str) Convert to lowercase
toUpperCase(str) Convert to uppercase
match(str, regex) Test if string matches regex
length(str) Get string/array length
isEmpty(str) Check if string is empty
Output Functions:
log_info(message) Log informational message
log_warning(message) Log warning message
log_error(message) Log error message
printf(message) Print to stdout
cat_file(path) Print file contents
Control Functions:
exit(code) Exit with code (0=success)
JSON Functions:
jq(json, query) Query JSON with jq syntax
HTTP Functions:
http_get(url) Make GET request
http_post(url, body) Make POST request
http_request(method, url, headers, body) Custom HTTP request
Database Functions:
db_select_assets(workspace, format)
db_select_assets_filtered(workspace, where, format)
db_select_vulnerabilities(workspace, format)
db_select_vulnerabilities_filtered(workspace, where, format)
db_select(table, where, format)
db_select_one(table, where)
db_delete(table, where)
Markdown Functions:
render_markdown_report(template, data)
convert_jsonl_to_markdown(path)
convert_csv_to_markdown(path)