sfdx-hardis Integration
sfdx-hardis is an open-source sfdx plugin that wraps org monitoring, deploy validation, and simpler CLI ergonomics. It includes prebuilt GitHub Actions / GitLab CI templates, a daily monitoring job that diffs metadata, and a 'smart deploy' flow.
When to Use
Teams without Copado / Gearset budget who want a battle-tested open-source stack. Not for teams already deeply invested in DevOps Center.
Typical trigger phrases that should route to this skill: sfdx hardis setup, salesforce monitoring open source, cicd for salesforce free, hardis commands.
Recommended Workflow
sf plugins install sfdx-hardison CI agents and developer machines.- Run
sf hardis:project:configure:authto wire JWT credentials per environment. - Adopt the provided CI template (GitHub / GitLab / Azure) — it handles validation, deploy, and rollback hints.
- Enable
sf hardis:org:monitor:allas a daily scheduled job to diff metadata and flag drift. - Use
sf hardis:work:newinstead ofsf org create scratchfor guided dev workflow.
Key Considerations
- OSS — no vendor support SLA; community Discord is active.
- Opinionated; layering heavy customization fights the tool.
- Monitoring output is JSON + HTML; wire HTML to GitHub Pages for discoverability.
- Upgrades can be breaking; pin plugin version in CI.
Worked Examples (see references/examples.md)
- Daily drift monitor — Detect manual prod changes
- Smart deploy — Reduce deploy failures
Common Gotchas (see references/gotchas.md)
- Plugin version drift — CI and local produce different output.
- Long monitor run — Daily job exceeds 2h.
- False-positive drift — Noise alerts.
Top LLM Anti-Patterns (full list in references/llm-anti-patterns.md)
- Running hardis without pinning version
- Ignoring monitor alerts
- Forking hardis to add custom logic (contribute upstream instead)
Official Sources Used
- Salesforce DX Developer Guide — https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/
- Unlocked Packaging — https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp.htm
- SF CLI — https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
- DevOps Center — https://help.salesforce.com/s/articleView?id=sf.devops_center_overview.htm
- Scratch Org Snapshots — https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_snapshots.htm
- sfdx-hardis — https://sfdx-hardis.cloudity.com/