Skip to content

Commit bd35b81

Browse files
committed
fix(docs): tell the reader which key a command needs, and stop the ids contradicting the CLI
Around sixty v2 operations refuse a workspace API key, and the CLI's help said nothing about it - the caller found out from a 403 after the request went out. The restriction is already stated in the API spec, so the generator now reads it from there and the command description carries it. The sentinel sentences are imported from the spec's own constants rather than copied, so a reword cannot silently unmark every command, and the test pins the count as well as named operations because a reword confined to one family would otherwise slip past. The generated reference also rendered an empty default as a sentence pointing at nothing - "Defaults to ." - for every repeatable filter. Omitted now, while false and zero still render, which is the trap that shape of check usually walks into. The hand-written guides used a workflow-shaped id for workflows that the CLI's own help says never names one, and five other families were equally wrong. All of them now match the scheme the CLI declares, consistently per entity across pages, with the shared ones taken from that help text so the two read as one voice. The page documenting every flag was linked from nowhere; both landing links pointed at the overview instead. And the generator's test file was absent from the hand-maintained list CI runs, so its guards never executed.
1 parent 452dcd1 commit bd35b81

11 files changed

Lines changed: 353 additions & 68 deletions

apps/docs/content/docs/en/cli/authentication.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ https://www.sim.ai/cli/auth?request=…&scope=platform
2424
Waiting for approval…
2525
2626
✓ Logged in. Key stored in /Users/you/.sim/credentials
27-
Personal key, defaulting to ws_abc123. Override per command with --workspace.
27+
Personal key, defaulting to 2f6d0b1c-8a34-4d92-b7e5-31c8a0f45d67. Override per command with --workspace.
2828
```
2929

3030
There is no loopback listener, so this works over SSH and inside containers.
@@ -47,7 +47,7 @@ profile's default `workspace`; it does **not** restrict the key to that
4747
workspace. Target another workspace the key can reach with `--workspace`:
4848

4949
```bash
50-
sim workflows list --workspace ws_other
50+
sim workflows list --workspace 9b4c7e02-1d58-4f36-a0c9-6e2b85df413a
5151
```
5252

5353
`sim login --workspace <id>` preselects a workspace in the picker, and
@@ -58,7 +58,7 @@ a workspace profile:
5858

5959
```bash
6060
sim workspaces list
61-
sim profile add acme --workspace ws_acme
61+
sim profile add acme --workspace 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
6262
sim --profile acme whoami
6363
```
6464

@@ -108,9 +108,9 @@ config file:
108108

109109
```bash
110110
export SIM_API_KEY="sim_…"
111-
export SIM_WORKSPACE="ws_abc123"
111+
export SIM_WORKSPACE="2f6d0b1c-8a34-4d92-b7e5-31c8a0f45d67"
112112

113-
sim workflows run wf_7Yb2 --input '{"source":"nightly"}' --output json
113+
sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --input '{"source":"nightly"}' --output json
114114
```
115115

116116
Create the key in Sim under **Settings → API keys**. Store it as a secret in your
@@ -130,7 +130,7 @@ jobs:
130130
with:
131131
node-version: '20'
132132
- run: npm install -g sim
133-
- run: sim workflows run wf_7Yb2 --output json
133+
- run: sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --output json
134134
env:
135135
SIM_API_KEY: ${{ secrets.SIM_API_KEY }}
136136
SIM_WORKSPACE: ${{ vars.SIM_WORKSPACE }}
@@ -151,8 +151,8 @@ sim workflows list --profile prod
151151
Use workspace profiles when one personal key should target several workspaces:
152152

153153
```bash
154-
sim profile add marketing --workspace ws_marketing
155-
sim profile add support --workspace ws_support
154+
sim profile add marketing --workspace c3a70e58-9f21-4d6b-b842-05e7f19c6a3d
155+
sim profile add support --workspace e0d94b17-3c62-45af-9718-b6a2c8035f4e
156156

157157
sim workflows list --profile marketing
158158
sim workflows list --profile support

apps/docs/content/docs/en/cli/configuration.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ sim profiles # list them; * marks the active one
2828
Add a profile for another workspace without creating or copying an API key:
2929

3030
```bash
31-
sim profile add acme --workspace ws_acme
31+
sim profile add acme --workspace 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
3232
```
3333

3434
## Setting defaults
3535

3636
```bash
3737
sim configure --set-endpoint http://localhost:3000 --profile dev
38-
sim configure --set-workspace ws_local --profile dev
38+
sim configure --set-workspace 5c81f3a6-0e27-4b94-8d15-a7f60c39b2e8 --profile dev
3939
sim configure --set-output json
4040
```
4141

@@ -76,16 +76,16 @@ repo:
7676
```ini title="~/.sim/config"
7777
[default]
7878
endpoint = https://www.sim.ai
79-
workspace = ws_abc123
79+
workspace = 2f6d0b1c-8a34-4d92-b7e5-31c8a0f45d67
8080
output = table
8181

8282
[profile dev]
8383
endpoint = http://localhost:3000
84-
workspace = ws_local
84+
workspace = 5c81f3a6-0e27-4b94-8d15-a7f60c39b2e8
8585

8686
[profile acme]
8787
auth_profile = default
88-
workspace = ws_acme
88+
workspace = 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
8989
```
9090

9191
Keys live in `~/.sim/credentials`, written `0600`:
@@ -132,17 +132,17 @@ filesystem at all.
132132
Workspace-scoped commands need a workspace:
133133

134134
```bash
135-
sim tables list --workspace ws_other
136-
sim configure --set-workspace ws_abc123
137-
export SIM_WORKSPACE=ws_abc123
135+
sim tables list --workspace 9b4c7e02-1d58-4f36-a0c9-6e2b85df413a
136+
sim configure --set-workspace 2f6d0b1c-8a34-4d92-b7e5-31c8a0f45d67
137+
export SIM_WORKSPACE=2f6d0b1c-8a34-4d92-b7e5-31c8a0f45d67
138138
```
139139

140140
For a reusable selection, create a workspace profile backed by the current
141141
stored login:
142142

143143
```bash
144144
sim workspaces list
145-
sim profile add acme --workspace ws_acme
145+
sim profile add acme --workspace 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
146146
sim --profile acme tables list
147147
```
148148

apps/docs/content/docs/en/cli/index.mdx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ sim workflows list
7777
```
7878

7979
```
80-
ID NAME FOLDER DEPLOYED RUNS LAST RUN
81-
wf_7Yb2 Refund triage /Support yes 412 2026-08-15 14:02:11
82-
wf_9Kd4 Weekly digest /Reporting no 18 2026-08-11 09:00:04
80+
ID NAME FOLDER DEPLOYED RUNS LAST RUN
81+
3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 Refund triage /Support yes 412 2026-08-15 14:02:11
82+
b8c0d247-9e13-4a86-97f5-2ad4e1638c09 Weekly digest /Reporting no 18 2026-08-11 09:00:04
8383
```
8484
</Step>
8585

8686
<Step>
8787
### Run one
8888

8989
```bash
90-
sim workflows run wf_7Yb2 --input '{"ticketId":"T-4821"}'
90+
sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --input '{"ticketId":"T-4821"}'
9191
```
9292

9393
A workflow must be deployed before it can be run. Deploy from the editor, or
@@ -106,8 +106,8 @@ sim <resource> [sub-resource] <verb> [arguments] [options]
106106

107107
```bash
108108
sim workflows list
109-
sim tables rows query tbl_123 --limit 50
110-
sim knowledge documents upload kb_123 ./handbook.pdf
109+
sim tables rows query tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --limit 50
110+
sim knowledge documents upload 4c1b7f60-2d55-4a3e-9c18-70b6ea2f9d31 ./handbook.pdf
111111
```
112112

113113
Resource groups are plural, and each also accepts its singular spelling —
@@ -146,8 +146,10 @@ sim tables rows query --help
146146
| [`workflow-mcp-servers`](/cli/workflow-mcp-servers) | Publish workflows as MCP tools for outside agents |
147147
| [`meta`](/cli/meta) | Check what this API supports and which limits apply |
148148

149-
The [command reference](/cli/commands) documents every subcommand, argument, and
150-
flag, and is generated from the CLI itself.
149+
The [command overview](/cli/commands) has the global options and the commands
150+
that take no resource; the [complete reference](/cli/reference) documents every
151+
subcommand, argument, and flag on one page. Both are generated from the CLI
152+
itself.
151153

152154
## Where to go next
153155

@@ -156,4 +158,5 @@ flag, and is generated from the CLI itself.
156158
- [Output formats](/cli/output)`table`, `json`, `yaml`, and `text`, and when to use each
157159
- [Scripting](/cli/scripting) — piping, file inputs, exit codes, and automation recipes
158160
- [Troubleshooting](/cli/troubleshooting) — what each error means, and how to resolve it
159-
- [Command reference](/cli/commands) — every command, argument, and flag
161+
- [Command overview](/cli/commands) — global options, the command groups, and the commands that take no resource
162+
- [Complete reference](/cli/reference) — every command, argument, and flag on a single page

apps/docs/content/docs/en/cli/output.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Every command renders through the same four formats.
1515
Select one per command, save it to the profile, or set it in the environment:
1616

1717
```bash
18-
sim tables get tbl_123 --output json
18+
sim tables get tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --output json
1919
sim configure --set-output json
2020
SIM_OUTPUT=yaml sim logs list > logs.yaml
2121
```
@@ -47,14 +47,14 @@ An absent value is an em-dash in `table` and an empty field in `text`.
4747
with span inputs, outputs, errors, timing, and cost:
4848

4949
```bash
50-
sim logs get run_123 --trace
50+
sim logs get 9c4f0b7e-2d81-4a35-b6e9-70f1c8a2d543 --trace
5151
```
5252

5353
`json` and `yaml` always carry the complete response, so `--trace` is a no-op
5454
there:
5555

5656
```bash
57-
sim logs get run_123 --output json | jq '.traceSpans'
57+
sim logs get 9c4f0b7e-2d81-4a35-b6e9-70f1c8a2d543 --output json | jq '.traceSpans'
5858
```
5959

6060
## Exceptions
@@ -66,6 +66,6 @@ configuration, not API data.
6666
so that it round-trips through `import`:
6767

6868
```bash
69-
sim workflows export wf_123 > wf.json
69+
sim workflows export 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 > wf.json
7070
sim workflows import --workflow @wf.json
7171
```

apps/docs/content/docs/en/cli/scripting.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ to read stdin.
1414

1515
```bash
1616
sim workflows import --workflow @wf.json
17-
sim tables rows query tbl_123 --filter @filter.json
17+
sim tables rows query tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --filter @filter.json
1818
cat wf.json | sim workflows import --workflow @-
1919
```
2020

@@ -24,9 +24,9 @@ Primitive lists take space-separated values. With `@`, the file supplies one
2424
value per line:
2525

2626
```bash
27-
sim files mv --file-ids file_1 file_2 --to Archive
27+
sim files mv --file-ids wf_3Qm8ZtLpR2yVnKd7BsXwC wf_5Hn1JvTqW9xUcMb4RzPgL --to Archive
2828
sim files mv --file-ids @file-ids.txt --to Archive
29-
printf 'file_1\nfile_2\n' | sim files mv --file-ids @- --to Archive
29+
printf 'wf_3Qm8ZtLpR2yVnKd7BsXwC\nwf_5Hn1JvTqW9xUcMb4RzPgL\n' | sim files mv --file-ids @- --to Archive
3030
```
3131

3232
Arrays of objects stay JSON.
@@ -37,7 +37,7 @@ Arrays of objects stay JSON.
3737
groups of `{field, op, value}` conditions, nestable.
3838

3939
```bash
40-
sim tables rows query tbl_123 \
40+
sim tables rows query tbl_9f3c1a05d4b7426e8c2f0917ab35de64 \
4141
--filter '{"all":[{"field":"status","op":"eq","value":"open"},
4242
{"field":"score","op":"gt","value":10}]}' \
4343
--limit 50
@@ -50,7 +50,7 @@ Operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`, `contains`,
5050
`--sort` is also JSON, an ordered list of keys:
5151

5252
```bash
53-
sim tables rows query tbl_123 --sort '[{"field":"createdAt","direction":"desc"}]'
53+
sim tables rows query tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --sort '[{"field":"createdAt","direction":"desc"}]'
5454
```
5555

5656
## Pagination
@@ -68,8 +68,8 @@ Deletions require an explicit selector **and** `--yes`. There is no "delete
6868
everything" default:
6969

7070
```bash
71-
sim tables rows batch-delete tbl_123 --row row_1 row_2 --yes
72-
sim files delete file_123 --yes
71+
sim tables rows batch-delete tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --row row_2f81c0a94db54e6f8a13c7e0526bd94a row_6b3e59d0af1c42d7b80e94f3a271c568 --yes
72+
sim files delete wf_8Kd2NpVrY6zTfQa3XwBmS --yes
7373
```
7474

7575
Without `--yes` the command explains what it would have destroyed and stops.
@@ -92,7 +92,7 @@ Errors print one line to stderr, prefixed `Error:`, plus the API's error code an
9292
validation details when it supplies them. Failures are safe to branch on:
9393

9494
```bash
95-
if ! sim workflows run wf_7Yb2 --output json > result.json; then
95+
if ! sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --output json > result.json; then
9696
echo "run failed" >&2
9797
exit 1
9898
fi
@@ -121,17 +121,17 @@ esac
121121
produce are simply omitted:
122122

123123
```bash
124-
sim workflows run wf_7Yb2 --select-output agent_1.content --output json
124+
sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --select-output agent_1.content --output json
125125
```
126126

127127
## Polling a long run
128128

129129
Start the run asynchronously, then poll its status:
130130

131131
```bash
132-
run_id=$(sim workflows run wf_7Yb2 --async --output json | jq -r '.runId')
132+
run_id=$(sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --async --output json | jq -r '.runId')
133133

134-
until sim workflows runs get "$run_id" --workflow wf_7Yb2 --output json \
134+
until sim workflows runs get "$run_id" --workflow 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --output json \
135135
| jq -e '.status | IN("completed","failed","cancelled")' > /dev/null; do
136136
sleep 5
137137
done
@@ -169,9 +169,9 @@ export SIM_API_KEY="${SIM_API_KEY:?missing}"
169169
export SIM_WORKSPACE="${SIM_WORKSPACE:?missing}"
170170
export SIM_OUTPUT=json
171171

172-
run_id=$(sim workflows run wf_7Yb2 --input '{"source":"nightly"}' | jq -r '.runId')
172+
run_id=$(sim workflows run 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 --input '{"source":"nightly"}' | jq -r '.runId')
173173

174-
if [ "$(sim workflows runs get "$run_id" --workflow wf_7Yb2 | jq -r '.status')" != "completed" ]; then
174+
if [ "$(sim workflows runs get "$run_id" --workflow 3a9e21d8-5f47-4c0b-b2ea-91d7c6034ef8 | jq -r '.status')" != "completed" ]; then
175175
sim logs get "$run_id" >&2
176176
exit 1
177177
fi

apps/docs/content/docs/en/cli/troubleshooting.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Your shell consumed the quotes. Wrap the whole value in single quotes, or read i
5353
from a file:
5454

5555
```bash
56-
sim tables rows query tbl_123 --filter '{"all":[{"field":"status","op":"eq","value":"open"}]}'
57-
sim tables rows query tbl_123 --filter @filter.json
56+
sim tables rows query tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --filter '{"all":[{"field":"status","op":"eq","value":"open"}]}'
57+
sim tables rows query tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --filter @filter.json
5858
```
5959

6060
## A value looks truncated
@@ -63,7 +63,7 @@ sim tables rows query tbl_123 --filter @filter.json
6363
switch to a machine format to see it in full:
6464

6565
```bash
66-
sim logs get run_123 --output json
66+
sim logs get 9c4f0b7e-2d81-4a35-b6e9-70f1c8a2d543 --output json
6767
```
6868

6969
## `sim files get` refuses to print to the terminal
@@ -72,8 +72,8 @@ Writing arbitrary binary to an interactive terminal can corrupt it, so non-text
7272
content has to go to a file or a pipe:
7373

7474
```bash
75-
sim files get file_123 -o ./image.png
76-
sim files get file_123 | shasum
75+
sim files get wf_8Kd2NpVrY6zTfQa3XwBmS -o ./image.png
76+
sim files get wf_8Kd2NpVrY6zTfQa3XwBmS | shasum
7777
```
7878

7979
## A stored output format is invalid

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"test:icon-path-precision": "bunx vitest run scripts/check-icon-path-precision.test.ts",
2020
"test:tool-registry-boundary": "bunx vitest run scripts/check-tool-registry-boundary.test.ts",
2121
"test:tool-request-boundary": "bunx vitest run scripts/check-tool-request-boundary.test.ts",
22-
"test:generators": "bunx vitest run scripts/generate-v2-cli-api.test.ts scripts/generate-docs.test.ts",
22+
"test:generators": "bunx vitest run scripts/generate-v2-cli-api.test.ts scripts/generate-cli-docs.test.ts scripts/generate-docs.test.ts",
2323
"format": "turbo run format",
2424
"format:check": "turbo run format:check",
2525
"lint": "turbo run lint",

0 commit comments

Comments
 (0)