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. Use public state for application config, feature flags, public settings, and client-visible catalog or inventory values.

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 by every command:

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 bearer session in ~/.config/skystate/token.json.

Public-state commands also accept a project API key from SKYSTATE_API_KEY or .env.local. API-key auth is project-scoped; developer bearer auth uses --project <slug> to select a project.

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 state userList, show, and delete end-user state as a developer
sky examplesPrint stack-specific snippets
sky configManage global CLI settings

Advanced Commands

sky provision scans source files for provisionable public-state declarations and writes missing top-level keys into an environment.

bash
sky provision --project <slug> --env <env> [--path <dir>] [--dry-run] [--yes]

Use --dry-run first to review discovered keys. The command requires --project; --env can be provided directly or resolved from SKYSTATE_ENV / default_env.

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.

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)
78Quota or plan limit exceeded
80Service unavailable (API returned 503)

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