@meistrari/tela-cli 1.6.0 → 1.8.0

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.
@@ -1,6 +1,6 @@
1
1
  ## CLI
2
2
 
3
- The workflow command group documents implemented `init`, `create`, `compile`, `docs`, `codegen`, `sync`, and `publish` workflows. Current MVP behavior is local-first until you run an explicit remote lifecycle command such as `create`, `sync`, or `publish`.
3
+ The workflow command group documents implemented `init`, `create`, `compile`, `docs`, `codegen`, `sync`, `publish`, and `watch` workflows. Current MVP behavior is local-first until you run an explicit remote lifecycle command such as `create`, `sync`, `publish`, or `watch`.
4
4
 
5
5
  ### Command surface
6
6
 
@@ -13,10 +13,11 @@ The workflow command group documents implemented `init`, `create`, `compile`, `d
13
13
  | `create <target> [--project <project-id>] [--config <path>] [--env <path>] [--json]` | Implemented | Yes | Provision a remote workflow, bind it to the active context, scaffold source, and sync when possible. |
14
14
  | `sync [target] [--config <path>] [--env <path>] [--yes] [--json]` | Implemented | Yes | Synchronize local compiled workflow(s) with configured Tela prompt(s). |
15
15
  | `publish [target] [--environment <name>] [--create-environment-if-missing] [--config <path>] [--env <path>] [--yes] [--json]` | Implemented | Yes | Publish local-matching workflow version(s) to the selected workflow environment. |
16
+ | `watch [target] [--config <path>] [--env <path>] [--json]` | Implemented | Yes | Run an initial compile, codegen, and sync cycle, then serialize debounced source, config, and Tela context changes until stopped. |
16
17
 
17
18
  ### Target selection
18
19
 
19
- The positional target is the key inside `workflow-code.config.ts` `workflows`. `create` always requires exactly one target. If `compile` sees exactly one configured workflow, the target may be omitted; with multiple workflows it is required. `sync` and `publish` use the same target key and run every configured workflow when it is omitted. For publish, `--environment <name>` selects the workflow publication environment and is independent from the active Tela Local context. `--env <path>` remains scoped to dotenv-backed config/source evaluation and does not select the remote Tela context.
20
+ The positional target is the key inside `workflow-code.config.ts` `workflows`. `create` always requires exactly one target. If `compile` sees exactly one configured workflow, the target may be omitted; with multiple workflows it is required. `sync`, `publish`, and `watch` use the same target key and run every configured workflow when it is omitted. For publish, `--environment <name>` selects the workflow publication environment and is independent from the active Tela Local context. `--env <path>` remains scoped to dotenv-backed config/source evaluation and does not select the remote Tela context.
20
21
 
21
22
  ```bash
22
23
  tela workflow compile
@@ -29,6 +30,8 @@ tela workflow sync
29
30
  tela workflow sync invoice-processing --env .env.staging --json
30
31
  tela workflow publish
31
32
  tela workflow publish invoice-processing --environment staging --json
33
+ tela workflow watch
34
+ tela workflow watch invoice-processing --env .env.staging
32
35
  ```
33
36
 
34
37
  ### init
@@ -224,6 +227,29 @@ tela workflow publish invoice-processing --environment dev --create-environment-
224
227
  tela workflow publish --environment production --yes --json
225
228
  ```
226
229
 
230
+ ### watch
231
+
232
+ **Description.** `tela workflow watch` runs an initial compile, codegen, and sync cycle for the selected workflow(s), then watches local source files, the workflow-code config, and the active Tela Local config file (`~/.tela/config.json` or `$TELA_HOME/config.json`) for changes. Rapid edits debounce into one re-run, and file events that arrive while a cycle is already running coalesce into one serialized follow-up cycle, so codegen and sync do not overlap.
233
+
234
+ Each cycle reloads config before syncing, so newly added targets, changed entries, and newly imported source files are picked up without restarting watch. Each cycle also refreshes the shared workspace catalog (the same mechanism as `codegen`) and, when the active Tela Local context changes, automatically switches to that context's lockfile before the next sync while reporting the prior and new context in human output. If the active context is unchanged, watch prints no context-change notice.
235
+
236
+ A compile failure in one workflow blocks only that workflow's sync and does not stop the watch loop. Watch never publishes and ignores project `.tela/` writes, including lockfiles, catalog snapshots, and generated augmentation files, so it cannot trigger itself. Watcher backend errors are reported with diagnostics and close the watcher. Stop watch with Ctrl+C; the routed Tela CLI removes its SIGINT handler after shutdown.
237
+
238
+ | Prop | Type | Required | Description |
239
+ |---|---|---:|---|
240
+ | `target` | Positional | No | Config `workflows` key to watch. Omit to watch every configured workflow. |
241
+ | `--config <path>` | Flag | No | Load a custom config file instead of `workflow-code.config.ts`. |
242
+ | `--env <path>` | Flag | No | Load a custom dotenv file before evaluating config. |
243
+ | `--json` | Flag | No | Emit one JSON line per watch cycle (codegen and per-target sync results, plus a context-changed flag) instead of formatted terminal output. |
244
+
245
+ **Examples.**
246
+
247
+ ```bash
248
+ tela workflow watch
249
+ tela workflow watch invoice-processing
250
+ tela workflow watch invoice-processing --env .env.staging
251
+ ```
252
+
227
253
 
228
254
 
229
255
  ### JSON diagnostics
@@ -20,7 +20,7 @@
20
20
  "slug": "cli",
21
21
  "title": "CLI",
22
22
  "file": "cli.md",
23
- "sha256": "aaa6b661a7adf7bebcb22a0881e604034886515440468fad7e20c7e5ce3a2e6d"
23
+ "sha256": "e1ad966acd236d4b80ccedc101f808f295b1917b05cf16831131265c22a6e8a2"
24
24
  },
25
25
  {
26
26
  "slug": "config",