statelyai 0.3.1 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,38 +1,44 @@
1
1
  # statelyai
2
2
 
3
- <!-- package.json#name and #description — top-level summary -->
3
+ CLI implementation for Stately.
4
4
 
5
- Command-line tools for Stately.
5
+ This package contains the `statelyai` command implementation.
6
6
 
7
- ## Usage
7
+ ## Happy Path
8
8
 
9
- <!-- package.json#bin and delegated SDK CLI commands from ../sdk/src/cli.ts#COMMANDS -->
9
+ 1. Get an API key from [Stately API Key settings](https://stately.ai/registry/user/my-settings?tab=API+Key).
10
+ 2. Log in once:
10
11
 
11
- Run the Stately CLI without installing it globally:
12
+ ```bash
13
+ statelyai login
14
+ ```
15
+
16
+ 3. Initialize the current repo:
12
17
 
13
18
  ```bash
14
- npx statelyai open ./checkout.machine.ts
19
+ statelyai init
15
20
  ```
16
21
 
17
- The `statelyai` package delegates to the CLI implementation in `@statelyai/sdk`.
22
+ 4. Optionally scan the repo and save suggested source globs:
18
23
 
19
- Available commands:
24
+ ```bash
25
+ statelyai init --scan
26
+ ```
20
27
 
21
- | Command | Description |
22
- | --- | --- |
23
- | `statelyai init` | Create or reuse a Studio project for the current directory and write `statelyai.json` with an empty `sources` array |
24
- | `statelyai login` | Store an API key for future CLI use |
25
- | `statelyai logout` | Remove a stored API key |
26
- | `statelyai auth status` | Show whether the CLI would use an environment variable or stored credential |
27
- | `statelyai plan <source> <target>` | Print a semantic sync summary |
28
- | `statelyai diff <source> <target>` | Diff two locators and optionally fail on changes |
29
- | `statelyai push [file]` | Discover local machine sources, create remote Studio machines for unlabeled files, update linked ones, and persist returned ids |
30
- | `statelyai pull <source> <target>` | Materialize a source into a local target file |
31
- | `statelyai pull <linked-file>` | Refresh a linked local file from the `@statelyai id=...` pragma |
32
- | `statelyai open <file>` | Open a local file in a browser-backed visual editor session |
28
+ 5. Push local machines:
33
29
 
34
- The CLI resolves credentials in this order: `--api-key`, then `STATELY_API_KEY`/`NEXT_PUBLIC_STATELY_API_KEY`, then the key stored by `statelyai login`.
30
+ ```bash
31
+ statelyai push
32
+ ```
35
33
 
36
- Pass `--api-key`, set `STATELY_API_KEY`, or run `statelyai login` when the editor server requires auth. Self-hosted editor servers can disable editor-sync API-key checks with `EDITOR_SYNC_AUTH_REQUIRED=false`.
34
+ 6. Pull remote changes back into linked local files:
37
35
 
38
- Run `statelyai init --scan` to detect local machine-bearing files from their contents and save suggested `sources` globs into `statelyai.json`.
36
+ ```bash
37
+ statelyai pull
38
+ ```
39
+
40
+ Run it without installing it globally:
41
+
42
+ ```bash
43
+ npx statelyai --help
44
+ ```
package/dist/bin.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
package/dist/bin.mjs ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { l as run } from "./cli-B9CRx5db.mjs";
3
+
4
+ //#region src/bin.ts
5
+ run();
6
+
7
+ //#endregion
8
+ export { };