CLI reference
Every warden command with its usage, flags and examples, generated from the oclif command metadata.
sf warden accesssf warden diffsf warden freezesf warden persona diffsf warden persona exportsf warden persona importsf warden provisionsf warden restoresf warden snapshotsf warden stripsf warden unfreeze
sf warden access
Audit active-user access for a permission target.
Usage
sf warden access [--json] [--flags-dir <value>] [-o <value>] [--type field|object|apex-class|vf-page|custom-permission|tab|record-type] [--target <value>] [--user <value>] [--sobject <value>] [--output human|csv|json] [--output-file <value>] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--sobject <value>
In reverse user mode, report field or object access scoped to this SObject.
--target <value>
Target API name. Use Object.Field for field, Object for object, Apex class name for apex-class, Visualforce page name for vf-page, custom permission DeveloperName for custom-permission, tab API name for tab, or SObject.DeveloperName for an active non-master record type.
--type <option>
Target type to audit: field, object, apex-class, vf-page, custom-permission, tab, or record-type.
Options: field · object · apex-class · vf-page · custom-permission · tab · record-type
--user <value>
Reverse audit for one user, using field:value matching (for example Username:alice@example.com).
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Resolves active users who have access to a target and attributes each access path to Profile, Permission Set, or Permission Set Group sources.
Examples
Field access in human output (default):
sf warden access --type field --target Account.CustomField__c --target-org myOrgObject access in csv output:
sf warden access --type object --target Account --target-org myOrg --output csvField access in json output:
sf warden access --type field --target Account.CustomField__c --target-org myOrg --output jsonApex class access in human output:
sf warden access --type apex-class --target MyController --target-org myOrgVisualforce page access in csv output:
sf warden access --type vf-page --target MyPage --target-org myOrg --output csvCustom permission access in json output:
sf warden access --type custom-permission --target Can_Edit_Accounts --target-org myOrg --output jsonTab visibility in human output:
sf warden access --type tab --target Account --target-org myOrgRecord type access in human output:
sf warden access --type record-type --target Account.Business_Account --target-org myOrgReverse field access for one user:
sf warden access --user 'Username:alice@example.com' --type field --target Account.CustomField__c --target-org myOrgReverse object access across an SObject:
sf warden access --user 'Username:alice@example.com' --type object --sobject Account --target-org myOrg --output jsonReverse record type access for one user:
sf warden access --user 'Username:alice@example.com' --type record-type --target Account.Business_Account --target-org myOrgSee code: src/commands/warden/access.ts
sf warden diff
Compare users against an intended definition or another user.
Usage
sf warden diff [--json] [--flags-dir <value>] [-o <value>] [--user <value>] [--against <value>] [--users-def <value>] [--personas-def <value>] [--external-id <value>] [--input-format json|csv] [--csv-list-delimiter <value>] [--output human|csv|json] [--output-file <value>] [--verbose] [--fail-on-drift] [--verify] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--against <value>
Reference user to compare against using field:value.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--csv-list-delimiter <value>
Delimiter for multi-value CSV cells such as personas. Defaults to semicolon.
--external-id <value>
Default User field used to match entries in --users-def.
--fail-on-drift
Exit with code 1 when any user has access drift.
--input-format <option>
Override users-def format detection: json or csv.
Options: json · csv
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--personas-def <value>
Optional path to persona definition JSON file. Omit it for profile-only diffing.
--user <value>
Target user to compare using field:value.
--users-def <value>
Path to a user definition JSON or CSV file.
--verbose
Include assignments that are already present in both sides in human output.
--verify
Check whether users conform to their intended definition.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Reports read-only drift across profile, role, permission sets, permission set groups, public groups, and queues without applying changes.
Examples
Compare users in a definition file against their personas:
sf warden diff --users-def config/user-def.json --personas-def config/persona-def.json --external-id FederationIdentifier --target-org myOrgCompare one user against another:
sf warden diff --user username:new@example.com --against username:template@example.com --target-org myOrg --output csvSee code: src/commands/warden/diff.ts
sf warden freeze
Freeze one or more users.
Usage
sf warden freeze [--json] [--flags-dir <value>] [-o <value>] [--user <value>] [--users-def <value>] [--external-id <value>] [--input-format json|csv] [--csv-list-delimiter <value>] [--output human|csv|json] [--output-file <value>] [--no-prompt] [--dry-run] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--csv-list-delimiter <value>
Delimiter for multi-value CSV cells such as personas. Defaults to semicolon.
--dry-run
Validate and plan actions without any write operations.
--external-id <value>
Default User field used to match entries in --users-def.
--input-format <option>
Override users-def format detection: json or csv.
Options: json · csv
--no-prompt
Skip confirmation prompts before write operations.
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--user <value>
Target a single user using field:value.
--users-def <value>
Path to a user definition JSON or CSV file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Freezes matching users by setting UserLogin.IsFrozen = true and leaving all other access untouched.
Examples
Preview a single freeze by field match:
sf warden freeze --user username:someone@example.com --dry-run --target-org myOrgFreeze users from a definition file without prompts:
sf warden freeze --users-def config/user-def.json --external-id FederationIdentifier --target-org myOrg --no-promptSee code: src/commands/warden/freeze.ts
sf warden persona diff
Compare a persona definitions file with org-defined personas.
Usage
sf warden persona diff --input <value> [--json] [--flags-dir <value>] [-o <value>] [--api-version <value>]Flags
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--input <value> · required
Persona definitions JSON file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Reports added, removed, and changed personas without writing to the org.
See code: src/commands/warden/persona/diff.ts
sf warden persona export
Export org-defined Warden personas to a JSON file.
Usage
sf warden persona export --output <value> [--json] [--flags-dir <value>] [-o <value>] [--api-version <value>]Flags
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--output <value> · required
Destination personas.json file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Reads active wdn_Persona__c records and their components and writes the canonical personas.json format.
See code: src/commands/warden/persona/export.ts
sf warden persona import
Import persona definitions into the connected org.
Usage
sf warden persona import --input <value> [--json] [--flags-dir <value>] [-o <value>] [--prune] [--dry-run] [--api-version <value>]Flags
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--dry-run
Validate and plan actions without any write operations.
--input <value> · required
Persona definitions JSON file.
--prune
Delete org components that are absent from the input file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Upserts personas by wdn_Api_Name__c and adds missing components. Use —prune to remove components absent from the input file, and —dry-run to see the changes without writing them.
See code: src/commands/warden/persona/import.ts
sf warden provision
Provision users from user and persona definition files.
Usage
sf warden provision [--json] [--flags-dir <value>] [-o <value>] [--users-def <value>] [--personas-def <value>] [--persona-source file|org] [--related-def <value>] [--external-id <value>] [--input-format json|csv] [--csv-list-delimiter <value>] [--fuzzy-username] [--no-prompt] [--dry-run] [--cleanup-on-failure] [--fail-on-insufficient-license] [--log-to-org] [--log-detail summary|full] [--output human|csv|json] [--output-file <value>] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--cleanup-on-failure
Delete related records created in this run for failed users, where safe.
Opt in to best-effort cleanup after provisioning fails. Deletes only related records created for that user in this run, in reverse phase order. Keeps matched or updated records and before records linked to a successfully saved User. Never deletes or reverts the User. Has no effect with —dry-run.
--csv-list-delimiter <value>
Delimiter for multi-value CSV cells such as personas. Defaults to semicolon.
--dry-run
Validate and plan actions without any write operations.
--external-id <value>
Filterable User field used to match existing users by default. --match-field is an alias. Per-user match overrides this for individual rows. If omitted, all entries are treated as inserts. Multiple matches are skipped.
--fail-on-insufficient-license
Fail after dry-run output when projected net-new users exceed user-license headroom.
--fuzzy-username
Match Username values with optional Salesforce sandbox suffixes.
--input-format <option>
Override users-def format detection: json or csv.
Options: json · csv
--log-detail <option>
Connected audit detail level: summary writes the Run header; full also writes one Item per provision output row.
Options: summary · full · Default: summary
--[no-]log-to-org
Write connected Warden ledger and optional reconciliation audit records when the package is installed.
--no-prompt
Skip warning confirmation prompts.
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--persona-source <option>
Persona definition source: file or org. Defaults to file when —personas-def is supplied, otherwise org when warden-base is installed in the org.
Options: file · org
--personas-def <value>
Optional path to persona definition JSON file. Omit it for profile-only provisioning.
--related-def <value>
Optional path to a related-record definition JSON file. Declares named relationships a user entry selects with a related array. Supports phase: "before" and "after", before-phase User linking, and per-user context sources; requires a JSON --users-def.
--users-def <value>
Path to a user definition JSON or CSV file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Provisions Salesforce users by merging multiple personas per user into an effective persona (unioning assignment lists, enforcing singular-value agreement), applying insert-only Username and Alias defaults, enforcing optional profile and role, activating and unfreezing users, and planning or applying assignment changes. --personas-def is optional for profile-only provisioning.
Matching accepts any filterable User field. A match with more than one result is skipped. Use --fuzzy-username for sandbox username suffixes, or set fuzzyUsername: true on an individual user; the per-user value overrides the global flag.
Examples
Dry run with explicit external id:
sf warden provision --users-def config/user-def.json --personas-def config/persona-def.json --external-id FederationIdentifier --target-org myOrg --dry-runDry run matching by another filterable User field:
sf warden provision --users-def config/user-def.json --personas-def config/persona-def.json --match-field LastName --target-org myOrg --dry-runApply provisioning with no prompt:
sf warden provision --users-def config/user-def.json --personas-def config/persona-def.json --target-org myOrg --no-promptMatch production usernames to sandbox-suffixed users:
sf warden provision --users-def config/user-def.json --personas-def config/persona-def.json --fuzzy-username --target-org mySandbox --dry-runSee code: src/commands/warden/provision.ts
sf warden restore
Restore user assignment state from a snapshot file.
Usage
sf warden restore [--json] [--flags-dir <value>] [-o <value>] [--snapshot <value>] [--output human|csv|json] [--output-file <value>] [--no-prompt] [--dry-run] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--dry-run
Validate and plan actions without any write operations.
--no-prompt
Skip confirmation prompts before write operations.
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--snapshot <value>
Path to a user snapshot JSON or CSV file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Re-resolves users by the snapshot match key, reactivates and unfreezes them, and adds missing assignments without removing existing access.
Examples
Preview a restore:
sf warden restore --snapshot snapshots/user.json --dry-run --target-org myOrgRestore without prompts:
sf warden restore --snapshot snapshots/user.json --target-org myOrg --no-promptSee code: src/commands/warden/restore.ts
sf warden snapshot
Capture user assignment state to a portable snapshot file.
Usage
sf warden snapshot [--json] [--flags-dir <value>] [-o <value>] [--user <value>] [--users-def <value>] [--external-id <value>] [--input-format json|csv] [--csv-list-delimiter <value>] [--output human|csv|json] [--output-file <value>] [--out <value>] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--csv-list-delimiter <value>
Delimiter for multi-value CSV cells such as personas. Defaults to semicolon.
--external-id <value>
Default User field used to match entries in --users-def.
--input-format <option>
Override users-def format detection: json or csv.
Options: json · csv
--out <value>
Path to write the snapshot JSON or CSV file. The extension selects the format.
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--user <value>
Target a single user using field:value.
--users-def <value>
Path to a user definition JSON or CSV file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Captures matching users’ active/frozen state and access assignments using developer/API names so the snapshot can be restored later.
Examples
Snapshot a single user:
sf warden snapshot --user username:someone@example.com --out snapshots/user.json --target-org myOrgSnapshot users from a definition file:
sf warden snapshot --users-def config/user-def.json --external-id FederationIdentifier --out snapshots/users.json --target-org myOrgSee code: src/commands/warden/snapshot.ts
sf warden strip
Strip users completely, or remove selected persona access.
Usage
sf warden strip [--json] [--flags-dir <value>] [-o <value>] [--user <value>] [--users-def <value>] [--external-id <value>] [--input-format json|csv] [--csv-list-delimiter <value>] [--no-prompt] [--dry-run] [--no-freeze] [--no-deactivate] [--persona <value>...] [--all-personas] [--personas-def <value>] [--persona-source file|org] [--freeze] [--deactivate] [--keep-permsets] [--keep-permset-groups] [--keep-licenses] [--keep-public-groups] [--keep-queues] [--snapshot <value>] [--output human|csv|json] [--output-file <value>] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--all-personas
Remove access granted by every active persona held by each user.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--csv-list-delimiter <value>
Delimiter for multi-value CSV cells such as personas. Defaults to semicolon.
--deactivate
Deactivate users in persona mode after planning access removal.
--dry-run
Validate and plan actions without any write operations.
--external-id <value>
Default User field used to match entries in --users-def.
--freeze
Freeze users in persona mode after planning access removal.
--input-format <option>
Override users-def format detection: json or csv.
Options: json · csv
--keep-licenses
Keep permission set license assignments.
--keep-permset-groups
Keep permission set group assignments.
--keep-permsets
Keep permission set assignments.
--keep-public-groups
Keep public group memberships.
--keep-queues
Keep queue memberships.
--no-deactivate
Skip the final deactivation step.
--no-freeze
Skip the initial freeze step.
--no-prompt
Skip confirmation prompts before write operations.
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--persona <value>...
Persona API name to remove. Repeat for multiple personas.
--persona-source <option>
Read persona definitions and held personas from a file or from warden-base in the org.
Options: file · org
--personas-def <value>
Path to the persona definitions JSON file when using --persona-source file.
--snapshot <value>
Write a portable user snapshot JSON or CSV file before stripping access, including during dry-run. The extension selects the format.
--user <value>
Target a single user using field:value.
--users-def <value>
Path to a user definition JSON or CSV file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Without persona flags, freezes matching users, removes access grants, and deactivates the user unless the corresponding opt-out flags are set.
With --persona or --all-personas, removes only persona-derived access. Shared grants remain, and freeze/deactivation are off unless --freeze or --deactivate is supplied.
Examples
Preview a strip for a single user:
sf warden strip --user username:someone@example.com --dry-run --target-org myOrgStrip users from a definition file without prompts:
sf warden strip --users-def config/user-def.json --external-id FederationIdentifier --target-org myOrg --no-promptKeep permission set licenses while stripping everything else:
sf warden strip --users-def config/user-def.json --keep-licenses --target-org myOrg --dry-runCapture a restorable snapshot before stripping:
sf warden strip --user username:someone@example.com --snapshot snapshots/user.json --target-org myOrg --no-promptPreview removal of one persona without freezing or deactivating the user:
sf warden strip --user username:someone@example.com --persona support --persona-source org --dry-run --target-org myOrgRemove every active persona and then freeze the user:
sf warden strip --user username:someone@example.com --all-personas --persona-source org --freeze --target-org myOrg --no-promptSee code: src/commands/warden/strip.ts
sf warden unfreeze
Unfreeze one or more users.
Usage
sf warden unfreeze [--json] [--flags-dir <value>] [-o <value>] [--user <value>] [--users-def <value>] [--external-id <value>] [--input-format json|csv] [--csv-list-delimiter <value>] [--output human|csv|json] [--output-file <value>] [--no-prompt] [--dry-run] [--api-version <value>] [-i]Flags
-i, --interactive
Prompt for missing command values, summarize them, and confirm before continuing.
-o, --target-org <value>
Target org username or alias.
--api-version <value>
Salesforce API version to use, for example 62.0.
Override the api version used for api requests made by this command
--csv-list-delimiter <value>
Delimiter for multi-value CSV cells such as personas. Defaults to semicolon.
--dry-run
Validate and plan actions without any write operations.
--external-id <value>
Default User field used to match entries in --users-def.
--input-format <option>
Override users-def format detection: json or csv.
Options: json · csv
--no-prompt
Skip confirmation prompts before write operations.
--output <option>
Output format: human, csv, or json.
Options: human · csv · json · Default: human
--output-file <value>
Write the machine-readable output payload to this path.
--user <value>
Target a single user using field:value.
--users-def <value>
Path to a user definition JSON or CSV file.
Global flags
--flags-dir <value>
Import flag values from a directory.
--json
Format output as json.
Description
Unfreezes matching users by setting UserLogin.IsFrozen = false and leaving all other access untouched.
Examples
Preview a single unfreeze by field match:
sf warden unfreeze --user username:someone@example.com --dry-run --target-org myOrgUnfreeze users from a definition file without prompts:
sf warden unfreeze --users-def config/user-def.json --external-id FederationIdentifier --target-org myOrg --no-promptSee code: src/commands/warden/unfreeze.ts