OpenForm
CLICommands

diff

Last updated on

Compare two artifacts

Shows differences between two artifact files.

Usage

ofm diff <file1> <file2> [options]

Arguments

ArgumentDescription
file1First artifact file to compare
file2Second artifact file to compare

Options

OptionDescription
--name-onlyShow only if files differ (no content diff)

Description

The diff command compares two artifact files and displays the differences in unified diff format. It attempts to parse both files as artifacts to show artifact names in the output.

Examples

Compare two files:

ofm diff form-v1.yaml form-v2.yaml

Check if files differ:

ofm diff form-v1.yaml form-v2.yaml --name-only

Output

When files differ:

--- lease-agreement (form)
+++ lease-agreement (form)

@@ -5,7 +5,7 @@
 version: 1.0.0
 title: Residential Lease Agreement
 fields:
-  monthlyRent:
+  rentAmount:
     type: money
     label: Monthly Rent
     required: true

When files are identical:

Files are identical

With --name-only:

Files differ

See also

  • apply - Apply a patch file
  • show - Display artifact content

On this page