Skip to content

SkyState CLI Reference

The SkyState CLI (skystate) lets you manage remote config, projects, and account settings directly from your terminal.

Installation

Install globally via npm:

sh
npm install -g @skystate/cli

Global Options

These options are accepted by every command:

OptionDescription
--format <format>Output format: table (default), json, or plain
--quietSuppress informational output
--verbosePrint HTTP request/response debug info to stderr
--api-url <url>Override the API base URL for this invocation
-v, --versionPrint the CLI version and exit
-h, --helpPrint help for any command

Output Formats

--format affects list and detail output commands (e.g., project list, status):

  • table — human-readable aligned table (default)
  • json — machine-readable JSON to stdout; suitable for scripting
  • plain — space-separated values with no formatting

--format can also be set persistently via skystate config set format <value>.

Verbose Mode

--verbose logs curl-style request/response details to stderr. Auth tokens are redacted automatically. Use this when diagnosing API issues.

Config File Locations

The CLI uses two tiers of configuration:

Global CLI config

Stored at ~/.config/skystate/config.json (or $XDG_CONFIG_HOME/skystate/config.json). Managed with skystate config set/get/unset/list.

Valid keys:

KeyDefaultEnv Var OverrideDescription
api_urlhttps://api.skystate.ioSKYSTATE_API_URLAPI base URL
default_project(empty)Fallback project slug when not in a repo
default_env(empty)Fallback environment slug
formattableDefault output format

Credentials file

Stored at ~/.config/skystate/credentials.json. Written by skystate login. Contains the JWT bearer token. File permissions are set to 0600 on creation.

Repo-local config

Stored at ./skystate.json in the repository root. Written by skystate init. Contains the project_slug field that links this repo to a SkyState project. Commit this file.

.env file

The init command writes SKYSTATE_DEV_KEY=<key> into ./.env at the repo root. Do not commit this file. The init command offers to add .env to .gitignore automatically.

Environment Variables

VariablePurpose
SKYSTATE_TOKENAuth token; takes priority over the credentials file
SKYSTATE_API_URLAPI base URL; takes priority over the config file api_url key
SKYSTATE_PROJECTProject slug; takes priority over skystate.json and default_project

Token Resolution Order

  1. SKYSTATE_TOKEN environment variable
  2. ~/.config/skystate/credentials.json (written by skystate login)

Project Slug Resolution Order

  1. SKYSTATE_PROJECT environment variable
  2. project_slug in ./skystate.json (repo-local, set by skystate init)
  3. default_project in the global config file (legacy fallback)

Exit Codes

CodeMeaning
0Success
1General error (validation, unexpected API error)
2Authentication error — run skystate login
78Limit exceeded (plan project or request limit reached)
79Rate limited — monthly API request limit exceeded
80Service unavailable — API returned 503

When a network error occurs, the CLI automatically performs a /health diagnostic and prints an additional message to stderr explaining whether the API is reachable.

Commands

Config workflow

CommandDescription
skystate initLink this repository to a SkyState project
skystate pushPush a config file to a remote environment
skystate showDisplay the remote config for an environment
skystate diffCompare configs between two environments
skystate promoteCopy config changes from one environment to another

Project management

CommandDescription
skystate project listList all projects
skystate project createCreate a new project
skystate project showShow project details
skystate project deleteDelete a project

Auth

CommandDescription
skystate loginAuthenticate via GitHub OAuth
skystate logoutClear stored credentials
skystate statusShow account and usage overview
skystate billingOpen the billing page

CLI configuration

CommandDescription
skystate config setSet a global config value
skystate config getGet a global config value
skystate config listList all config values and their sources
skystate config unsetRemove a config value (reverts to default)
skystate config pathPrint the config file path

Typical Workflow

sh
# 1. Authenticate
skystate login

# 2. Link your repository
cd my-project
skystate init

# 3. Push config to development
skystate push config.json --env development

# 4. Inspect the deployed config
skystate show --env development

# 5. Compare environments
skystate diff --from development --to staging

# 6. Promote changes to staging
skystate promote --from development --to staging

Built with VitePress