Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions apps/docs/content/docs/en/cli/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,25 @@ sim logs list [options]
| `--folder <value...>` | No | Folder path as shown in the app; the leading / is optional (space-separated, or @path / @- with one value per line). |

</CommandTable>

## Watch runs as they arrive, printing each new run once

```bash
sim logs follow [options]
```

**Options**

<CommandTable>

| Option | Required | Description |
| --- | --- | --- |
| `--workflow <id>` | No | Only follow runs of this workflow (repeatable). Defaults to ``. |
| `--folder <path>` | No | Only follow runs of workflows in this folder (repeatable). Defaults to ``. |
| `--trigger <type>` | No | Only follow runs with this trigger type (repeatable). Defaults to ``. |
| `--level <level>` | No | Only follow runs at this severity. Accepted values: `info`, `error`. |
| `--details <level>` | No | Response detail level; full names each run’s workflow. Accepted values: `basic`, `full`. Defaults to `full`. |
| `-n, --lines <count>` | No | Recent runs to print before watching. Defaults to `10`. |
| `--interval <seconds>` | No | Seconds between polls. Defaults to `3`. |

</CommandTable>
56 changes: 56 additions & 0 deletions apps/docs/content/docs/en/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,30 @@ sim logs list [options]

</CommandTable>

### sim logs follow

Watch runs as they arrive, printing each new run once

```bash
sim logs follow [options]
```

**Options**

<CommandTable>

| Option | Required | Description |
| --- | --- | --- |
| `--workflow <id>` | No | Only follow runs of this workflow (repeatable). Defaults to ``. |
| `--folder <path>` | No | Only follow runs of workflows in this folder (repeatable). Defaults to ``. |
| `--trigger <type>` | No | Only follow runs with this trigger type (repeatable). Defaults to ``. |
| `--level <level>` | No | Only follow runs at this severity. Accepted values: `info`, `error`. |
| `--details <level>` | No | Response detail level; full names each run’s workflow. Accepted values: `basic`, `full`. Defaults to `full`. |
| `-n, --lines <count>` | No | Recent runs to print before watching. Defaults to `10`. |
| `--interval <seconds>` | No | Seconds between polls. Defaults to `3`. |

</CommandTable>

## sim mcp-servers

Also spelled `sim mcp-server`.
Expand Down Expand Up @@ -3190,6 +3214,35 @@ sim workflows runs resume <runId> [options]

</CommandTable>

### sim workflows runs wait

Wait for a run to reach a terminal state, then show it

```bash
sim workflows runs wait <runId> [options]
```

**Arguments**

<CommandTable>

| Argument | Required | Description |
| --- | --- | --- |
| `runId` | Yes | Unique workflow run identifier. |

</CommandTable>

**Options**

<CommandTable>

| Option | Required | Description |
| --- | --- | --- |
| `--workflow <workflowId>` | Yes | Workflow ID. |
| `--wait-timeout <seconds>` | No | Give up after this many seconds, or 0 to wait indefinitely (default: 3600). Bounds the whole wait; SIM_TIMEOUT_SECONDS bounds one request. |

</CommandTable>

### sim workflows create

Create Workflow
Expand Down Expand Up @@ -3389,6 +3442,9 @@ sim workflows run <id> [options]
| `--include-file-base64` | No | Inline eligible output files as base64 content. Rejected when `async` is true. |
| `--no-include-file-base64` | No | Send --include-file-base64 as false. |
| `--base64-max-bytes <value>` | No | Maximum total bytes of file content to inline as base64. Rejected when `async` is true. |
| `--follow` | No | Stream the run as it happens; progress on stderr, result on stdout. The stream reports only success and output, so the result omits the run id and timings a non-streaming run returns. |
| `--include-thinking` | No | Show model reasoning while following (requires --follow). |
| `--include-tool-calls` | No | Show tool calls while following (requires --follow). |

</CommandTable>

Expand Down
30 changes: 30 additions & 0 deletions apps/docs/content/docs/en/cli/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,33 @@ Resume a paused run (output is included in JSON or YAML output)

</CommandTable>

## Wait for a run to reach a terminal state, then show it

```bash
sim workflows runs wait <runId> [options]
```

**Arguments**

<CommandTable>

| Argument | Required | Description |
| --- | --- | --- |
| `runId` | Yes | Unique workflow run identifier. |

</CommandTable>

**Options**

<CommandTable>

| Option | Required | Description |
| --- | --- | --- |
| `--workflow <workflowId>` | Yes | Workflow ID. |
| `--wait-timeout <seconds>` | No | Give up after this many seconds, or 0 to wait indefinitely (default: 3600). Bounds the whole wait; SIM_TIMEOUT_SECONDS bounds one request. |

</CommandTable>

## Create workflow

```bash
Expand Down Expand Up @@ -300,6 +327,9 @@ sim workflows run <id> [options]
| `--include-file-base64` | No | Inline eligible output files as base64 content. Rejected when `async` is true. |
| `--no-include-file-base64` | No | Send --include-file-base64 as false. |
| `--base64-max-bytes <value>` | No | Maximum total bytes of file content to inline as base64. Rejected when `async` is true. |
| `--follow` | No | Stream the run as it happens; progress on stderr, result on stdout. The stream reports only success and output, so the result omits the run id and timings a non-streaming run returns. |
| `--include-thinking` | No | Show model reasoning while following (requires --follow). |
| `--include-tool-calls` | No | Show tool calls while following (requires --follow). |

</CommandTable>

Expand Down
13 changes: 12 additions & 1 deletion packages/sim-cli/src/commands/protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { Command } from 'commander'
import { attachFileGet } from './files-get'
import { attachFileUpload } from './files-upload'
import { attachKnowledgeDocumentUpload } from './knowledge-document-upload'
import { attachLogsFollow } from './logs-follow'
import { attachResourceDirectoryCommands } from './resource-directory'
import { attachTableImport } from './tables-import'
import { attachWorkflowRunFollow } from './workflow-run-follow'
import { attachWorkflowRunWait } from './workflow-run-wait'

function group(program: Command, name: string): Command {
const existing = program.commands.find((command) => command.name() === name)
Expand Down Expand Up @@ -43,10 +46,18 @@ export function attachProtocolCommands(program: Command): void {
createFolder: 'createTableFolder',
})

attachResourceDirectoryCommands(group(program, 'workflows'), {
const workflows = group(program, 'workflows')
attachResourceDirectoryCommands(workflows, {
kind: 'workflow',
resources: 'listWorkflows',
folders: 'listWorkflowFolders',
createFolder: 'createWorkflowFolder',
})
// Both augment commands the generated pass already built — `run` gains
// `--follow`, and `runs` gains `wait` — so they must attach after it, which is
// the order `buildProgram` calls them in.
attachWorkflowRunFollow(workflows)
attachWorkflowRunWait(group(workflows, 'runs'))

attachLogsFollow(group(program, 'logs'))
}
Loading
Loading