33Talk to the [ Sim] ( https://sim.ai ) API from your terminal.
44
55``` bash
6- npm install -g @sim/cli
6+ bun add --global @sim/cli
77sim login
88sim workflows list
99```
@@ -53,7 +53,7 @@ Each setting resolves independently, first match wins:
5353
5454| Rank | Source |
5555| --- | --- |
56- | 1 | Command-line flag (` --endpoint ` , ` --workspace ` ) |
56+ | 1 | Command-line flag (` --endpoint ` , ` --workspace ` , ` --output ` ) |
5757| 2 | Environment (` SIM_ENDPOINT ` , ` SIM_API_KEY ` , ` SIM_WORKSPACE ` , ` SIM_OUTPUT ` ) |
5858| 3 | ` ~/.sim/config ` / ` ~/.sim/credentials ` for the selected profile |
5959| 4 | Built-in default (` https://sim.ai ` , ` table ` ) |
@@ -112,12 +112,15 @@ also accepts its singular form: for example, `sim table list`,
112112` sim file download ` , and ` sim workflow get ` are equivalent to their plural
113113spellings.
114114
115+ ` knowledge ` also accepts the shorter ` kb ` alias.
116+
115117``` bash
116118sim workflows ls [path] [--search < text> ] [--limit < n> ]
117119sim workflows list [--folder < path> ] [--deployed-only] [--limit < n> ]
118120sim workflows get < id>
119121sim workflows mv < id> --folder < path>
120122sim workflows deploy| undeploy| rollback < id>
123+ sim workflows run < id> [--input < json| @file> ] [--select-output < path> …]
121124
122125sim logs list [--level error] [--workflow < id> …] [--trigger < name> …] [--start < date> ]
123126sim logs get < id>
@@ -129,7 +132,10 @@ sim tables get <tableId>
129132sim tables mv < tableId> --folder < path>
130133sim tables columns < tableId>
131134sim tables rows list < tableId> [--limit < n> ]
135+ sim tables rows create < tableId> --data < json| @file>
136+ sim tables rows create < tableId> --rows < json| @file>
132137sim tables rows query < tableId> [--filter < json> ] [--sort < json> ] [--limit < n> ]
138+ sim tables rows query < tableId> --filter ' {"all":[{"field":"status","op":"eq","value":"active"}]}'
133139sim tables upsert < tableId> --data < json>
134140sim tables rows batch-delete < tableId> (--row < id> … | --filter < json> ) --yes
135141
@@ -138,10 +144,10 @@ sim files list [--folder <path>]
138144sim files get < fileId>
139145sim files create --name < name> [--folder < path> ] [--content < value> ] [--encoding utf-8| base64]
140146sim files upload < path> [--name < name> ] [--folder < path> ]
141- sim files download < fileId> [-o < path> ]
147+ sim files download < fileId> [-o < path| - > ]
142148sim files mv --file-ids < id> … [--to < path> ]
143149sim files batch-delete --file-ids < id> … --yes
144- sim files delete < fileId>
150+ sim files delete < fileId> --yes
145151
146152sim knowledge ls [path] [--search < text> ] [--limit < n> ]
147153sim knowledge list [--folder < path> ]
@@ -150,8 +156,14 @@ sim knowledge mv <id> --folder <path>
150156sim knowledge documents < id> [--search < text> ]
151157sim knowledge documents upload < id> < path> [--tag < value> ...]
152158sim knowledge search --query < text> --kb < id> … [--search-mode vector| hybrid]
159+
160+ sim billing
161+ sim billing logs [--period 7d] [--limit < n> ]
153162```
154163
164+ Workflow output selectors use ` blockName.field ` syntax, such as
165+ ` --select-output agent_1.content ` ; fields that are not produced are omitted.
166+
155167` ls ` is a directory view: it combines the resources at its optional path with
156168that folder's direct child folders. It never includes deeper descendants. Its
157169` ref ` column is the resource ID or canonical folder path to pass to the next
@@ -166,14 +178,13 @@ sim tables folders ls --parent Reports
166178sim tables mkdir Reports/Quarterly
167179sim tables folders create Reports/Quarterly
168180sim tables folders mv Reports/Quarterly Archive/Quarterly
169- sim tables folders delete Archive/Quarterly --recursive false --yes
181+ sim tables folders delete Archive/Quarterly --yes
182+ sim tables folders delete Archive --recursive --yes
170183```
171184
172185` mkdir ` is the concise form of ` folders create ` . Replace ` tables ` with ` files ` ,
173- ` workflows ` , or ` knowledge ` . The leading ` / ` is optional on CLI inputs; the CLI
174- adds it before calling the API. Omit the ` ls ` path to list root. A slash that
175- belongs to a folder name is percent-encoded as ` %2F ` rather than treated as a
176- separator.
186+ ` workflows ` , or ` knowledge ` . The leading ` / ` is optional on API inputs; the API
187+ returns the canonical leading-slash form. Omit the ` ls ` path to list root.
177188
178189### List inputs
179190
@@ -210,9 +221,9 @@ everything" default.
210221
211222### Output formats
212223
213- Output format is a ** profile setting ** , not a per-command flag — there is no
214- ` --output ` . Set it once with ` sim configure --set-output <format> ` , or override
215- ambiently with ` SIM_OUTPUT ` for a one-off or for CI:
224+ Output format can be selected per command with ` --output ` , saved as a profile
225+ default with ` sim configure --set-output <format> ` , or set ambiently with
226+ ` SIM_OUTPUT ` for CI:
216227
217228| Format | For |
218229| --- | --- |
@@ -230,7 +241,8 @@ parsing.
230241sim configure --set-output json # for this profile, from now on
231242sim configure --set-output text --profile scripts # a profile dedicated to scripting
232243
233- SIM_OUTPUT=json sim logs list --level error | jq -r ' .[].executionId'
244+ sim --output json logs list --level error | jq -r ' .[].executionId'
245+ sim logs list --level error --output json | jq -r ' .[].executionId'
234246SIM_OUTPUT=yaml sim logs list --level error > logs.yaml
235247
236248SIM_OUTPUT=text sim files list | while IFS=$' \t ' read -r id name size type uploaded; do
241253An absent value is an em-dash in ` table ` and an ** empty field** in ` text ` , so
242254emptiness tests downstream behave.
243255
244- A bad ` SIM_OUTPUT ` or ` output = ` is ignored and falls back to ` table ` . Both are
245- ambient — set once, then read by every later command — so one bad value should
246- not break the CLI outright .
256+ An invalid active ` SIM_OUTPUT ` or ` output = ` value fails with the accepted
257+ formats. A valid higher-priority ` --output ` still overrides a stale lower tier,
258+ so ` sim --output table configure --set-output json ` can repair a profile .
247259
248260## How this stays in sync with the API
249261
0 commit comments