Skip to content

hardis:project:generate:flow-git-diff

Description

Generate Flow Visual Git Diff markdown between 2 commits, or between 2 branches

--commit-before and --commit-after accept a commit hash or a branch name (ex: origin/main), and the interactive prompts list the branches after the commits of the Flow.

Note: This command might requires @mermaid-js/mermaid-cli to be installed.

Run npm install @mermaid-js/mermaid-cli --global

Agent Mode

Supports non-interactive execution with --agent:

sf hardis:project:generate:flow-git-diff --agent --flow "force-app/main/default/flows/MyFlow.flow-meta.xml" --commit-before abc123 --commit-after def456

In agent mode:

  • All interactive prompts for flow selection, commit-before, and commit-after are skipped.
  • --flow, --commit-before, and --commit-after flags must be provided.

Screenshots

Pick the Flow to compare

Pick the Flow to compare

Pick the state before the change, a commit or a branch

Pick the state before the change, a commit or a branch

The visual diff of the Installation_Crew_Warning Flow between main and the User Story branch, opened in VS Code

The visual diff of the Installation_Crew_Warning Flow between main and the User Story branch, opened in VS Code

Parameters

Name Type Description Default Required Options
agent boolean Run in non-interactive mode for agents and automation
commit-after option Commit hash or branch name (ex: origin/integration) of the new flow state (will be prompted if not set)
commit-before option Commit hash or branch name (ex: origin/main) of the previous flow state, or "allStates" (will be prompted if not set)
debug
-d
boolean Activate debug mode (more logs)
flags-dir option Import flag values from a directory.
flow option Path to flow file (will be prompted if not set)
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:project:generate:flow-git-diff
$ sf hardis:project:generate:flow-git-diff --flow "force-app/main/default/flows/Opportunity_AfterUpdate_Cloudity.flow-meta.xml" --commit-before 8bd290e914c9dbdde859dad7e3c399776160d704 --commit-after e0835251bef6e400fb91e42f3a31022f37840f65
$ sf hardis:project:generate:flow-git-diff --agent --flow "force-app/main/default/flows/MyFlow.flow-meta.xml" --commit-before abc123 --commit-after def456
$ sf hardis:project:generate:flow-git-diff --flow "force-app/main/default/flows/MyFlow.flow-meta.xml" --commit-before origin/main --commit-after origin/integration

Comments