docs/config-output.md
Kubescape can now render cached configuration values in multiple output formats so operators can inspect the active configuration in the format that best fits their workflow.
The configuration view command previously printed the cached JSON payload directly. That worked for machine-oriented use cases, but it was harder to inspect interactively when you wanted a quick summary or a YAML-friendly representation.
The new output support adds:
The command accepts the following values with the --output flag:
text (default): a compact, human-readable block of key: value entriesjson: a JSON object with the current config fieldsyaml: a YAML mapping with the current config fieldskubescape config view
Example output:
accountID: 1234567890
cloudAPIURL: https://api.example.com
cloudReportURL: https://report.example.com
kubescape config view -o json
Example output:
{
"accountID": "1234567890",
"cloudAPIURL": "https://api.example.com",
"cloudReportURL": "https://report.example.com"
}
kubescape config view -o yaml
Example output:
accountID: 1234567890
cloudAPIURL: https://api.example.com
cloudReportURL: https://report.example.com
If you want the output to preserve the full field structure, including empty values, use the --include-empty flag.
kubescape config view -o json --include-empty
Example output:
{
"accessKey": "",
"accountID": "1234567890",
"clusterName": "",
"cloudAPIURL": "https://api.example.com",
"cloudReportURL": "https://report.example.com"
}
kubescape config view [--output text|json|yaml] [--include-empty]
-o, --output: select the rendering format-e, --include-empty: include empty values in the rendered payloadThis output formatting is helpful when you want to:
When an account ID appears to be missing, you can render the config in a structured format and compare the values across environments.
kubescape config view -o yaml
You can use JSON output to build scripts that validate that required configuration keys are present before a scan starts.
kubescape config view -o json | jq '.accountID'
The text output is ideal for quick human inspection in CI logs or local development shells.
kubescape config view
--include-empty is specified.A common workflow looks like this:
kubescape config view -o json
kubescape config set accountID <your-account-id>
kubescape config view -o yaml
This sequence lets you verify the current configuration, update it, and then render the result in a structure that is easier to reason about.
The enhanced configuration view output gives you more flexibility without changing the underlying cached configuration model. Whether you prefer a terminal-friendly text layout or structured JSON or YAML, the command now supports your preferred workflow.