Stately
Packages

statelyai

CLI implementation for Stately.

CLI implementation for Stately.

This package contains the statelyai command implementation.

Happy Path

  1. Get an API key from Stately API Key settings.
  2. Log in once:
statelyai login
  1. Initialize the current repo:
statelyai init
  1. Optionally scan the repo and save suggested source globs:
statelyai init --scan

That writes a statelyai.json like:

{
  "$schema": "https://stately.ai/schemas/statelyai.json",
  "version": "1.0.0",
  "projectId": "project_123",
  "studioUrl": "https://stately.ai",
  "defaultXStateVersion": 5,
  "include": ["src/**/*.ts"],
  "exclude": ["**/*.test.*", "**/*.spec.*"]
}
  1. Push local machines:
statelyai push

Preview what push would do without updating Studio or local files:

statelyai push --dry-run

If a saved // @statelyai id=... points to a deleted or inaccessible remote machine, push will prompt to relink the file as a new remote machine and replace the local id.

  1. Pull remote changes back into linked local files:
statelyai pull

pull skips locally modified files unless you pass --force.

Run it without installing it globally:

npx statelyai --help

On this page