You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3321522
Browse filesBrowse the repository at this point in the historyBrowse files
fix(sim-cli): consistent source command flags and refusals (#10555)
* fix(sim-cli): consistent source command flags and refusals
- workflows source resources and catalog take --dir (the directory's workspace, and for catalog its workflow); catalog --workflow-id takes an exact name like get
- --json (same as --output json, errors included) on every workflows/workspaces source subcommand; an unknown --json elsewhere suggests --output json
- SOURCE_DIR_KIND_MISMATCH names the command run, says 'would replace its base' only for get, and points at the workflow folder or the matching command
- the not-found hint says -w <id>, which the wire-name rewording no longer turns into -w <--workspace>
- writing a source answer back skips files whose text on disk is already the answer's, so a no-op apply moves no mtimes
* fix(sim-cli): resolve resources and catalog --dir as the directory's other commands do
--dir defaults to the working directory, so catalog includes the workflow it holds; a directory
naming no workspace clears the working directory's; and a -w or SIM_WORKSPACE naming another
workspace than the directory's record is refused (SOURCE_OTHER_WORKSPACE). The docs baseline
records the changed resources usage fence.
|`--workflow-id <value>`| No | Return the source catalog for this workflow: the workspace catalog plus every block type already placed in it, the ones the caller could not add marked `addable: false`. |
8599
+
|`--workflow-id <value>`| No | Workflow id, or its exact name: adds every block type already placed in it, the ones the caller could not add marked `addable: false`. |
8600
+
|`--dir <dir>`| No | Source directory whose workspace and workflow to read. Defaults to `.`. |
8601
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
8600
8602
8601
8603
</CommandTable>
8602
8604
@@ -8607,9 +8609,20 @@ API request and response schemas: [getSourceCatalog](/api-reference/catalog/getS
8607
8609
List the tables, knowledge bases, credentials, workflows, skills, custom tools, MCP servers, files and env names source can name
8608
8610
8609
8611
```bash
8610
-
sim workflows source resources
8612
+
sim workflows source resources [options]
8611
8613
```
8612
8614
8615
+
**Options**
8616
+
8617
+
<CommandTable>
8618
+
8619
+
| Option | Required | Description |
8620
+
| --- | --- | --- |
8621
+
|`--dir <dir>`| No | Source directory whose workspace to read. Defaults to `.`. |
8622
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
8623
+
8624
+
</CommandTable>
8625
+
8613
8626
API request and response schemas: [getSourceResources](/api-reference/workflows/getSourceResources).
8614
8627
8615
8628
### sim workflows source get
@@ -8639,6 +8652,7 @@ sim workflows source get <workflow> [options]
8639
8652
|`--function-code <value>`| No | Where function-block code goes: `files` (default) writes it to `functions/*` files referenced with `codeFile()`; `inline` prints it in tagged templates. Accepted values: `inline`, `files`. |
8640
8653
|`--dir <dir>`| No | Write the source, its lock and SDK type declarations into this directory instead of printing them. |
8641
8654
|`--force`| No | With --dir: replace another workflow's source or edits no apply has saved. |
8655
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`--run [input]`| No | After the write is saved, dry-run the draft with this input (JSON or @file, as `sim workflows run --dry --input` takes it): a run that does not complete exits 1 and deploys nothing. With several triggers (an API and a webhook), name the one to enter through by its const: --run 'shopWebhook={…}' (--run shopWebhook alone: no input). Repeat --run to test more inputs or triggers: every run is made and reported, and --deploy needs all to complete. Sandboxed code (Python, shell, imports) really runs in it, network requests included, and is listed in sideEffects.unchecked, so --run --deploy in CI sends those. |
8679
8693
|`--deploy`| No | After the write is saved (and a --run completed), deploy the workflow (as `sim workflows deploy <workflowId>` does). |
8680
8694
|`--allow-delete`| No | Delete blocks and variables the source no longer declares; without it, an apply that deletes one is refused. |
8695
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`-y, --yes`| No | Create without asking for confirmation. |
8709
8724
|`--run [input]`| No | After the write is saved, dry-run the draft with this input (JSON or @file, as `sim workflows run --dry --input` takes it): a run that does not complete exits 1 and deploys nothing. With several triggers (an API and a webhook), name the one to enter through by its const: --run 'shopWebhook={…}' (--run shopWebhook alone: no input). Repeat --run to test more inputs or triggers: every run is made and reported, and --deploy needs all to complete. Sandboxed code (Python, shell, imports) really runs in it, network requests included, and is listed in sideEffects.unchecked, so --run --deploy in CI sends those. |
8710
8725
|`--deploy`| No | After the write is saved (and a --run completed), deploy the workflow (as `sim workflows deploy <workflowId>` does). |
8726
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`--no-strict`| No | Never fail on a warning an apply saves. |
8735
8751
|`--no-types`| No | Skip the type check (TypeScript 7.0.2 over tsconfig.json) that runs after the compile. |
8736
8752
|`--verbose`| No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. |
8753
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
8737
8754
8738
8755
</CommandTable>
8739
8756
@@ -8762,7 +8779,7 @@ sim workflows source status [options]
8762
8779
|`--summary-file <path>`| No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. |
8763
8780
|`--dir <dir>`| No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. |
8764
8781
|`--offline`| No | Report local changes only, without asking the server. |
8765
-
|`--json`| No | Print the machine-readable status (same as --output json). |
8782
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`--only <kinds>`| No | Apply only these kinds (comma-separated folders: secrets.ts, credentials.ts, tools, skills, mcp, tables, knowledge, files, workflows, deployments). |
10127
10147
|`--to <workspaceId>`| No | Promote the directory to another workspace (dev to prod): its resources bind by key to that workspace's own and are updated in place. Only .sim/targets/<workspaceId>.json changes, the record the next promotion compares with: a resource changed there since is kept, or refused as stale (exit 5) when the directory changed it too. |
10128
10148
|`--run <key=input>`| No | After the apply, dry-run workflows/<key>/'s saved draft with this input (JSON or @file, as `sim workflows run --dry --input` takes it; `--run <key>` alone: no input). Repeat it to test more workflows. deployments/ is applied only after every run completed, and only when every draft it publishes was test-run; a run that does not complete exits 1 and leaves the applied drafts in place. Sandboxed code (Python, shell, imports) really runs in it, network requests included, and is listed in runs[].sideEffects.unchecked. |
10149
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
Copy file name to clipboardExpand all lines: apps/docs/content/docs/cli/workflows.mdx
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1396,6 +1396,7 @@ sim workflows source get <workflow> [options]
1396
1396
|`--function-code <value>`| No | Where function-block code goes: `files` (default) writes it to `functions/*` files referenced with `codeFile()`; `inline` prints it in tagged templates. Accepted values: `inline`, `files`. |
1397
1397
|`--dir <dir>`| No | Write the source, its lock and SDK type declarations into this directory instead of printing them. |
1398
1398
|`--force`| No | With --dir: replace another workflow's source or edits no apply has saved. |
1399
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
1399
1400
1400
1401
</CommandTable>
1401
1402
@@ -1418,7 +1419,7 @@ sim workflows source status [options]
1418
1419
|`--summary-file <path>`| No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. |
1419
1420
|`--dir <dir>`| No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. |
1420
1421
|`--offline`| No | Report local changes only, without asking the server. |
1421
-
|`--json`| No | Print the machine-readable status (same as --output json). |
1422
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`-y, --yes`| No | Create without asking for confirmation. |
1450
1451
|`--run [input]`| No | After the write is saved, dry-run the draft with this input (JSON or @file, as `sim workflows run --dry --input` takes it): a run that does not complete exits 1 and deploys nothing. With several triggers (an API and a webhook), name the one to enter through by its const: --run 'shopWebhook={…}' (--run shopWebhook alone: no input). Repeat --run to test more inputs or triggers: every run is made and reported, and --deploy needs all to complete. Sandboxed code (Python, shell, imports) really runs in it, network requests included, and is listed in sideEffects.unchecked, so --run --deploy in CI sends those. |
1451
1452
|`--deploy`| No | After the write is saved (and a --run completed), deploy the workflow (as `sim workflows deploy <workflowId>` does). |
1453
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`--run [input]`| No | After the write is saved, dry-run the draft with this input (JSON or @file, as `sim workflows run --dry --input` takes it): a run that does not complete exits 1 and deploys nothing. With several triggers (an API and a webhook), name the one to enter through by its const: --run 'shopWebhook={…}' (--run shopWebhook alone: no input). Repeat --run to test more inputs or triggers: every run is made and reported, and --deploy needs all to complete. Sandboxed code (Python, shell, imports) really runs in it, network requests included, and is listed in sideEffects.unchecked, so --run --deploy in CI sends those. |
1487
1489
|`--deploy`| No | After the write is saved (and a --run completed), deploy the workflow (as `sim workflows deploy <workflowId>` does). |
1488
1490
|`--allow-delete`| No | Delete blocks and variables the source no longer declares; without it, an apply that deletes one is refused. |
1491
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`--workflow-id <value>`| No | Return the source catalog for this workflow: the workspace catalog plus every block type already placed in it, the ones the caller could not add marked `addable: false`. |
1511
+
|`--workflow-id <value>`| No | Workflow id, or its exact name: adds every block type already placed in it, the ones the caller could not add marked `addable: false`. |
1512
+
|`--dir <dir>`| No | Source directory whose workspace and workflow to read. Defaults to `.`. |
1513
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
|`--only <kinds>`| No | Apply only these kinds (comma-separated folders: secrets.ts, credentials.ts, tools, skills, mcp, tables, knowledge, files, workflows, deployments). |
761
762
|`--to <workspaceId>`| No | Promote the directory to another workspace (dev to prod): its resources bind by key to that workspace's own and are updated in place. Only .sim/targets/<workspaceId>.json changes, the record the next promotion compares with: a resource changed there since is kept, or refused as stale (exit 5) when the directory changed it too. |
762
763
|`--run <key=input>`| No | After the apply, dry-run workflows/<key>/'s saved draft with this input (JSON or @file, as `sim workflows run --dry --input` takes it; `--run <key>` alone: no input). Repeat it to test more workflows. deployments/ is applied only after every run completed, and only when every draft it publishes was test-run; a run that does not complete exits 1 and leaves the applied drafts in place. Sandboxed code (Python, shell, imports) really runs in it, network requests included, and is listed in runs[].sideEffects.unchecked. |
764
+
|`--json`| No | Print machine-readable JSON (same as --output json). |
0 commit comments