rpk ai policy format
Format a draft using PermissionService, preserving comments. Requires an environment and authentication. Source is limited to 64 KiB of UTF-8. Default output is formatted Cedar on stdout; JSON/YAML/markdown output includes the full result and schema version. Invalid syntax fails without writing formatted source. Schema validation findings in the result do not prevent formatting; use analyze to require valid schema usage. Input files and stored policies are never modified. Redirect to a different file, not the input file.
| This command was introduced in ai version 0.2.94. |
Examples
This section provides examples of how to use rpk ai policy format.
rpk ai policy format --cedar-file draft.cedar > formatted.cedar
cat draft.cedar | rpk ai policy format --cedar-file=-
rpk ai policy format --cedar-file draft.cedar -o json
Flags
| Value | Type | Description |
|---|---|---|
|
string |
inline Cedar policy text. Mutually exclusive with |
|
string |
Cedar input file, or - for stdin. Never overwritten. Mutually exclusive with |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |