sim 2.1.2-preview.46.1 → 2.1.2
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.
- package/README.md +184 -337
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,426 +1,273 @@
|
|
|
1
1
|
# Sim CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`sim` is the command-line client for [Sim](https://sim.ai), a workspace for
|
|
4
|
+
building, deploying, and managing AI agents and workflows.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Full documentation: **https://docs.sim.ai/cli**
|
|
12
|
-
|
|
13
|
-
## Profiles
|
|
6
|
+
Use the CLI to work with an existing Sim account or self-hosted deployment from
|
|
7
|
+
your terminal. You can run workflows, inspect logs, query tables, manage files
|
|
8
|
+
and knowledge bases, and configure workspace resources. The CLI does not install
|
|
9
|
+
or run Sim itself; see the
|
|
10
|
+
[self-hosting guide](https://docs.sim.ai/platform/self-hosting/docker) if you need
|
|
11
|
+
to set up a Sim deployment.
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
`SIM_PROFILE`. A profile normally owns one identity and one set of defaults; a
|
|
17
|
-
workspace profile can instead share a stored identity through `auth_profile`.
|
|
13
|
+
## Install
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
The CLI requires Node.js 20 or newer.
|
|
20
16
|
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
workspace = b7f4a1c3-9e02-4d68-8a5b-1c3f6d90e274
|
|
25
|
-
output = table
|
|
26
|
-
|
|
27
|
-
[profile dev]
|
|
28
|
-
endpoint = http://localhost:3000
|
|
29
|
-
workspace = a3c81b02-5f4d-4e19-9d7a-2b6c1e084f55
|
|
30
|
-
|
|
31
|
-
[profile acme]
|
|
32
|
-
auth_profile = default
|
|
33
|
-
workspace = 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Keys live in `~/.sim/credentials`, written `0600`:
|
|
37
|
-
|
|
38
|
-
```ini
|
|
39
|
-
[default]
|
|
40
|
-
api_key = sim_…
|
|
41
|
-
|
|
42
|
-
[dev]
|
|
43
|
-
api_key = sim_…
|
|
17
|
+
```bash
|
|
18
|
+
npm install --global sim
|
|
19
|
+
sim --version
|
|
44
20
|
```
|
|
45
21
|
|
|
46
|
-
|
|
47
|
-
— is the AWS convention, kept so existing habits and tooling carry over.
|
|
22
|
+
You can also run a command without installing the package globally:
|
|
48
23
|
|
|
49
24
|
```bash
|
|
50
|
-
sim
|
|
51
|
-
sim configure --set-workspace a3c81b02-5f4d-4e19-9d7a-2b6c1e084f55 --profile dev
|
|
52
|
-
|
|
53
|
-
sim profiles # list them; * marks the active one
|
|
54
|
-
sim whoami # resolved values, where each came from, and whether they work
|
|
55
|
-
|
|
56
|
-
# Share the active stored login with a second workspace
|
|
57
|
-
sim profile add acme --workspace 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
|
|
25
|
+
npx sim --help
|
|
58
26
|
```
|
|
59
27
|
|
|
60
|
-
|
|
61
|
-
name suggested. A typo used to fall through to the built-in defaults, so
|
|
62
|
-
`--profile stagng` talked to production and handed it whatever key resolved.
|
|
63
|
-
The two exceptions are the commands whose job is to create a profile:
|
|
64
|
-
`sim login --profile new` and `sim configure --profile new` still accept a name
|
|
65
|
-
that does not exist yet.
|
|
28
|
+
## Get started
|
|
66
29
|
|
|
67
|
-
|
|
30
|
+
Sign in to the default profile:
|
|
68
31
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
| --- | --- |
|
|
73
|
-
| 1 | Command-line flag (`--endpoint`, `--workspace`, `--output`) |
|
|
74
|
-
| 2 | Environment (`SIM_ENDPOINT`, `SIM_API_KEY`, `SIM_WORKSPACE`, `SIM_OUTPUT`) |
|
|
75
|
-
| 3 | `~/.sim/config` for the selected profile and credentials for its `auth_profile`, when set |
|
|
76
|
-
| 4 | Built-in default (`https://www.sim.ai`, `table`) |
|
|
77
|
-
|
|
78
|
-
`SIM_TIMEOUT_SECONDS` bounds each request (default `3600`, `0` waits
|
|
79
|
-
indefinitely) and `SIM_DEBUG=1` traces requests to stderr. Node ignores
|
|
80
|
-
`HTTPS_PROXY` unless `NODE_USE_ENV_PROXY=1` is also set, on Node 22.21+ or
|
|
81
|
-
24.5+; the CLI warns when a proxy is configured but will not be used.
|
|
82
|
-
|
|
83
|
-
Formats are listed under [Output formats](#output-formats).
|
|
32
|
+
```bash
|
|
33
|
+
sim login
|
|
34
|
+
```
|
|
84
35
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
36
|
+
The CLI opens a browser and prints a pairing code. Confirm that the code in the
|
|
37
|
+
browser matches the one in your terminal, approve the login, and choose a
|
|
38
|
+
workspace. The selected workspace becomes the default for this profile.
|
|
88
39
|
|
|
89
|
-
|
|
40
|
+
The login stores a personal API key locally. It does not start a local callback
|
|
41
|
+
server, so the same flow works over SSH and in containers. Use
|
|
42
|
+
`sim login --no-browser` when the browser is on another machine.
|
|
90
43
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
| `0` | The key works and reached the configured workspace |
|
|
94
|
-
| `1` | The credentials are wrong — no key stored, or the API refused it |
|
|
95
|
-
| `2` | The check could not be made — nothing to check against, or the endpoint did not answer |
|
|
44
|
+
Check the active profile and verify that its endpoint, API key, and workspace
|
|
45
|
+
work together:
|
|
96
46
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
47
|
+
```bash
|
|
48
|
+
sim whoami
|
|
49
|
+
```
|
|
100
50
|
|
|
101
|
-
|
|
51
|
+
This also reports whether the active key is personal or workspace-scoped. Some
|
|
52
|
+
administrative and deployment operations require a personal key.
|
|
102
53
|
|
|
103
|
-
|
|
104
|
-
prints a pairing code and a URL, you approve in a browser, and the key comes back
|
|
105
|
-
over the CLI's own connection. Nothing redeemable crosses the browser leg, and
|
|
106
|
-
there is no loopback listener — so it works over SSH and inside containers.
|
|
54
|
+
Then list and run workflows:
|
|
107
55
|
|
|
56
|
+
```bash
|
|
57
|
+
sim workflows list
|
|
58
|
+
sim workflows run <workflowId> --input '{"ticketId":"T-4821"}'
|
|
108
59
|
```
|
|
109
|
-
$ sim login --profile dev --endpoint http://localhost:3000
|
|
110
60
|
|
|
111
|
-
|
|
112
|
-
Confirm this code matches what the browser shows before approving.
|
|
61
|
+
A workflow must be deployed before it can run:
|
|
113
62
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
✓ Logged in. Key stored in /Users/you/.sim/credentials
|
|
118
|
-
Personal key, defaulting to a3c81b02-5f4d-4e19-9d7a-2b6c1e084f55.
|
|
119
|
-
Override per command with --workspace.
|
|
63
|
+
```bash
|
|
64
|
+
sim workflows deploy <workflowId>
|
|
120
65
|
```
|
|
121
66
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
limit the key to that workspace. Use `--workspace` to target another workspace
|
|
126
|
-
the key can access.
|
|
67
|
+
Workflow, knowledge-base, and workspace IDs are UUIDs. Table IDs start with
|
|
68
|
+
`tbl_`; file IDs start with `wf_`. Despite the prefix, `wf_` identifies a file,
|
|
69
|
+
not a workflow.
|
|
127
70
|
|
|
128
|
-
|
|
129
|
-
existing profile's workspace preselects itself on re-login.
|
|
130
|
-
|
|
131
|
-
### Personal and workspace keys
|
|
71
|
+
## Profiles
|
|
132
72
|
|
|
133
|
-
|
|
134
|
-
knowledge connectors, knowledge tag writes, `chat`, `audit-logs`, and most
|
|
135
|
-
workflow deployment writes. A workspace-scoped key gets a `FORBIDDEN` response
|
|
136
|
-
on those, under one of two codes:
|
|
73
|
+
A profile is a named CLI configuration. It determines:
|
|
137
74
|
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
through workspace authorization at all. `audit-logs` is the one in this list.
|
|
75
|
+
- which Sim deployment to use
|
|
76
|
+
- which API key to authenticate with
|
|
77
|
+
- which workspace to target by default
|
|
78
|
+
- how command output is formatted
|
|
143
79
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
same thing as `personal` or `workspace` alongside the rest of the key's state:
|
|
80
|
+
If you do not specify a profile, the CLI uses `default`. Select another profile
|
|
81
|
+
with `--profile`, its short form `-P`, or `SIM_PROFILE`:
|
|
147
82
|
|
|
148
83
|
```bash
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"keyType": "personal",
|
|
153
|
-
"expiresAt": null
|
|
154
|
-
}
|
|
84
|
+
sim workflows list --profile production
|
|
85
|
+
sim -P production logs list
|
|
86
|
+
SIM_PROFILE=production sim tables list
|
|
155
87
|
```
|
|
156
88
|
|
|
157
|
-
|
|
158
|
-
|
|
89
|
+
Unknown profile names fail with the configured profile list and a suggested
|
|
90
|
+
match when available. `login` and `configure` are the exceptions because they
|
|
91
|
+
can create a new profile.
|
|
159
92
|
|
|
160
|
-
|
|
161
|
-
its authentication profile's key; use `sim logout --all --profile <name>` to
|
|
162
|
-
remove only the workspace profile. An authentication profile cannot be removed
|
|
163
|
-
entirely while workspace profiles reference it. Logging out does not revoke a
|
|
164
|
-
key — do that in Settings → API keys.
|
|
93
|
+
There are two common ways to create profiles.
|
|
165
94
|
|
|
166
|
-
|
|
95
|
+
### Use one login with several workspaces
|
|
167
96
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
[docs.sim.ai/cli/commands](https://docs.sim.ai/cli/commands).
|
|
171
|
-
|
|
172
|
-
Plural resource names are canonical. Most plural top-level resource groups also
|
|
173
|
-
accept their singular form — `sim table list`, `sim file get`, and
|
|
174
|
-
`sim workflow get` are equivalent to their plural spellings. The groups with a
|
|
175
|
-
singular alias are `audit-logs`, `credentials`, `custom-tools`, `files`, `logs`,
|
|
176
|
-
`mcp-servers`, `secrets`, `skills`, `tables`, `workflows`, and `workspaces`;
|
|
177
|
-
`blocks`, `tools`, `chat-deployments`, `connector-types`, and
|
|
178
|
-
`workflow-mcp-servers` are plural-only. `sim --help` lists each group with the
|
|
179
|
-
aliases it actually accepts.
|
|
180
|
-
|
|
181
|
-
`knowledge` also accepts the shorter `kb` alias.
|
|
97
|
+
After `sim login`, create another profile that shares the active profile's API
|
|
98
|
+
key but has its own default workspace:
|
|
182
99
|
|
|
183
100
|
```bash
|
|
184
|
-
sim workflows ls [path] [--search <text>] [--limit <n>]
|
|
185
|
-
sim workflows list [--folder <path>] [--deployed-only] [--limit <n>]
|
|
186
|
-
sim workflows get <id>
|
|
187
|
-
sim workflows update <id> [--name <name>] [--description <text>] [--folder <path>]
|
|
188
|
-
sim workflows mv <id> <folder>
|
|
189
|
-
sim workflows deploy|undeploy|rollback <id>
|
|
190
|
-
sim workflows run <id> [--input <json|@file>] [--select-output <path>…] [--async]
|
|
191
|
-
sim workflows runs list --workflow <workflowId> [--status <status>]
|
|
192
|
-
sim workflows runs get <runId> --workflow <workflowId> [--include-output]
|
|
193
|
-
sim workflows runs cancel <runId> --workflow <workflowId>
|
|
194
|
-
sim workflows runs resume <runId> --workflow <workflowId> --context <contextId> [--input <json|@file>]
|
|
195
|
-
|
|
196
|
-
sim logs list [--level error] [--workflow <id>…] [--trigger <name>…] [--start-date <date>]
|
|
197
|
-
sim logs get <runId>
|
|
198
|
-
|
|
199
|
-
sim audit-logs list [--organization <organizationId>] [--all-workspaces]
|
|
200
|
-
sim audit-logs get <id> [--organization <organizationId>]
|
|
201
|
-
|
|
202
101
|
sim workspaces list
|
|
203
|
-
sim
|
|
204
|
-
sim
|
|
205
|
-
|
|
206
|
-
sim tables ls [path] [--search <text>] [--limit <n>]
|
|
207
|
-
sim tables list [--folder <path>]
|
|
208
|
-
sim tables get <tableId>
|
|
209
|
-
sim tables update <tableId> [--name <name>] [--description <text>] [--folder <path>]
|
|
210
|
-
sim tables mv <tableId> <folder>
|
|
211
|
-
sim tables columns create|update|delete|run <tableId>
|
|
212
|
-
sim tables rows list <tableId> [--limit <n>]
|
|
213
|
-
sim tables rows create <tableId> --data <json|@file>
|
|
214
|
-
sim tables rows create <tableId> --rows <json|@file>
|
|
215
|
-
sim tables rows query <tableId> [--filter <json>] [--sort <json>] [--limit <n>]
|
|
216
|
-
sim tables rows query <tableId> --filter '{"all":[{"field":"status","op":"eq","value":"active"}]}'
|
|
217
|
-
sim tables upsert <tableId> --data <json>
|
|
218
|
-
sim tables rows batch-delete <tableId> (--row <id>… | --filter <json>) --yes
|
|
219
|
-
|
|
220
|
-
sim files ls [path] [--search <text>] [--limit <n>]
|
|
221
|
-
sim files list [--folder <path>]
|
|
222
|
-
sim files describe <fileId>
|
|
223
|
-
sim files get <fileId> [-o <path>] # stdout by default
|
|
224
|
-
sim files create --name <name> [--folder <path>] [--content <value>] [--encoding utf-8|base64]
|
|
225
|
-
sim files upload <path> [--name <name>] [--folder <path>]
|
|
226
|
-
sim files share get <fileId>
|
|
227
|
-
sim files share set <fileId> --is-active <true|false> [--auth-type public|password|email|sso]
|
|
228
|
-
sim files mv --file-ids <id>… [--to <path>]
|
|
229
|
-
sim files batch-delete --file-ids <id>… --yes
|
|
230
|
-
sim files delete <fileId> --yes
|
|
231
|
-
|
|
232
|
-
sim knowledge ls [path] [--search <text>] [--limit <n>]
|
|
233
|
-
sim knowledge list [--folder <path>]
|
|
234
|
-
sim knowledge get <id>
|
|
235
|
-
sim knowledge update <id> [--name <name>] [--description <text>] [--folder <path>]
|
|
236
|
-
sim knowledge mv <id> <folder>
|
|
237
|
-
sim knowledge search --query <text> --kb <id>… [--search-mode vector|hybrid]
|
|
238
|
-
|
|
239
|
-
sim knowledge documents list <knowledgeBaseId> [--search <text>]
|
|
240
|
-
sim knowledge documents get <knowledgeBaseId> <documentId>
|
|
241
|
-
sim knowledge documents upload <knowledgeBaseId> <path> [--tag <value>...]
|
|
242
|
-
sim knowledge documents update <knowledgeBaseId> <documentId> [--filename <name>] [--enabled]
|
|
243
|
-
sim knowledge documents batch-update <knowledgeBaseId> --operation enable|disable
|
|
244
|
-
sim knowledge documents delete <knowledgeBaseId> <documentId> --yes
|
|
245
|
-
|
|
246
|
-
sim billing status [--all-workspaces]
|
|
247
|
-
sim billing logs [--period 7d] [--source sim-chat] [--limit <n>] [--all-workspaces]
|
|
102
|
+
sim profile add acme --workspace <workspaceId>
|
|
103
|
+
sim --profile acme whoami
|
|
248
104
|
```
|
|
249
105
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
`--all-workspaces` otherwise default to the workspace in the active profile.
|
|
106
|
+
If you omit `--workspace` in an interactive terminal, the CLI asks you to choose
|
|
107
|
+
one. The new profile stores an `auth_profile` reference to the active login; it
|
|
108
|
+
does not copy the API key.
|
|
254
109
|
|
|
255
|
-
|
|
256
|
-
`--workflow` names the parent resource, while the run ID remains positional.
|
|
257
|
-
For a paused run, its status includes the context ID needed by `resume`.
|
|
258
|
-
`logs get` is the full diagnostic resource. It keeps the default human output
|
|
259
|
-
concise; add `--trace` for the expanded recursive trace with span inputs,
|
|
260
|
-
outputs, errors, timing, and cost. JSON and YAML retain the complete structured
|
|
261
|
-
response.
|
|
110
|
+
### Use a separate account or deployment
|
|
262
111
|
|
|
263
|
-
`
|
|
264
|
-
|
|
112
|
+
Run `login` with a new profile name. Add `--endpoint` when the profile should use
|
|
113
|
+
a self-hosted or local deployment:
|
|
265
114
|
|
|
266
115
|
```bash
|
|
267
|
-
sim
|
|
268
|
-
sim
|
|
269
|
-
sim logs list --include-trace-spans --output json
|
|
116
|
+
sim login --profile work
|
|
117
|
+
sim login --profile local --endpoint http://localhost:3000
|
|
270
118
|
```
|
|
271
119
|
|
|
272
|
-
|
|
273
|
-
|
|
120
|
+
Each of these profiles stores its own API key. The endpoint selected during
|
|
121
|
+
login is saved with the profile.
|
|
274
122
|
|
|
275
|
-
|
|
276
|
-
that folder's direct child folders. It never includes deeper descendants. Its
|
|
277
|
-
`ref` column is the resource ID or canonical folder path to pass to the next
|
|
278
|
-
command. Use `list` when you want resources only, or `folders ls` when you want
|
|
279
|
-
folders only.
|
|
280
|
-
|
|
281
|
-
Each folder-backed resource has the same path commands:
|
|
123
|
+
### View and change profiles
|
|
282
124
|
|
|
283
125
|
```bash
|
|
284
|
-
sim
|
|
285
|
-
sim
|
|
286
|
-
sim
|
|
287
|
-
sim
|
|
288
|
-
sim
|
|
289
|
-
sim
|
|
290
|
-
sim tables folders delete Archive --recursive --yes
|
|
126
|
+
sim profiles
|
|
127
|
+
sim configure --profile work
|
|
128
|
+
sim configure --profile work --set-workspace <workspaceId>
|
|
129
|
+
sim configure --profile work --set-output json
|
|
130
|
+
sim configure --profile local --set-endpoint http://localhost:3000
|
|
131
|
+
sim whoami --profile work
|
|
291
132
|
```
|
|
292
133
|
|
|
293
|
-
`
|
|
294
|
-
|
|
295
|
-
returns the canonical leading-slash form. Omit the `ls` path to list root.
|
|
296
|
-
|
|
297
|
-
### List inputs
|
|
134
|
+
`sim profiles` marks the active profile with `*`. Running `sim configure` with
|
|
135
|
+
no setting flags prints the saved settings for that profile.
|
|
298
136
|
|
|
299
|
-
|
|
300
|
-
|
|
137
|
+
Non-secret settings are stored in `~/.sim/config`. API keys are stored separately
|
|
138
|
+
in `~/.sim/credentials`, which is written with `0600` permissions. Set
|
|
139
|
+
`SIM_CONFIG_DIR` to use a different directory.
|
|
301
140
|
|
|
302
|
-
|
|
303
|
-
sim files mv --file-ids wf_3Kq9tVbN2xLpR7sWmZ4dY wf_8Jd5cHy1QnT6vXbA0rEuP --to Archive
|
|
304
|
-
sim files mv --file-ids @file-ids.txt --to Archive
|
|
305
|
-
printf 'wf_3Kq9tVbN2xLpR7sWmZ4dY\nwf_8Jd5cHy1QnT6vXbA0rEuP\n' | sim files mv --file-ids @- --to Archive
|
|
306
|
-
```
|
|
141
|
+
For each setting, the CLI uses the first available value in this order:
|
|
307
142
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
143
|
+
1. command-line flag
|
|
144
|
+
2. environment variable
|
|
145
|
+
3. selected profile
|
|
146
|
+
4. built-in default
|
|
311
147
|
|
|
312
|
-
|
|
313
|
-
flat list without losing structure.
|
|
148
|
+
`sim whoami` shows both the resolved values and where each one came from.
|
|
314
149
|
|
|
315
|
-
|
|
150
|
+
## Useful commands
|
|
316
151
|
|
|
317
|
-
|
|
318
|
-
secret inline exposes it to shell history and to anything reading the process
|
|
319
|
-
list, so prefer a file or stdin; the contents are sent verbatim, with no
|
|
320
|
-
trimming. A value that genuinely begins with `@` is written `@@`, and only the
|
|
321
|
-
leading `@` is dropped. Omit `--value` entirely and the terminal prompts for it
|
|
322
|
-
without echoing.
|
|
152
|
+
Run `--help` at any level to see the available subcommands and flags:
|
|
323
153
|
|
|
324
154
|
```bash
|
|
325
|
-
sim
|
|
326
|
-
|
|
327
|
-
sim
|
|
155
|
+
sim --help
|
|
156
|
+
sim workflows --help
|
|
157
|
+
sim tables rows query --help
|
|
328
158
|
```
|
|
329
159
|
|
|
330
|
-
|
|
331
|
-
model-visible content; `--no-unredacted` restores redaction. Omit both and the
|
|
332
|
-
secret keeps whatever it had. Both apply only to `--scope workspace`.
|
|
160
|
+
The commands you will use most often are:
|
|
333
161
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
sim
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
162
|
+
| Task | Command |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| Ask Sim about the workspace | `sim chat "Which workflows failed today?"` |
|
|
165
|
+
| List or inspect workflows | `sim workflows list`, `sim workflows get <workflowId>` |
|
|
166
|
+
| Deploy or run a workflow | `sim workflows deploy <workflowId>`, `sim workflows run <workflowId>` |
|
|
167
|
+
| Follow a workflow run | `sim workflows run <workflowId> --follow` |
|
|
168
|
+
| Inspect workflow runs | `sim workflows runs list --workflow <workflowId>` |
|
|
169
|
+
| Find errors | `sim logs list --level error`, `sim logs follow` |
|
|
170
|
+
| Inspect a run trace | `sim logs get <runId> --trace` |
|
|
171
|
+
| Work with tables | `sim tables list`, `sim tables rows query <tableId>` |
|
|
172
|
+
| Import a CSV | `sim tables import ./data.csv` |
|
|
173
|
+
| Upload or download files | `sim files upload ./report.pdf`, `sim files get <fileId>` |
|
|
174
|
+
| Search knowledge bases | `sim knowledge search --query "refund policy" --kb <knowledgeBaseId>` |
|
|
175
|
+
| Upload a knowledge document | `sim knowledge documents upload <knowledgeBaseId> ./handbook.pdf` |
|
|
176
|
+
| Manage integration credentials | `sim credentials --help` |
|
|
177
|
+
| Manage workspace secrets | `sim secrets list`, `sim secrets set <name>` |
|
|
178
|
+
|
|
179
|
+
Commands follow this general shape:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
sim <resource> [sub-resource] <verb> [arguments] [options]
|
|
345
183
|
```
|
|
346
184
|
|
|
347
|
-
|
|
348
|
-
`
|
|
185
|
+
Many plural top-level resource names also accept a singular spelling, so
|
|
186
|
+
`sim workflow get <workflowId>` and `sim workflows get <workflowId>` are
|
|
187
|
+
equivalent. Not every group has a singular alias; `sim --help` shows the exact
|
|
188
|
+
aliases. `knowledge` also has the `kb` alias.
|
|
349
189
|
|
|
350
|
-
|
|
351
|
-
|
|
190
|
+
For workflows, tables, files, and knowledge bases, `list` returns resources
|
|
191
|
+
only. `ls [path]` returns the resources and direct child folders at a path:
|
|
352
192
|
|
|
353
|
-
|
|
354
|
-
|
|
193
|
+
```bash
|
|
194
|
+
sim workflows ls /Support
|
|
195
|
+
sim files ls /Reports
|
|
196
|
+
```
|
|
355
197
|
|
|
356
|
-
|
|
198
|
+
See the [command reference](https://docs.sim.ai/cli/commands) for every command,
|
|
199
|
+
argument, and flag.
|
|
357
200
|
|
|
358
|
-
|
|
359
|
-
default with `sim configure --set-output <format>`, or set ambiently with
|
|
360
|
-
`SIM_OUTPUT` for CI:
|
|
201
|
+
## JSON input and output
|
|
361
202
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
| `table` | reading (default) |
|
|
365
|
-
| `json` | piping into `jq` |
|
|
366
|
-
| `yaml` | piping into anything that reads YAML |
|
|
367
|
-
| `text` | shell loops — tab-separated, no header, no colour |
|
|
368
|
-
|
|
369
|
-
`json` and `yaml` emit the API's **raw** values, not the table's formatting — a
|
|
370
|
-
duration stays `1500`, not `"1.5s"` — so switching format never changes the data.
|
|
371
|
-
`text` uses the rendered cells, since it is meant for shell plumbing rather than
|
|
372
|
-
parsing.
|
|
203
|
+
Human-readable tables are the default. Use JSON or YAML when another program
|
|
204
|
+
will consume the result, and `text` for tab-separated shell output:
|
|
373
205
|
|
|
374
206
|
```bash
|
|
375
|
-
sim
|
|
376
|
-
sim
|
|
207
|
+
sim workflows list --output json
|
|
208
|
+
sim logs list --output json | jq -r '.[].runId'
|
|
209
|
+
SIM_OUTPUT=yaml sim tables get <tableId>
|
|
210
|
+
sim configure --set-output json
|
|
211
|
+
```
|
|
377
212
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
SIM_OUTPUT=yaml sim logs list --level error > logs.yaml
|
|
213
|
+
JSON-valued options accept inline JSON, a file prefixed with `@`, or stdin with
|
|
214
|
+
`@-`:
|
|
381
215
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
216
|
+
```bash
|
|
217
|
+
sim workflows run <workflowId> --input '{"customerId":"cus_123"}'
|
|
218
|
+
sim workflows run <workflowId> --input @input.json
|
|
219
|
+
printf '%s' '{"customerId":"cus_123"}' | sim workflows run <workflowId> --input @-
|
|
386
220
|
```
|
|
387
221
|
|
|
388
|
-
|
|
389
|
-
|
|
222
|
+
List-valued options use the same `@file` and `@-` forms, with one value per
|
|
223
|
+
line. Destructive commands require an explicit selector and `--yes`; they do not
|
|
224
|
+
default to deleting every resource when a selector is missing.
|
|
390
225
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
so `sim --output table configure --set-output json` can repair a profile.
|
|
226
|
+
For secret values, prefer a prompt, file, or stdin so the value does not appear
|
|
227
|
+
in shell history or the process list:
|
|
394
228
|
|
|
395
|
-
|
|
229
|
+
```bash
|
|
230
|
+
sim secrets set API_KEY --scope workspace
|
|
231
|
+
sim secrets set API_KEY --scope workspace --value @secret.txt
|
|
232
|
+
printf '%s' "$API_KEY" | sim secrets set API_KEY --scope workspace --value @-
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## CI and automation
|
|
396
236
|
|
|
397
|
-
|
|
398
|
-
`apps/sim/lib/api/contracts/v2/**` — the same contracts the routes validate
|
|
399
|
-
against, so a shape that disagrees with them is a shape the server would reject.
|
|
400
|
-
It holds every response/request type plus the operation table (method, path,
|
|
401
|
-
path params) the client dispatches through.
|
|
237
|
+
In CI, use an API key instead of `sim login`:
|
|
402
238
|
|
|
403
239
|
```bash
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
bun run check:openapi # CI: fails if the docs and contracts disagree
|
|
407
|
-
```
|
|
240
|
+
export SIM_API_KEY="sim_..."
|
|
241
|
+
export SIM_WORKSPACE="<workspaceId>"
|
|
408
242
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
does the crossing at build time.
|
|
243
|
+
sim workflows run <workflowId> --input @input.json --output json
|
|
244
|
+
```
|
|
412
245
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
accuracy. `check:openapi` reconciles them against the same contracts instead —
|
|
417
|
-
field by field, and it parses every documented example with the real Zod schema —
|
|
418
|
-
so the prose survives while drift still fails the build.
|
|
246
|
+
Create and revoke API keys in Sim under **Settings → API keys**, and store them
|
|
247
|
+
in your CI provider's secret store. `sim logout` only removes a stored key from
|
|
248
|
+
the current machine; it does not revoke the key.
|
|
419
249
|
|
|
420
|
-
|
|
250
|
+
The main environment variables are:
|
|
421
251
|
|
|
422
|
-
|
|
423
|
-
|
|
252
|
+
| Variable | Purpose |
|
|
253
|
+
| --- | --- |
|
|
254
|
+
| `SIM_PROFILE` | Profile to use |
|
|
255
|
+
| `SIM_ENDPOINT` | Sim deployment URL |
|
|
256
|
+
| `SIM_API_KEY` | API key, usually for CI |
|
|
257
|
+
| `SIM_WORKSPACE` | Workspace to target |
|
|
258
|
+
| `SIM_OUTPUT` | `table`, `json`, `yaml`, or `text` |
|
|
259
|
+
| `SIM_CONFIG_DIR` | Directory containing CLI config and credentials |
|
|
260
|
+
| `SIM_TIMEOUT_SECONDS` | Per-request timeout; `0` waits indefinitely |
|
|
261
|
+
| `SIM_DEBUG` | Print request diagnostics to stderr |
|
|
262
|
+
|
|
263
|
+
## Documentation
|
|
264
|
+
|
|
265
|
+
- [CLI documentation](https://docs.sim.ai/cli)
|
|
266
|
+
- [Command reference](https://docs.sim.ai/cli/commands)
|
|
267
|
+
- [Authentication](https://docs.sim.ai/cli/authentication)
|
|
268
|
+
- [Profiles and configuration](https://docs.sim.ai/cli/configuration)
|
|
269
|
+
- [Scripting](https://docs.sim.ai/cli/scripting)
|
|
270
|
+
- [Troubleshooting](https://docs.sim.ai/cli/troubleshooting)
|
|
424
271
|
|
|
425
272
|
## License
|
|
426
273
|
|