Skip to content

Commit 2ab62b7

Browse files
committed
examples: replace --format with --output
1 parent 19b8c99 commit 2ab62b7

File tree

18 files changed

+248
-249
lines changed

18 files changed

+248
-249
lines changed

examples/EXPERIMENT.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ Based on experiment findings, the following improvements were made:
179179

180180
| Feature | Status | Flag/Command |
181181
|---------|--------|--------------|
182-
| Trace flowchart | ✅ Done | `temporal workflow describe --trace-root-cause --format mermaid` |
183-
| Timeline sequence diagram | ✅ Done | `temporal workflow show --compact --format mermaid` |
184-
| State diagram | ✅ Done | `temporal workflow describe --pending --format mermaid` |
185-
| Failures pie chart | ✅ Done | `temporal workflow list --failed --group-by error --format mermaid` |
186-
| Failures flowchart | ✅ Done | `temporal workflow list --failed --format mermaid` |
182+
| Trace flowchart | ✅ Done | `temporal workflow describe --trace-root-cause --output mermaid` |
183+
| Timeline sequence diagram | ✅ Done | `temporal workflow show --compact --output mermaid` |
184+
| State diagram | ✅ Done | `temporal workflow describe --pending --output mermaid` |
185+
| Failures pie chart | ✅ Done | `temporal workflow list --failed --group-by error --output mermaid` |
186+
| Failures flowchart | ✅ Done | `temporal workflow list --failed --output mermaid` |
187187

188188
---
189189

@@ -226,6 +226,6 @@ The `temporal workflow` CLI commands successfully achieve the goals:
226226
6. **Timing analysis**: Timeline timestamps enable race condition diagnosis
227227
7. **Low token cost**: Structured JSON is ~10x more efficient than raw logs
228228
8. **Autonomous debugging**: LLM successfully diagnosed and fixed a TOCTOU bug without hints
229-
9. **Mermaid visualization**: `--format mermaid` generates visual diagrams for human-in-the-loop debugging
229+
9. **Mermaid visualization**: `--output mermaid` generates visual diagrams for human-in-the-loop debugging
230230

231231
**Temporal's execution history + agent-optimized CLI = effective AI debugging feedback loop.**

examples/agent-demo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ temporal workflow list --failed \
9494
--tls \
9595
--since 1h \
9696
--follow-children \
97-
--format json | jq
97+
--output json | jq
9898
```
9999

100100
### Trace a Workflow Chain
@@ -107,7 +107,7 @@ temporal workflow describe --trace-root-cause \
107107
--api-key $TEMPORAL_API_KEY \
108108
--tls \
109109
-w order-payment-fail-XXXXXX \
110-
--format json | jq
110+
--output json | jq
111111

112112
# Trace the nested failure workflow (3 levels deep)
113113
temporal workflow describe --trace-root-cause \
@@ -116,7 +116,7 @@ temporal workflow describe --trace-root-cause \
116116
--api-key $TEMPORAL_API_KEY \
117117
--tls \
118118
-w nested-failure-XXXXXX \
119-
--format json | jq
119+
--output json | jq
120120
```
121121

122122
### Get Workflow Timeline
@@ -129,7 +129,7 @@ temporal workflow show --compact \
129129
--tls \
130130
-w order-success-XXXXXX \
131131
--compact \
132-
--format json | jq
132+
--output json | jq
133133
```
134134

135135
## Workflow Scenarios

examples/agent-demo/starter/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func runLongRunningScenario(ctx context.Context, c client.Client, taskQueue, tim
248248
}
249249
log.Printf("Started LongRunningWorkflow: %s", run.GetID())
250250
log.Println("TIP: While running, query its state with:")
251-
log.Printf(" temporal workflow describe --pending --workflow-id %s --namespace <your-namespace> --format json", workflowID)
251+
log.Printf(" temporal workflow describe --pending --workflow-id %s --namespace <your-namespace> --output json", workflowID)
252252
}
253253

254254
func runDeepChainScenario(ctx context.Context, c client.Client, taskQueue, timestamp string) {
@@ -266,5 +266,5 @@ func runDeepChainScenario(ctx context.Context, c client.Client, taskQueue, times
266266
}
267267
log.Printf("Started DeepChainWorkflow (4 levels deep, fails with DB error): %s", run.GetID())
268268
log.Println("TIP: Trace the full chain with:")
269-
log.Printf(" temporal workflow describe --trace-root-cause --workflow-id %s --namespace <your-namespace> --format json", workflowID)
269+
log.Printf(" temporal workflow describe --trace-root-cause --workflow-id %s --namespace <your-namespace> --output json", workflowID)
270270
}

examples/ai-research-agent-impl/CLAUDE.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ When debugging Temporal workflows, use the `temporal workflow` CLI commands inst
66

77
### Find Failures
88
```bash
9-
temporal workflow list --failed --since 1h --format json
10-
temporal workflow list --failed --since 1h --follow-children --leaf-only --compact-errors --format json
11-
temporal workflow list --failed --since 1h --group-by error --format json
9+
temporal workflow list --failed --since 1h --output json
10+
temporal workflow list --failed --since 1h --follow-children --leaf-only --compact-errors --output json
11+
temporal workflow list --failed --since 1h --group-by error --output json
1212
```
1313

1414
### Trace Workflow Chain
1515
```bash
16-
temporal workflow describe --trace-root-cause --workflow-id <id> --format json
17-
temporal workflow describe --trace-root-cause --workflow-id <id> --format mermaid
16+
temporal workflow describe --trace-root-cause --workflow-id <id> --output json
17+
temporal workflow describe --trace-root-cause --workflow-id <id> --output mermaid
1818
```
1919

2020
### Get Timeline
2121
```bash
22-
temporal workflow show --compact --workflow-id <id> --format json
23-
temporal workflow show --compact --workflow-id <id> --compact --format json
24-
temporal workflow show --compact --workflow-id <id> --format mermaid
22+
temporal workflow show --compact --workflow-id <id> --output json
23+
temporal workflow show --compact --workflow-id <id> --compact --output json
24+
temporal workflow show --compact --workflow-id <id> --output mermaid
2525
```
2626

2727
### Check State
2828
```bash
29-
temporal workflow describe --pending --workflow-id <id> --format json
30-
temporal workflow describe --pending --workflow-id <id> --format mermaid
29+
temporal workflow describe --pending --workflow-id <id> --output json
30+
temporal workflow describe --pending --workflow-id <id> --output mermaid
3131
```
3232

3333
## Key Flags
@@ -36,21 +36,21 @@ temporal workflow describe --pending --workflow-id <id> --format mermaid
3636
- `--leaf-only` - Show only leaf failures (de-duplicate chains)
3737
- `--compact-errors` - Strip wrapper context, show core error
3838
- `--group-by error|namespace|type|status` - Aggregate failures
39-
- `--format mermaid` - Output visual diagrams
40-
- `--format json` - Structured JSON output
39+
- `--output mermaid` - Output visual diagrams
40+
- `--output json` - Structured JSON output
4141

4242
## Visualization
4343

44-
Use `--format mermaid` to generate diagrams:
45-
- `trace --format mermaid` → Flowchart of workflow chain
46-
- `timeline --format mermaid` → Sequence diagram of events
47-
- `state --format mermaid` → State diagram with pending work
48-
- `failures --group-by error --format mermaid` → Pie chart
44+
Use `--output mermaid` to generate diagrams:
45+
- `trace --output mermaid` → Flowchart of workflow chain
46+
- `timeline --output mermaid` → Sequence diagram of events
47+
- `state --output mermaid` → State diagram with pending work
48+
- `failures --group-by error --output mermaid` → Pie chart
4949

5050
## Debugging Workflow
5151

5252
1. Start with `workflow diagnose` to see the chain and root cause
53-
2. Use `--format mermaid` to visualize if complex
53+
2. Use `--output mermaid` to visualize if complex
5454
3. Use `workflow failures --leaf-only` to see actual failures
5555
4. Use `workflow describe --pending` to check pending work on running workflows
5656
5. Use `--group-by` to find patterns in multiple failures
@@ -60,8 +60,8 @@ Use `--format mermaid` to generate diagrams:
6060
User: "The order workflow failed"
6161

6262
You should:
63-
1. Run `temporal workflow describe --trace-root-cause --workflow-id order-123 --format json`
64-
2. If complex, add `--format mermaid` for visual
63+
1. Run `temporal workflow describe --trace-root-cause --workflow-id order-123 --output json`
64+
2. If complex, add `--output mermaid` for visual
6565
3. Identify the leaf failure and root cause
6666
4. Explain what went wrong
6767
5. Suggest a fix

examples/ai-research-agent-impl/llm-chat-transcript.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ func ResearchWorkflow(ctx workflow.Context, req shared.ResearchRequest) (*shared
807807
Restart your worker and run the starter to see it in action. You can watch the progress with:
808808

809809
```bash
810-
temporal agent timeline --workflow-id research-workflow --format mermaid
810+
temporal agent timeline --workflow-id research-workflow --output mermaid
811811
```
812812

813813
```go
@@ -830,7 +830,7 @@ func ResearchWorkflow(ctx workflow.Context, req shared.ResearchRequest) (*shared
830830
```
831831

832832
```shellscript
833-
temporal agent timeline --workflow-id research-workflow --format mermaid
833+
temporal agent timeline --workflow-id research-workflow --output mermaid
834834
```
835835

836836
---
@@ -941,7 +941,7 @@ Done! The workflow now runs all sub-question research in parallel:
941941
Restart your worker and run again. You can see the parallel execution in the timeline:
942942

943943
```bash
944-
temporal agent timeline --workflow-id research-workflow --format mermaid
944+
temporal agent timeline --workflow-id research-workflow --output mermaid
945945
```
946946

947947
```go
@@ -964,7 +964,7 @@ temporal agent timeline --workflow-id research-workflow --format mermaid
964964
```
965965

966966
```shellscript
967-
temporal agent timeline --workflow-id research-workflow --format mermaid
967+
temporal agent timeline --workflow-id research-workflow --output mermaid
968968
```
969969

970970
---
@@ -1434,7 +1434,7 @@ temporal agent failures --since 5m -o json
14341434
14351435
**User**
14361436
1437-
but, the output of `temporal agent failures --since 5m --format json` is empty. When I look at the Temporal UI, I see unlimited retries.
1437+
but, the output of `temporal agent failures --since 5m --output json` is empty. When I look at the Temporal UI, I see unlimited retries.
14381438
14391439
---
14401440
@@ -1825,7 +1825,7 @@ Here's what happened, using the `temporal agent` commands to debug:
18251825
18261826
**1. Timeline shows the failure:**
18271827
```bash
1828-
temporal agent timeline --workflow-id research-workflow --format mermaid
1828+
temporal agent timeline --workflow-id research-workflow --output mermaid
18291829
```
18301830
18311831
```mermaid
@@ -1863,7 +1863,7 @@ Key findings:
18631863
To fix: either increase the timeout, reduce the sleep duration, or handle partial failures gracefully.
18641864
18651865
```shellscript
1866-
temporal agent timeline --workflow-id research-workflow --format mermaid
1866+
temporal agent timeline --workflow-id research-workflow --output mermaid
18671867
```
18681868
18691869
```plaintext

examples/ai-research-agent/.cursorrules

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ When debugging Temporal workflows, use the `temporal workflow` CLI commands inst
66

77
### Find Failures
88
```bash
9-
temporal workflow failures --since 1h --format json
10-
temporal workflow failures --since 1h --follow-children --leaf-only --compact-errors --format json
11-
temporal workflow failures --since 1h --group-by error --format json
9+
temporal workflow failures --since 1h --output json
10+
temporal workflow failures --since 1h --follow-children --leaf-only --compact-errors --output json
11+
temporal workflow failures --since 1h --group-by error --output json
1212
```
1313

1414
### Trace Workflow Chain
1515
```bash
16-
temporal workflow diagnose --workflow-id <id> --format json
17-
temporal workflow diagnose --workflow-id <id> --format mermaid
16+
temporal workflow diagnose --workflow-id <id> --output json
17+
temporal workflow diagnose --workflow-id <id> --output mermaid
1818
```
1919

2020
### Get Timeline
2121
```bash
22-
temporal workflow show --compact --workflow-id <id> --format json
23-
temporal workflow show --compact --workflow-id <id> --compact --format json
24-
temporal workflow show --compact --workflow-id <id> --format mermaid
22+
temporal workflow show --compact --workflow-id <id> --output json
23+
temporal workflow show --compact --workflow-id <id> --compact --output json
24+
temporal workflow show --compact --workflow-id <id> --output mermaid
2525
```
2626

2727
### Check State
2828
```bash
29-
temporal workflow describe --pending --workflow-id <id> --format json
30-
temporal workflow describe --pending --workflow-id <id> --format mermaid
29+
temporal workflow describe --pending --workflow-id <id> --output json
30+
temporal workflow describe --pending --workflow-id <id> --output mermaid
3131
```
3232

3333
## Key Flags
@@ -36,21 +36,21 @@ temporal workflow describe --pending --workflow-id <id> --format mermaid
3636
- `--leaf-only` - Show only leaf failures (de-duplicate chains)
3737
- `--compact-errors` - Strip wrapper context, show core error
3838
- `--group-by error|namespace|type|status` - Aggregate failures
39-
- `--format mermaid` - Output visual diagrams
40-
- `--format json` - Structured JSON output
39+
- `--output mermaid` - Output visual diagrams
40+
- `--output json` - Structured JSON output
4141

4242
## Visualization
4343

44-
Use `--format mermaid` to generate diagrams:
45-
- `trace --format mermaid` → Flowchart of workflow chain
46-
- `timeline --format mermaid` → Sequence diagram of events
47-
- `state --format mermaid` → State diagram with pending work
48-
- `failures --group-by error --format mermaid` → Pie chart
44+
Use `--output mermaid` to generate diagrams:
45+
- `trace --output mermaid` → Flowchart of workflow chain
46+
- `timeline --output mermaid` → Sequence diagram of events
47+
- `state --output mermaid` → State diagram with pending work
48+
- `failures --group-by error --output mermaid` → Pie chart
4949

5050
## Debugging Workflow
5151

5252
1. Start with `workflow diagnose` to see the chain and root cause
53-
2. Use `--format mermaid` to visualize if complex
53+
2. Use `--output mermaid` to visualize if complex
5454
3. Use `workflow failures --leaf-only` to see actual failures
5555
4. Use `workflow describe --pending` to check pending work on running workflows
5656
5. Use `--group-by` to find patterns in multiple failures
@@ -60,8 +60,8 @@ Use `--format mermaid` to generate diagrams:
6060
User: "The order workflow failed"
6161

6262
You should:
63-
1. Run `temporal workflow diagnose --workflow-id order-123 --format json`
64-
2. If complex, add `--format mermaid` for visual
63+
1. Run `temporal workflow diagnose --workflow-id order-123 --output json`
64+
2. If complex, add `--output mermaid` for visual
6565
3. Identify the leaf failure and root cause
6666
4. Explain what went wrong
6767
5. Suggest a fix

0 commit comments

Comments
 (0)