Skip to content

sky state public promote

Promote public-state changes from one environment to another.

Synopsis

bash
sky state public promote --project <slug> --from <env> --to <env> [--yes] [--keys <keys>] [--dry-run] [--comment <message>] [--format <plain|json>]

Description

Compares the source and target public-state environments, shows the differences as a unified diff, and applies the selected changes to the target environment as a new version.

promote uses optimistic concurrency. The target version is read before the prompt or dry run. If the target changes before the patch is applied, the command reports a conflict.

You can authenticate with a developer bearer session from sky login or a project API key from SKYSTATE_API_KEY / .env.local.

Options

OptionDescription
--project <slug>Required. Project slug.
--from <env>Required. Source environment.
--to <env>Required. Target environment.
--yesApply all changes without prompting. Required in non-interactive mode unless --dry-run is used.
--keys <keys>Comma-separated list of top-level keys to promote.
--dry-runShow the diff without writing changes.
--comment <message>Commit message for the new version.
--format <format>plain (default) or json. JSON is available for dry runs.

Examples

bash
sky state public promote --project my-app --from development --to staging
sky state public promote --project my-app --from staging --to production --yes
sky state public promote --project my-app --from staging --to production --yes --comment "release v2"
sky state public promote --project my-app --from dev --to prod --dry-run
sky state public promote --project my-app --from dev --to staging --keys featureFlags,limits
sky state public promote --project my-app --from dev --to staging --dry-run --format json

Dry Run JSON Output

With --dry-run --format json, stdout is an envelope containing JSON Patch operations and the optional comment:

json
{
  "ops": [
    { "op": "replace", "path": "/featureFlags", "value": true }
  ],
  "comment": "release v2"
}

Non-Interactive Mode

In a non-TTY environment, pass --yes to apply or --dry-run to inspect. Running without either exits with Non-interactive mode requires --yes flag.