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.
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. Accepts development, staging, production, or aliases dev, stg, prod. |
--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 jsonExit Codes
| Code | Meaning |
|---|---|
0 | No differences |
1 | Error |
3 | Differences found |
JSON Output
With --format json, stdout is an array of diff hunks:
json
[
{
"key": "featureFlags",
"type": "replace",
"sourceValue": { "darkMode": true },
"targetValue": { "darkMode": false }
}
]