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
| Argument | Description |
|---|---|
<file> | Path to a JSON file to push. Use - to read from stdin. |
Options
| Option | Description |
|---|---|
--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). |
--major | Mark this version as a major milestone for retention purposes. Does not affect the semver increment. |
--yes | Skip 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 type | Bump |
|---|---|
| Any key removed, or a key's type changed (e.g., string → number) | major |
| Any new key added | minor |
| Only values changed (same keys, same types) | patch |
| No changes detected | patch |
Environment aliases
| Alias | Full name |
|---|---|
dev | development |
stg | staging |
prod | production |
Examples
# 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 jsonOutput (default)
Pushed config to my-app/development
1.0.0 -> 1.1.0First push (no previous version):
Pushed config to my-app/development
1.0.0Output (JSON format, --format 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):
{
"featureFlags": {
"darkMode": true,
"newCheckout": false
},
"limits": {
"maxRetries": 3
}
}Errors
| Situation | Exit Code | Message |
|---|---|---|
--env not specified | 1 | Error: No environment specified. with hint Use --env <slug> |
| Invalid environment | 1 | Error: Invalid environment "xyz". Must be one of: dev, stg, prod (or development, staging, production) |
Invalid --bump value | 1 | Error: Invalid bump type "xyz". Must be one of: major, minor, patch |
| File not found | 1 | Error: File not found: config.json |
| Invalid JSON | 1 | Error: Invalid JSON: <parser message> |
| Config is an array or primitive | 1 | Error: Config must be a JSON object, not an array or primitive. |
| No project linked | 1 | Error: No project linked. with hint Run: skystate init |
| Not authenticated | 2 | Not authenticated. Run: skystate login |
| Plan limit exceeded | 78 | Error: Limit exceeded |
| Rate limited | 79 | Error: Rate limit exceeded |
| Network error | 1 | Error: Network error -- check your connection and try again |
Troubleshooting
- "No project linked" — run
skystate initfirst to link this repository to a project. - Unexpected bump type — use
--bumpto override the auto-detected type. - First push is always
1.0.0regardless of--bump.
Dashboard equivalent
Config can be pushed via the Remote Config tab in the dashboard at https://app.skystate.io.