hardis:config:monitoring-defaults
Description
Returns the hardcoded default monitoring and notification configuration baked into sfdx-hardis.
Command Behavior
Exposes the built-in defaults consumed by hardis:org:monitor:all so configuration UIs (e.g. the VS Code sfdx-hardis extension) can build configuration screens without duplicating the data.
The payload contains two independent lists plus shared metadata:
monitoringCommands[]-- one entry per scheduled command inmonitor:all. Each entry has a translatedtitleanddescription, acategoryforeign key, aniconstring (SLDS, e.g.utility:dashboard), acolorClassstring (CSS class hint for UI badge theming, inherited from the first emitted notification type), the defaultfrequency/ scheduling fields, and anotificationTypesarray of notification type keys the command can emit (a single command can emit multiple types, e.g.APEX_FLOW_ERRORSemits bothAPEX_ERRORandFLOW_ERROR). Routing thresholds are NOT carried here -- they live onnotificationConfig[].notificationConfig[]-- one entry per notification type sfdx-hardis can emit (whether or not a scheduled command emits it). Each entry has a translatedtitleanddescription, acategoryforeign key, aniconstring (SLDS, e.g.utility:dashboard), acolorClassstring (CSS class hint for UI badge theming, set per notification type), the default per-channel severity thresholds (messaging,email,api), and anavailableThresholdsarray listing the only thresholds that can actually fire for this type (sorted from most restrictive to least restrictive, terminated byoff). Configuration UIs should drive their per-channel threshold selectors from this per-typeavailableThresholdslist rather than from the globaloptions.thresholds-- any value outside the list is implicitly equivalent to one that is. This is the single source of truth for notification routing.categories[]-- the seven categories used to group both lists in configuration UIs (orgActivity,apexTestsSecurity,userActivity,technicalDebt,orgInfo,licensesPackages,other), each with a translatedtitle,description, a stableorder, anicon(SLDS, e.g.utility:refresh) for the category section header, and acolorClass(CSS class hint for theming the section).options-- the lists the UI can use to populate dropdowns: supported frequencies, weekdays, severity thresholds, and channel names.
This command is read-only, requires no Salesforce org, and produces no notifications. It does not read .sfdx-hardis.yml -- callers are expected to read the user configuration file directly and merge monitoringCommands: onto the defaults' monitoringCommands[] and notificationConfig: onto the defaults' notificationConfig[], both by key.
Agent Mode
Supports non-interactive execution with --agent:
sf hardis:config:monitoring-defaults --agent --json
In agent mode, the command behaves identically (no interactive prompts exist) and is intended to be paired with --json for programmatic consumption.
Technical explanations
The data is assembled in getMonitoringConfigDefaults() (src/common/monitoring/monitoringDefaults.ts):
- Each entry in
monitoringCommandsDefaultbecomes amonitoringCommands[]entry. Its category and icon are inherited from the first notification type it emits (vianotificationTypesDefaultinsrc/common/notifProvider/types.ts), unless the command entry declares its owncategory/icon(used by aggregate commands likeAPEX_FLOW_ERRORS). - Every key in
notificationTypesDefaultbecomes anotificationConfig[]entry.notificationTypesDefaultis the single source of truth for per-type metadata -- it carriescategory,icon(SLDS),emittedSeverities(which drives theavailableThresholdsarray), anddefaults(per-channel routing thresholds). When a channel is missing from a type'sdefaultsblock, fallbacks ofmessaging: info,email: info,api: logapply. Defaults are clamped throughclampThresholdToAvailable()so the payload never reports a threshold a channel cannot honour at runtime. - Titles and descriptions are resolved via
t()using keys namednotifTypeTitle<PascalCaseKey>/notifTypeDesc<PascalCaseKey>for both lists andnotifCategoryTitle<PascalCaseKey>/notifCategoryDesc<PascalCaseKey>for categories. The active language is governed by theSFDX_HARDIS_LANGenvironment variable.
Parameters
| Name | Type | Description | Default | Required | Options |
|---|---|---|---|---|---|
| agent | boolean | Run in non-interactive mode for agents and automation | |||
| debug -d |
boolean | Activate debug mode (more logs) | |||
| flags-dir | option | undefined | |||
| json | boolean | Format output as json. | |||
| skipauth | boolean | Skip authentication check when a default username is required | |||
| websocket | option | Websocket host:port for VsCode SFDX Hardis UI integration |
Examples
$ sf hardis:config:monitoring-defaults --json
$ sf hardis:config:monitoring-defaults --agent --json