Output contract
Output contract
All eight operational warden commands accept --output human|csv|json and
--output-file <path>. Human output is the default. The generated flag
reference is in the README.
Formats and destinations
Use --output csv or --output json to write the selected machine-readable
payload to stdout. Add --output-file <path> to write that payload to a file;
the command keeps its normal human-readable progress, warning, and
confirmation behavior on the console. --output-file has no effect with the
default human format unless global --json is also enabled.
The global Salesforce CLI --json flag is separate from warden’s
--output json format:
--jsonalone writes the Salesforce CLI{status,result,warnings}envelope to stdout and suppresses interactive confirmation prompts.--json --output csv --output-file <path>or--json --output json --output-file <path>writes the selected warden payload to the file while the global envelope remains on stdout.--json --output-file <path>without a non-human--outputwrites the global envelope to both stdout and the file.- Combining
--jsonwith--output csvor--output jsonwithout--output-fileis an error.
Direct machine output does not suppress mutating-command confirmations. Use
global --json when a non-interactive run is required.
Exit codes
Commands return 0 when they complete without per-user failures. The
provisioning and lifecycle commands return 1 when one or more users fail.
access has no per-row failure state and returns 0 unless the command
itself cannot run. diff returns 1 for per-user failures and also supports
--fail-on-drift, which returns 1 when any user has drift; the flag is off
by default. diff --verify returns 1 when any user is non-conformant and
uses process.exitCode = 1 after rendering its verdicts.
These signals do not change the result payload. With global --json, a
partial failure or non-conformant verify result therefore keeps status: 0
in the Salesforce CLI envelope while the process exits with code 1; verify
mode’s result remains the full verdict array. Command errors use oclif’s exit
code 1 as well.
CSV shape
CSV rows are deterministic across runs and use one shared escaping and serialization rule.
accessretains its first eight columns (userId,userName,username,assignmentType,sourceId,sourceName,viaPermissionSetId, andviaPermissionSetName) and addstargetType,targetName,sourceApiName, andsourceLabel, followed by target-specific access columns.diffappendsuserName,username,valueApiName,valueLabel,valueType, valueBefore,valueAfterafter its existing six columns.diff --verifyinstead useskey,conformant,violations.provisionemits one row per action, related-record result, or error withuserKey,userId,userName,username,personas,matchedBy,status,action,detail,error. Related rows retain these same ten columns:actionisrelated,detailis<relationship> <phase> <sobject> <related-action>, anderrorcontains a related-record failure when applicable. Provision JSON keeps user actions unchanged and addsusers[].relatedRecords[]for selected relationships. Each entry containsrelationship,phase,sobject,action,status, and, when available,recordId,detail, anderror. Dry-run actions usewouldCreate,wouldUpdate, orwouldSkip; an unchanged matched row ismatched. Live actions usecreated,updated,matched, orskipped. Provision JSON also carriesusers[].matchValue, the value looked up undermatchedBy(nullwhen no lookup was issued under it, because the value was absent, empty, or not a string), andusers[].matched, whether an existing user was actually found.matchedByreports only that a match field was configured, so it is not a substitute formatchedon a net-new user. Provision human output composes the same two fields intomatched <field> = <value>orunmatched <field> = <value>, and bareunmatchedwhen no match field was configured. The CSV columns are unchanged and still carrymatchedByonly.freezeandunfreezeemit one row per user withuserKey,userId,userName,username,wasFrozen,status,action,error.restoreemits one row per action or action item withuserKey,userId,userName,username,status,action,category,name,error.stripemits one row per action or removed item withuserKey,userId,userName,username,status,action,category,itemId,itemApiName,error.snapshotemitskey,id,status,actions,skipped,warnings,errors, one row per selected user. This report CSV is separate from the JSON or CSV snapshot artifact written with--out.
For lifecycle commands, users with no actions still produce one row and each
error produces its own row. Formula-like cells are prefixed with an apostrophe
on CSV write (=, +, -, @, tab, and carriage return); this is an output
safety measure for spreadsheet viewers and is not applied to JSON or human
output.
Access statistics and warnings remain outside CSV stdout when CSV is written directly to stdout. When CSV is written to a file, the file contains only the CSV payload.