Skip to content

Compile and pin a Policy Pack.

Usage

rootform compile policy-pack <directory> [options]
SHELL

Options

FlagTypeDefaultDescription
-o, --outputstring""write compiled Policy Pack to file (required)
--semanticsstring""read semantics from a saved Form file (required)

Global options

FlagTypeDefaultDescription
-h, --helpboolfalseshow how to use rootform compile policy-pack
--colormodeautocolor human output: auto|always|never; default: auto
--no-pagerboolfalseprint a long report in full instead of opening it in less

Behavior

Compile one Policy Pack source directory using the semantics of the saved Form in --semantics, and write the compiled JSON file to --output. The compiled Policy Pack keeps its semantic pins for later offline evaluation without the Dialect sources that produced the Form.

The summary goes to standard output. Diagnostics go to standard error.

Exit status

StatusDescription
0the compiled Policy Pack was written
1the Policy Pack or Form is invalid
2the command was used incorrectly
4a source could not be read or the output could not be written

Examples

# Compile the baseline Policy Pack for offline checks using a saved plan Form
rootform compile policy-pack ./policies \
--semantics plan-form.json -o baseline.json
# Compile a separate production Pack using its saved state Form
rootform compile policy-pack ./policies/production \
--semantics state-form.json -o production.json
Shell