sky state public diff
Show public-state differences between two environments.
Synopsis
bash
sky state public diff --project <slug> --from <env> --to <env> [--keys <keys>] [--format <plain|json>]Description
Compares the latest public-state documents for two environments in one project. If no differences are found, the command exits 0. If differences are found, it prints the diff and sets exit code 3 (see exit codes).
The target environment can be empty; the source environment must have state.
Options
| Option | Description |
|---|---|
--project <slug> | Required. Project slug. |
--from <env> | Required. Source environment. See Environments. |
--to <env> | Required. Target environment. Accepts the same values as --from. |
--keys <keys> | Comma-separated list of top-level keys to compare. |
--format <format> | plain (default) or json. |
Examples
bash
sky state public diff --project my-app --from development --to staging
sky state public diff --project my-app --from dev --to prod
sky state public diff --project my-app --from dev --to prod --keys featureFlags,limits
sky state public diff --project my-app --from dev --to staging --format jsonJSON Output
With --format json, stdout is an array of diff hunks:
json
[
{
"key": "featureFlags",
"type": "replace",
"sourceValue": { "darkMode": true },
"targetValue": { "darkMode": false }
}
]