Skip to content

skystate push

Push a new config version from a file or stdin.

Synopsis

skystate push <file> --env <slug> [--bump <type>] [--comment <message>] [--major] [--yes]

Description

Reads a JSON config file (or stdin), determines the new version number, and uploads it to the specified environment. The repo must already be linked via skystate init.

Config is stored and versioned using semantic versioning (major.minor.patch). The first push to an environment always creates version 1.0.0.

Arguments

ArgumentDescription
<file>Path to a JSON file to push. Use - to read from stdin.

Options

OptionDescription
--env <slug>(Required) Target environment. Accepts development, staging, production, or aliases dev, stg, prod.
--bump <type>Version bump type: major, minor, or patch. If omitted, the bump type is auto-detected from the diff.
--comment <message>Optional message stored with this version (like a commit message).
--majorMark this version as a major milestone for retention purposes. Does not affect the semver increment.
--yesSkip confirmation prompts (currently no prompts are shown; included for scripting consistency).

Global options (--format, --quiet, --verbose, --api-url) are also accepted. See global options.

Auto-detected version bumping

When --bump is not specified, the CLI compares the new config against the current version and chooses the bump type automatically:

Change typeBump
Any key removed, or a key's type changed (e.g., string → number)major
Any new key addedminor
Only values changed (same keys, same types)patch
No changes detectedpatch

Environment aliases

AliasFull name
devdevelopment
stgstaging
prodproduction

Examples

sh
# Push config.json to development (auto-detect bump)
skystate push config.json --env development

# Push to staging with an explicit minor bump
skystate push config.json --env staging --bump minor

# Push from stdin
cat config.json | skystate push - --env production

# Push with a comment and mark as a major milestone
skystate push config.json --env production --comment "Release 2.0" --major

# Pipe jq output directly
jq '.production' all-envs.json | skystate push - --env production

# JSON output for scripting
skystate push config.json --env development --format json

Output (default)

Pushed config to my-app/development
  1.0.0 -> 1.1.0

First push (no previous version):

Pushed config to my-app/development
  1.0.0

Output (JSON format, --format json)

json
{
  "remoteConfigId": "cfg_abc123",
  "version": "1.1.0",
  "isMajor": false
}

Config requirements

The file must contain a valid JSON object (not an array or primitive):

json
{
  "featureFlags": {
    "darkMode": true,
    "newCheckout": false
  },
  "limits": {
    "maxRetries": 3
  }
}

Errors

SituationExit CodeMessage
--env not specified1Error: No environment specified. with hint Use --env <slug>
Invalid environment1Error: Invalid environment "xyz". Must be one of: dev, stg, prod (or development, staging, production)
Invalid --bump value1Error: Invalid bump type "xyz". Must be one of: major, minor, patch
File not found1Error: File not found: config.json
Invalid JSON1Error: Invalid JSON: <parser message>
Config is an array or primitive1Error: Config must be a JSON object, not an array or primitive.
No project linked1Error: No project linked. with hint Run: skystate init
Not authenticated2Not authenticated. Run: skystate login
Plan limit exceeded78Error: Limit exceeded
Rate limited79Error: Rate limit exceeded
Network error1Error: Network error -- check your connection and try again

Troubleshooting

  • "No project linked" — run skystate init first to link this repository to a project.
  • Unexpected bump type — use --bump to override the auto-detected type.
  • First push is always 1.0.0 regardless of --bump.

Dashboard equivalent

Config can be pushed via the Remote Config tab in the dashboard at https://app.skystate.io.

Built with VitePress