CLI Commands

cnspec policy format

Apply style formatting to one or more policy bundle files.

Apply consistent style formatting to one or more policy bundle files. Use this to keep your policy files clean and readable, especially before committing them to version control.

cnspec policy format my-policy.mql.yaml

Format and sort the bundle alphabetically:

cnspec policy format my-policy.mql.yaml --sort

Options

  -h, --help   help for format
      --sort   Sort the bundle

Options inherited from parent commands

      --api-proxy string   Set the proxy for communications with Mondoo Platform API
      --auto-update        Enable automatic provider installation and update (default true)
      --config string      Set config file path (default $HOME/.config/mondoo/mondoo.yml)
      --log-level string   Set the log level: error, warn, info, debug, trace (default "info")
  -v, --verbose            Enable verbose output

SEE ALSO

On this page