Skip to content

Commit a6c9b03

Browse files
feat(cli): add sim cli search and default output to JSON (#8426)
* feat(cli): add sim cli search and default output to JSON - sim cli search ranks every command in the tree against a plain-language query, locally via minisearch, and returns the top 5 - root and group --help open with a discovery note when a coding agent runs the CLI, pointing it at sim cli search - default output format is now json; table stays available via --output, SIM_OUTPUT, or sim configure --set-output - reword command descriptions that lacked the words people search with * fix(cli): describe billing status by what it reports, scope search privacy claim to the query * chore(cli): release 2.2.0
1 parent 113a204 commit a6c9b03

31 files changed

Lines changed: 448 additions & 52 deletions

‎apps/docs/content/docs/cli/billing.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { CommandTable } from '@/components/ui/command-table'
77

88
Every command below also accepts the [global options](/cli/commands#global-options).
99

10-
## Show billing status and current-period credit usage
10+
## Show billing status, credits spent this period, and storage used
1111

1212
```bash
1313
sim billing status [options]
1414
```
1515

16-
Show billing status and current-period credit usage (credits and storage require an OAuth login or personal API key)
16+
Show billing status, credits spent this period, and storage used (credits and storage require an OAuth login or personal API key)
1717

1818
**Options**
1919

‎apps/docs/content/docs/cli/cli.mdx‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: CLI
3+
description: Discover commands in this CLI — every subcommand, argument, and flag
4+
---
5+
6+
import { CommandTable } from '@/components/ui/command-table'
7+
8+
Every command below also accepts the [global options](/cli/commands#global-options).
9+
10+
## Find the command for a task, described in plain words
11+
12+
```bash
13+
sim cli search <query...>
14+
```
15+
16+
**Arguments**
17+
18+
<CommandTable>
19+
20+
| Argument | Required | Description |
21+
| --- | --- | --- |
22+
| `query...` | Yes | What you want to do, e.g. "cancel a workflow run" |
23+
24+
</CommandTable>

‎apps/docs/content/docs/cli/commands.mdx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ These apply to every command, and may be written before or after it.
3232
| --- | --- |
3333
| [`sim profiles`](/cli/profiles) | List profiles or add a workspace profile that shares a stored login |
3434
| [`sim telemetry`](/cli/telemetry) | Control anonymous usage reporting |
35+
| [`sim cli`](/cli/cli) | Discover commands in this CLI |
3536
| [`sim audit-logs`](/cli/audit-logs) | Manage audit logs |
3637
| [`sim billing`](/cli/billing) | Manage billing |
3738
| [`sim blocks`](/cli/blocks) | Manage blocks |
@@ -56,7 +57,7 @@ These apply to every command, and may be written before or after it.
5657
| [`sim workflows`](/cli/workflows) | Manage workflows |
5758
| [`sim workspaces`](/cli/workspaces) | Manage workspaces |
5859

59-
## Sign in through the browser and store the login for the profile
60+
## Log in through the browser and store the login for the profile
6061

6162
```bash
6263
sim login [options]
@@ -108,7 +109,7 @@ sim whoami [options]
108109

109110
</CommandTable>
110111

111-
## Set a profile's endpoint, default workspace, or output format
112+
## Switch a profile's default workspace, or set its endpoint or output format
112113

113114
```bash
114115
sim configure [options]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ sim profile add acme --workspace 7e2d9c14-6b83-4a55-8f01-c4d3e9a76b28
4040
```bash
4141
sim configure --set-endpoint http://localhost:3000 --profile dev
4242
sim configure --set-workspace 5c81f3a6-0e27-4b94-8d15-a7f60c39b2e8 --profile dev
43-
sim configure --set-output json
43+
sim configure --set-output table
4444
```
4545

4646
| Option | What it sets |
@@ -64,7 +64,7 @@ Each setting resolves independently, and the first match wins:
6464
| 1 | Command-line flag — `--endpoint`, `--workspace`, `--output` |
6565
| 2 | Environment — `SIM_ENDPOINT`, `SIM_API_KEY`, `SIM_WORKSPACE`, `SIM_OUTPUT` |
6666
| 3 | `~/.sim/config` for the selected profile and `~/.sim/credentials` for its `auth_profile`, when set |
67-
| 4 | Built-in default — `https://www.sim.ai` and `table` |
67+
| 4 | Built-in default — `https://www.sim.ai` and `json` |
6868

6969
`sim whoami` prints the winning source for each setting:
7070

‎apps/docs/content/docs/cli/files.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ sim files upload <path> [options]
646646

647647
</CommandTable>
648648

649-
## Get a file’s content
649+
## Download a file’s content to stdout or a local file
650650

651651
```bash
652652
sim files get <fileId> [options]

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import { Step, Steps } from 'fumadocs-ui/components/steps'
77
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
88

99
`sim` is the command line for Sim. Sign in once, then run workflows, query tables,
10-
move files, search knowledge bases, and read run logs from the terminal. Use
11-
`--output json` for structured results that pipe into `jq`, cron jobs, and CI
12-
pipelines. See [Output formats](/cli/output) for commands that emit raw content
10+
move files, search knowledge bases, and read run logs from the terminal. Results
11+
are JSON by default, so they pipe into `jq`, cron jobs, CI pipelines, and coding
12+
agents; use `--output table` to read them as tables. Don't know a command? Run
13+
`sim cli search "<what you want to do>"`. See [Output formats](/cli/output) for commands that emit raw content
1314
or local configuration.
1415

1516
## Install

‎apps/docs/content/docs/cli/knowledge.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ Enable or disable every matching document (OAuth login or personal API key requi
455455

456456
</CommandTable>
457457

458-
## Delete document
458+
## Delete a document from a knowledge base
459459

460460
```bash
461461
sim knowledge documents delete <knowledgeBaseId> <documentId> [options]

‎apps/docs/content/docs/cli/logs.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ sim logs stats [options]
6060

6161
</CommandTable>
6262

63-
## List logs
63+
## List run logs, such as failed or errored runs, by workflow, trigger or time
6464

6565
```bash
6666
sim logs list [options]
@@ -100,7 +100,7 @@ sim logs list [options]
100100

101101
</CommandTable>
102102

103-
## Watch runs as they arrive, printing each new run once
103+
## Watch runs live as they arrive, printing each new run once
104104

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

‎apps/docs/content/docs/cli/meta.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"commands",
1616
"profiles",
1717
"telemetry",
18+
"cli",
1819
"audit-logs",
1920
"billing",
2021
"blocks",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Commands that return structured API data support four output formats.
77

88
| Format | For |
99
| --- | --- |
10-
| `table` | reading (default) |
11-
| `json` | piping into `jq` |
10+
| `json` | agents, scripts, and piping into `jq` (default) |
11+
| `table` | reading |
1212
| `yaml` | piping into anything that reads YAML |
1313
| `text` | shell loops — tab-separated, no header, no colour |
1414

1515
Select one per command, save it to the profile, or set it in the environment:
1616

1717
```bash
18-
sim tables get tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --output json
19-
sim configure --set-output json
18+
sim tables get tbl_9f3c1a05d4b7426e8c2f0917ab35de64 --output table
19+
sim configure --set-output table
2020
SIM_OUTPUT=yaml sim logs list > logs.yaml
2121
```
2222

0 commit comments

Comments
 (0)