Skip to content

SkyState CLI Reference ​

The SkyState CLI (sky) manages developer login, projects, public state, project API keys, end-user auth settings, account terms, examples, and local CLI configuration. See what public state is for and what not to store.

Installation ​

bash
npm install -g skystate

This provides both the sky and skystate binaries. View the package on npm.

Global Options ​

These options are accepted on every command. --format only changes output where a command documents it; other commands ignore it.

OptionDescription
--format <format>Output format: table, json, or plain. Some commands support only a subset.
--quietSuppress informational output.
--verbosePrint HTTP request/response debug info to stderr.
--api-url <url>Override the API base URL for this invocation. Hidden from normal help.
--auth-url <url>Override the hosted auth URL for this invocation. Hidden from normal help.
-v, --versionPrint the CLI version and exit.
-h, --helpPrint help for any command.

Auth Resolution ​

sky login stores a developer session locally.

Public-state commands (sky state public show, push, edit, diff, promote, patch, remove, and sky provision) accept a project API key. When a key is present it is used; otherwise the developer session is used. Provide a key with the SKYSTATE_API_KEY environment variable, or keep one in a .env.local file in the directory you run sky from; SKYSTATE_API_KEY takes precedence. Everything else (projects, user state, API key management, hosted auth settings, and account terms) uses the developer session only; sky status reports both credentials. --project <slug> selects the project for all of these commands.

Environments ​

Commands that read or write public state or user state accept --env <slug>. <slug> is the full name (development, staging, production) or the alias (dev, stg, prod). See Environments for what an environment is and how they relate to each other.

When --env is omitted, it resolves in this order: the SKYSTATE_ENV environment variable, then default_env from CLI config.

Command Tree ​

CommandPurpose
sky loginStart the hosted developer login flow
sky logoutClear the local developer session
sky termsView current Terms of Service acceptance
sky terms acceptAccept the current Terms of Service
sky onboardingInteractive project and starter-snippet wizard
sky statusShow account, API key, project, and usage status
sky projectList, create, show, and delete projects
sky project keysCreate, list, and revoke project API keys
sky project authManage end-user auth settings and callback URLs
sky state public showRead the latest public state for an environment
sky state public pushReplace public state with JSON from a file, inline string, or stdin
sky state public editEdit public state in $VISUAL or $EDITOR
sky state public diffDiff public state between two environments
sky state public promotePromote public-state changes from one environment to another
sky state public patchPatch a single public-state path or replace the root object
sky state public removeRemove one public-state path idempotently
sky provisionAdd public-state keys discovered by scanning source code
sky state userList, show, and delete end-user state as a developer
sky examplesPrint stack-specific snippets
sky configManage global CLI settings

Output Formats ​

--format affects list and detail output commands such as project list and status:

  • table - human-readable aligned table
  • json - machine-readable JSON to stdout
  • plain - tab-separated or compact output where supported

Not all commands support all formats. show supports json and plain. diff, promote, patch, and remove support plain and json; promote writes JSON only with --dry-run (see sky state public promote).

Exit Codes ​

CodeMeaning
0Success
1General error, validation error, network failure, or API failure
2Authentication error (no token, expired, or 401)
3Differences found (sky state public diff)
77Forbidden (authenticated but not authorized for this project)
78Quota or plan limit exceeded
80Service unavailable (API returned 503)

Commands print diagnostics to stderr. Machine-readable output goes to stdout.