unifi diff
About 265 words
Show what apply would change.
Usage
unifi diff -f <file|directory|-> [flags]Compare the manifests in the given files, directories or standard input with the site and show what unifi apply would do, without changing anything: + objects it would create, ~ objects it would update with each differing field as old → new, and with --prune the - objects it would delete.
Exit codes: 0 when the site already matches, 2 when there are differences, 1 when the comparison failed. That makes drift detection a one-liner in CI.
--output wide also lists the objects that are in sync.
Examples
unifi diff -f network.yaml
unifi diff -f site/ --recursive --prune
unifi export | unifi diff -f - --context lake
unifi diff -f site/ -R || echo "the site has drifted"Flags
| Flag | Description |
|---|---|
-f, --filename <file> | manifest file or directory to read, repeatable; - reads standard input |
--force | accept fields that no object of a kind on the site has, instead of refusing them as typos |
--prune | also show the objects that apply --prune would delete |
-R, --recursive | also read the subdirectories of a directory |
Global flags
These flags are accepted by every command.
| Flag | Description |
|---|---|
--color-scheme <string> | color scheme: auto, dark or light |
--context <string> | context to use instead of the current one |
--no-cache | ask the controller for everything instead of using cached answers |
-o, --output <string> | output format: text, wide, json, yaml (table is another name for text) |
-s, --site <string> | site to act on instead of the context's default site |
--theme <string> | theme to render with instead of the configured one |
