Skip to content

Commit 12e44cb

Browse files
committed
docs(cli): document every flag from the contracts, add troubleshooting and a single-page reference
The command reference was structurally complete but said almost nothing: 223 of 377 flags rendered as "Set sort by" because the CLI only ever read flag help from its own contract overrides, and fell back to restating the flag name. The prose already existed. The v2 route contracts carry 931 `.describe()` calls and the OpenAPI specs publish all of them — 327 parameters and 282 body properties, 100% coverage — but the generated operation table dropped every one, carrying only a per-operation summary. It now carries the field descriptions, the path-parameter descriptions, and positional help, so `--help` and the docs explain a flag the same way the API reference does. Placeholder descriptions are now zero, and 147/147 commands, 377/377 flags and 130/130 arguments are documented. `check:cli-docs` fails on a request field with no `.describe()` rather than letting it render as documentation that says nothing. Also in this pass: - Commands are root-level sidebar entries under a Commands heading rather than a folder, and headings are the command's description, so the table of contents distinguishes entries at the first word instead of repeating "sim knowledge documents …" fourteen times. A guard fails the build if two descriptions on a page collide, since they would share an anchor. - A single-page `Complete reference` carrying all 147 commands, for in-page search and for agents fetching `/cli/reference.mdx`. It keys on exact command paths because descriptions are only unique within a group. - A troubleshooting page, with every message copied from the source. - Table columns are sized by a local component; the flag column was starved while descriptions kept most of the row empty. - The prerelease install channels are dropped from the docs and the package README, which is what npm renders.
1 parent 8adc72f commit 12e44cb

45 files changed

Lines changed: 9530 additions & 3266 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { ReactNode } from 'react'
2+
3+
interface CommandTableProps {
4+
children: ReactNode
5+
}
6+
7+
/**
8+
* Column sizing for the generated CLI reference tables.
9+
*
10+
* Auto layout gives a column width in proportion to its content, which is
11+
* backwards here: descriptions are sentences and flags are short, so the flag
12+
* column collapsed until `--enabled-filter <value>` wrapped across three lines
13+
* while the description beside it kept most of the row empty. A fixed layout
14+
* with explicit widths reserves the space the flag actually needs.
15+
*
16+
* Cells align to the top because a wrapped four-line description would
17+
* otherwise float its flag into the middle of the row, away from the line it
18+
* belongs to.
19+
*/
20+
export function CommandTable({ children }: CommandTableProps) {
21+
return (
22+
<div
23+
className={[
24+
'[&_table]:w-full [&_table]:table-fixed',
25+
'[&_th:nth-child(1)]:w-[30%] [&_th:nth-child(2)]:w-[5.5rem]',
26+
'[&_td]:align-top [&_th]:align-bottom',
27+
// Long flags and dotted paths have no spaces to break on.
28+
'[&_td:nth-child(1)_code]:break-words',
29+
].join(' ')}
30+
>
31+
{children}
32+
</div>
33+
)
34+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Audit Logs
3+
description: Manage audit logs — every subcommand, argument, and flag
4+
---
5+
6+
import { CommandTable } from '@/components/ui/command-table'
7+
8+
`sim audit-logs` is also spelled `sim audit-log`.
9+
10+
Every command below also accepts the [global options](/cli/commands#global-options).
11+
12+
## Get audit log
13+
14+
```bash
15+
sim audit-logs get <id> [options]
16+
```
17+
18+
**Arguments**
19+
20+
<CommandTable>
21+
22+
| Argument | Required | Description |
23+
| --- | --- | --- |
24+
| `id` | Yes | Audit-log entry identifier. |
25+
26+
</CommandTable>
27+
28+
**Options**
29+
30+
<CommandTable>
31+
32+
| Option | Required | Description |
33+
| --- | --- | --- |
34+
| `--organization <value>` | Yes | Organization ID (personal API key required). |
35+
36+
</CommandTable>
37+
38+
## List audit logs
39+
40+
```bash
41+
sim audit-logs list [options]
42+
```
43+
44+
**Options**
45+
46+
<CommandTable>
47+
48+
| Option | Required | Description |
49+
| --- | --- | --- |
50+
| `--action <value>` | No | Filter by exact action name. |
51+
| `--resource-type <value>` | No | Filter by resource type. Accepts a comma-separated set; members are trimmed and deduplicated, and member order affects neither the result nor the cursor. |
52+
| `--resource-id <value>` | No | Filter by exact resource identifier. |
53+
| `--start-date <value>` | No | Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant. |
54+
| `--end-date <value>` | No | Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant. |
55+
| `--include-departed` | No | Include actions by users who have left the organization. |
56+
| `--no-include-departed` | No | Send --include-departed as false. |
57+
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
58+
| `--organization <value>` | Yes | Organization ID (personal API key required). |
59+
| `--actor-email <value>` | No | Filter by actor email address. |
60+
| `--all-workspaces` | No | Do not filter to the configured workspace (personal API key required for account-wide access). |
61+
62+
</CommandTable>

apps/docs/content/docs/en/cli/commands/billing.mdx renamed to apps/docs/content/docs/en/cli/billing.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,36 @@ title: Billing
33
description: Manage billing — every subcommand, argument, and flag
44
---
55

6-
Every command below also accepts the [global options](/cli/commands#global-options).
6+
import { CommandTable } from '@/components/ui/command-table'
77

8-
## sim billing status
8+
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 and current-period credit usage
1111

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

1616
**Options**
1717

18+
<CommandTable>
19+
1820
| Option | Required | Description |
1921
| --- | --- | --- |
2022
| `--all-workspaces` | No | Do not filter to the configured workspace (personal API key required for account-wide access). |
2123

22-
## sim billing logs
24+
</CommandTable>
2325

24-
List credit usage events
26+
## List credit usage events
2527

2628
```bash
2729
sim billing logs [options]
2830
```
2931

3032
**Options**
3133

34+
<CommandTable>
35+
3236
| Option | Required | Description |
3337
| --- | --- | --- |
3438
| `--source <value>` | No | Filter by usage source; sim-chat combines Copilot and workspace chat. Accepted values: `workflow`, `wand`, `sim-chat`, `mcp_copilot`, `mothership_block`, `knowledge-base`, `voice-input`, `enrichment`, `voice-output`. |
@@ -37,3 +41,5 @@ sim billing logs [options]
3741
| `--end-date <value>` | No | Custom period end (ISO 8601). |
3842
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
3943
| `--all-workspaces` | No | Do not filter to the configured workspace (personal API key required for account-wide access). |
44+
45+
</CommandTable>
Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
title: Overview
3-
description: Every sim command, with its arguments and flags
3+
description: Global options, and every sim command group
44
---
55

6+
import { CommandTable } from '@/components/ui/command-table'
7+
68
Every `sim` command follows the same shape:
79

810
```bash
@@ -28,81 +30,83 @@ These apply to every command, and may be written before or after it.
2830

2931
| Group | Description |
3032
| --- | --- |
31-
| [`sim audit-logs`](/cli/commands/audit-logs) | Manage audit logs |
32-
| [`sim billing`](/cli/commands/billing) | Manage billing |
33-
| [`sim credentials`](/cli/commands/credentials) | Manage credentials |
34-
| [`sim custom-tools`](/cli/commands/custom-tools) | Manage custom tools |
35-
| [`sim files`](/cli/commands/files) | Manage files |
36-
| [`sim knowledge`](/cli/commands/knowledge) | Manage knowledge |
37-
| [`sim logs`](/cli/commands/logs) | Manage logs |
38-
| [`sim mcp-servers`](/cli/commands/mcp-servers) | Manage mcp servers |
39-
| [`sim secrets`](/cli/commands/secrets) | Manage secrets |
40-
| [`sim skills`](/cli/commands/skills) | Manage skills |
41-
| [`sim tables`](/cli/commands/tables) | Manage tables |
42-
| [`sim workflows`](/cli/commands/workflows) | Manage workflows |
43-
| [`sim workspaces`](/cli/commands/workspaces) | Manage workspaces |
44-
45-
## sim login
46-
47-
Authorize this terminal and store an API key for the profile
33+
| [`sim audit-logs`](/cli/audit-logs) | Manage audit logs |
34+
| [`sim billing`](/cli/billing) | Manage billing |
35+
| [`sim credentials`](/cli/credentials) | Manage credentials |
36+
| [`sim custom-tools`](/cli/custom-tools) | Manage custom tools |
37+
| [`sim files`](/cli/files) | Manage files |
38+
| [`sim knowledge`](/cli/knowledge) | Manage knowledge |
39+
| [`sim logs`](/cli/logs) | Manage logs |
40+
| [`sim mcp-servers`](/cli/mcp-servers) | Manage mcp servers |
41+
| [`sim secrets`](/cli/secrets) | Manage secrets |
42+
| [`sim skills`](/cli/skills) | Manage skills |
43+
| [`sim tables`](/cli/tables) | Manage tables |
44+
| [`sim workflows`](/cli/workflows) | Manage workflows |
45+
| [`sim workspaces`](/cli/workspaces) | Manage workspaces |
46+
47+
## Authorize this terminal and store an API key for the profile
4848

4949
```bash
5050
sim login [options]
5151
```
5252

5353
**Options**
5454

55+
<CommandTable>
56+
5557
| Option | Required | Description |
5658
| --- | --- | --- |
5759
| `--scope <scope>` | No | Key space to mint from: platform or copilot. Defaults to `platform`. |
5860
| `--no-browser` | No | Print the URL instead of opening a browser. |
5961
| `-y, --yes` | No | Overwrite an existing profile without prompting. |
6062

61-
## sim logout
63+
</CommandTable>
6264

63-
Remove the profile's stored API key
65+
## Remove the profile's stored API key
6466

6567
```bash
6668
sim logout [options]
6769
```
6870

6971
**Options**
7072

73+
<CommandTable>
74+
7175
| Option | Required | Description |
7276
| --- | --- | --- |
7377
| `--all` | No | Remove the profile entirely, including its settings. |
7478

75-
## sim whoami
79+
</CommandTable>
7680

77-
Show the resolved profile and where each setting came from
81+
## Show the resolved profile and where each setting came from
7882

7983
```bash
8084
sim whoami
8185
```
8286

83-
## sim profiles
84-
85-
List the profiles defined in the config and credentials files
87+
## List the profiles defined in the config and credentials files
8688

8789
```bash
8890
sim profiles
8991
```
9092

9193
Also available as `sim profile`.
9294

93-
## sim configure
94-
95-
Set a profile's endpoint, default workspace, or output format
95+
## Set a profile's endpoint, default workspace, or output format
9696

9797
```bash
9898
sim configure [options]
9999
```
100100

101101
**Options**
102102

103+
<CommandTable>
104+
103105
| Option | Required | Description |
104106
| --- | --- | --- |
105107
| `--set-endpoint <url>` | No | Sim deployment to talk to. |
106108
| `--set-workspace <id>` | No | Default workspace for workspace-scoped commands. |
107109
| `--set-output <format>` | No | Default output format (table \| json \| yaml \| text). |
108110
| `--unset <key...>` | No | Remove settings (endpoint, workspace, output). |
111+
112+
</CommandTable>

apps/docs/content/docs/en/cli/commands/audit-logs.mdx

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)