mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
docs(cli): add a CLI docs section generated from the command tree (#6762)
* docs(cli): add a CLI section, generated from the command tree
The `sim` CLI shipped with no coverage in the docs site. Adds a fourth
top-level tab for it, and moves Academy last.
The command reference is generated. `sim` exposes 147 leaf commands across
33 groups, most of them derived at runtime from the v2 route contracts, so a
hand-written reference would be wrong the week after it was written. The
generator walks the command tree `buildProgram()` hands to commander — the
same tree the terminal parses — rather than re-deriving it from the contract,
which would be a second implementation free to describe commands nobody can
invoke. `check:cli-docs` is a zero-arg `check:*` script, so the existing audit
runner picks it up and stale pages fail CI.
Generating against the real tree surfaced a collision it had been hiding:
`bulkUpdateKnowledgeDocuments` and `updateKnowledgeDocument` both derived to
`sim knowledge documents update`. Commander resolves a duplicate to the first
match, so the bulk form shadowed the single-document one and its flags were
unreachable while still appearing in `--help`. The bulk form is now
`batch-update`, matching how `tables rows batch-delete`/`batch-update` already
handle the same REST overload, and the generator fails on any duplicate path
so the next one cannot land silently.
Five hand-written guides cover install, auth, configuration, output formats,
and scripting. Also corrects two commands in the package README that do not
exist as documented (`tables columns <tableId>`, and `--sort score:desc`,
which is JSON).
* 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.
* fix(docs): match the CLI tab by path segment, and escape backslashes before pipes
`pathname.includes('/cli')` also matches `/integrations/clickup` and
`/integrations/clickhouse`, so both existing integration pages lit the CLI tab
and unlit Documentation. Matching is now per path segment. Anchoring to the
start would not work either — a non-default locale prefixes the path, as in
`/ja/cli` — so the segment is matched wherever it sits.
Table cells now double a backslash before escaping pipes. A value ending in one
turned `a\` + `|` into `a\\|`, which the table parser reads as an escaped
backslash followed by an unescaped pipe, splitting the cell early. Nothing in
the command surface contains a backslash today, so this was latent rather than
visible.
The reference page's global options table is two-column and was being wrapped in
`CommandTable`, which sizes the second column for the `Required` cell of the
three-column tables and crushed the description into 5.5rem. It now matches the
overview page, which leaves that table unsized.
This commit is contained in:
@@ -113,14 +113,21 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
|
||||
// Academy lessons are video-first: drop the "On this page" TOC and go full
|
||||
// width so the lesson hero/video gets the room (chapters live in-page instead).
|
||||
const isAcademy = slug?.[0] === 'academy'
|
||||
const isCli = slug?.[0] === 'cli'
|
||||
|
||||
const pageTreeRecord = source.pageTree as Record<string, Root>
|
||||
const pageTree = pageTreeRecord[lang] ?? pageTreeRecord.en ?? Object.values(pageTreeRecord)[0]
|
||||
const rawNeighbours = pageTree ? findNeighbour(pageTree, page.url) : null
|
||||
// Academy and API Reference are self-contained sections; keep prev/next inside
|
||||
// the section instead of spilling into the main documentation tree. Match both
|
||||
// the section's pages (`/<slug>/...`) and its index (`/<slug>`).
|
||||
const sectionSlug = isApiReference ? 'api-reference' : isAcademy ? 'academy' : null
|
||||
// Academy, API Reference, and CLI are self-contained sections; keep prev/next
|
||||
// inside the section instead of spilling into the main documentation tree.
|
||||
// Match both the section's pages (`/<slug>/...`) and its index (`/<slug>`).
|
||||
const sectionSlug = isApiReference
|
||||
? 'api-reference'
|
||||
: isAcademy
|
||||
? 'academy'
|
||||
: isCli
|
||||
? 'cli'
|
||||
: null
|
||||
const inSection = (url?: string) =>
|
||||
url != null && (url.includes(`/${sectionSlug}/`) || url.endsWith(`/${sectionSlug}`))
|
||||
const neighbours = sectionSlug
|
||||
|
||||
@@ -8,23 +8,53 @@ import { SimWordmark } from '@/components/ui/sim-logo'
|
||||
import { ThemeToggle } from '@/components/ui/theme-toggle'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* Sections that own a tab, in reading order: the main docs, then the two
|
||||
* reference surfaces, then Academy. `Documentation` matches by exclusion, so
|
||||
* every section listed here is one it must not claim.
|
||||
*/
|
||||
const SECTION_TABS = ['api-reference', 'academy', 'cli'] as const
|
||||
|
||||
/**
|
||||
* Whether a pathname is inside a section, matched by whole path segment.
|
||||
*
|
||||
* A substring test is wrong: `/integrations/clickup` and
|
||||
* `/integrations/clickhouse` both contain `/cli`, which lit the CLI tab and
|
||||
* unlit Documentation on two existing integration pages. Anchoring to the start
|
||||
* is also wrong, because a non-default locale prefixes the path (`/ja/cli`), so
|
||||
* the segment can sit anywhere.
|
||||
*/
|
||||
function isInSection(pathname: string, section: string): boolean {
|
||||
return (
|
||||
pathname === `/${section}` ||
|
||||
pathname.endsWith(`/${section}`) ||
|
||||
pathname.includes(`/${section}/`)
|
||||
)
|
||||
}
|
||||
|
||||
const NAV_TABS = [
|
||||
{
|
||||
label: 'Documentation',
|
||||
href: '/introduction',
|
||||
match: (p: string) => !p.includes('/api-reference') && !p.includes('/academy'),
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
label: 'Academy',
|
||||
href: '/academy',
|
||||
match: (p: string) => p.includes('/academy'),
|
||||
match: (p: string) => !SECTION_TABS.some((section) => isInSection(p, section)),
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
label: 'API Reference',
|
||||
href: '/api-reference/getting-started',
|
||||
match: (p: string) => p.includes('/api-reference'),
|
||||
match: (p: string) => isInSection(p, 'api-reference'),
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
label: 'CLI',
|
||||
href: '/cli',
|
||||
match: (p: string) => isInSection(p, 'cli'),
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
label: 'Academy',
|
||||
href: '/academy',
|
||||
match: (p: string) => isInSection(p, 'academy'),
|
||||
external: false,
|
||||
},
|
||||
] as const
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
interface CommandTableProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
/**
|
||||
* Column sizing for the generated CLI reference tables.
|
||||
*
|
||||
* Auto layout gives a column width in proportion to its content, which is
|
||||
* backwards here: descriptions are sentences and flags are short, so the flag
|
||||
* column collapsed until `--enabled-filter <value>` wrapped across three lines
|
||||
* while the description beside it kept most of the row empty. A fixed layout
|
||||
* with explicit widths reserves the space the flag actually needs.
|
||||
*
|
||||
* Cells align to the top because a wrapped four-line description would
|
||||
* otherwise float its flag into the middle of the row, away from the line it
|
||||
* belongs to.
|
||||
*/
|
||||
export function CommandTable({ children }: CommandTableProps) {
|
||||
return (
|
||||
<div
|
||||
className={[
|
||||
'[&_table]:w-full [&_table]:table-fixed',
|
||||
'[&_th:nth-child(1)]:w-[30%] [&_th:nth-child(2)]:w-[5.5rem]',
|
||||
'[&_td]:align-top [&_th]:align-bottom',
|
||||
// Long flags and dotted paths have no spaces to break on.
|
||||
'[&_td:nth-child(1)_code]:break-words',
|
||||
].join(' ')}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: Audit Logs
|
||||
description: Manage audit logs — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim audit-logs` is also spelled `sim audit-log`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Get audit log
|
||||
|
||||
```bash
|
||||
sim audit-logs get <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Audit-log entry identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--organization <value>` | Yes | Organization ID (personal API key required). |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List audit logs
|
||||
|
||||
```bash
|
||||
sim audit-logs list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--action <value>` | No | Filter by exact action name. |
|
||||
| `--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. |
|
||||
| `--resource-id <value>` | No | Filter by exact resource identifier. |
|
||||
| `--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. |
|
||||
| `--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. |
|
||||
| `--include-departed` | No | Include actions by users who have left the organization. |
|
||||
| `--no-include-departed` | No | Send --include-departed as false. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
| `--organization <value>` | Yes | Organization ID (personal API key required). |
|
||||
| `--actor-email <value>` | No | Filter by actor email address. |
|
||||
| `--all-workspaces` | No | Do not filter to the configured workspace (personal API key required for account-wide access). |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,167 @@
|
||||
---
|
||||
title: Authentication
|
||||
description: Sign in from the terminal, authenticate CI with an API key, and keep several accounts side by side
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
The CLI authenticates with a Sim API key. On a workstation, `sim login` mints and
|
||||
stores one for you. In CI, you supply one through the environment and nothing
|
||||
touches the filesystem.
|
||||
|
||||
## Signing in
|
||||
|
||||
```bash
|
||||
sim login
|
||||
```
|
||||
|
||||
The terminal prints a pairing code and a URL:
|
||||
|
||||
```
|
||||
Pairing code: K7M2-P9XT
|
||||
Confirm this code matches what the browser shows before approving.
|
||||
|
||||
https://sim.ai/cli/auth?request=…&scope=platform
|
||||
Waiting for approval…
|
||||
|
||||
✓ Logged in. Key stored in /Users/you/.sim/credentials
|
||||
Personal key, defaulting to ws_abc123. Override per command with --workspace.
|
||||
```
|
||||
|
||||
This is the same browser handoff shape as `gh auth login`. Nothing redeemable
|
||||
crosses the browser leg, and there is no loopback listener — so it works over
|
||||
SSH and inside containers.
|
||||
|
||||
<Callout type="warn">
|
||||
Confirm the pairing code in your terminal matches the one the browser shows
|
||||
before you approve. That check is what binds the approval to *your* terminal.
|
||||
</Callout>
|
||||
|
||||
| Option | What it does |
|
||||
| --- | --- |
|
||||
| `--no-browser` | Print the URL instead of opening a browser |
|
||||
| `--scope <scope>` | Key space to mint from: `platform` (default) or `copilot` |
|
||||
| `-y, --yes` | Overwrite an existing profile without prompting |
|
||||
|
||||
### Picking a workspace
|
||||
|
||||
The approval page is where you choose the workspace — the terminal has no key
|
||||
yet, so it cannot list them for you.
|
||||
|
||||
`sim login` issues a **personal** key. The workspace you pick becomes the
|
||||
profile's default `workspace`; it does **not** restrict the key to that
|
||||
workspace. Target another workspace the key can reach with `--workspace`:
|
||||
|
||||
```bash
|
||||
sim workflows list --workspace ws_other
|
||||
```
|
||||
|
||||
`sim login --workspace <id>` preselects a workspace in the picker, and
|
||||
re-logging into an existing profile preselects the one already configured.
|
||||
|
||||
## Checking who you are
|
||||
|
||||
```bash
|
||||
sim whoami
|
||||
```
|
||||
|
||||
This prints the resolved endpoint, workspace, output format, and account — and
|
||||
which source each value came from. Reach for it first whenever a command targets
|
||||
something you did not expect.
|
||||
|
||||
## Signing out
|
||||
|
||||
```bash
|
||||
sim logout # remove the stored key
|
||||
sim logout --all # remove the profile entirely, including its settings
|
||||
```
|
||||
|
||||
<Callout type="warn">
|
||||
`sim logout` removes the key from disk but does **not** revoke it. Revoke keys in
|
||||
Sim under **Settings → API keys**.
|
||||
</Callout>
|
||||
|
||||
## Authenticating CI
|
||||
|
||||
Skip `sim login` entirely. Set the key and workspace in the environment and the
|
||||
CLI never reads or writes a config file:
|
||||
|
||||
```bash
|
||||
export SIM_API_KEY="sim_…"
|
||||
export SIM_WORKSPACE="ws_abc123"
|
||||
|
||||
sim workflows run wf_7Yb2 --input '{"source":"nightly"}' --output json
|
||||
```
|
||||
|
||||
Create the key in Sim under **Settings → API keys**. Store it as a secret in your
|
||||
CI provider — never commit it.
|
||||
|
||||
<Callout type="info">
|
||||
`SIM_CONFIG_DIR` relocates both files if you do need them somewhere other than
|
||||
`~/.sim` — a container image, or a runner with no writable home directory.
|
||||
</Callout>
|
||||
|
||||
### GitHub Actions
|
||||
|
||||
```yaml title=".github/workflows/nightly.yml"
|
||||
jobs:
|
||||
digest:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- run: npm install --global sim
|
||||
- run: sim workflows run wf_7Yb2 --output json
|
||||
env:
|
||||
SIM_API_KEY: ${{ secrets.SIM_API_KEY }}
|
||||
SIM_WORKSPACE: ${{ vars.SIM_WORKSPACE }}
|
||||
```
|
||||
|
||||
## Several accounts at once
|
||||
|
||||
Each profile holds one identity and one set of defaults, so a production account
|
||||
and a local stack can coexist without re-authenticating:
|
||||
|
||||
```bash
|
||||
sim login --profile dev --endpoint http://localhost:3000
|
||||
sim login --profile prod
|
||||
|
||||
sim workflows list --profile dev
|
||||
sim workflows list --profile prod
|
||||
```
|
||||
|
||||
See [Configuration](/cli/configuration) for how profiles are stored and resolved.
|
||||
|
||||
## Self-hosted and non-production deployments
|
||||
|
||||
Point the CLI at any Sim deployment with `--endpoint`, then sign in against it:
|
||||
|
||||
```bash
|
||||
sim login --profile local --endpoint http://localhost:3000
|
||||
```
|
||||
|
||||
Save it so you do not have to repeat the flag:
|
||||
|
||||
```bash
|
||||
sim configure --set-endpoint http://localhost:3000 --profile local
|
||||
```
|
||||
|
||||
## Where the key is stored
|
||||
|
||||
Keys live in `~/.sim/credentials`, written with `0600` permissions, kept apart
|
||||
from the non-secret `~/.sim/config` so the two can be handled differently — you
|
||||
can commit `config` to a dotfiles repo, and never `credentials`.
|
||||
|
||||
```ini title="~/.sim/credentials"
|
||||
[default]
|
||||
api_key = sim_…
|
||||
|
||||
[dev]
|
||||
api_key = sim_…
|
||||
```
|
||||
|
||||
## Organization audit logs
|
||||
|
||||
`sim audit-logs` requires a **personal** API key — the kind `sim login` issues.
|
||||
A workspace-scoped key cannot read organization-level audit logs.
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: Billing
|
||||
description: Manage billing — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Show billing status and current-period credit usage
|
||||
|
||||
```bash
|
||||
sim billing status [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--all-workspaces` | No | Do not filter to the configured workspace (personal API key required for account-wide access). |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List credit usage events
|
||||
|
||||
```bash
|
||||
sim billing logs [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--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`. |
|
||||
| `--period <value>` | No | Billing period. Accepted values: `1d`, `7d`, `30d`, `all`, `custom`. |
|
||||
| `--start-date <value>` | No | Custom period start (ISO 8601). |
|
||||
| `--end-date <value>` | No | Custom period end (ISO 8601). |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
| `--all-workspaces` | No | Do not filter to the configured workspace (personal API key required for account-wide access). |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,112 @@
|
||||
---
|
||||
title: Overview
|
||||
description: Global options, and every sim command group
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
Every `sim` command follows the same shape:
|
||||
|
||||
```bash
|
||||
sim <resource> [sub-resource] <verb> [arguments] [options]
|
||||
```
|
||||
|
||||
Resource groups are plural, and each one also accepts its singular spelling —
|
||||
`sim workflow get` and `sim workflows get` are the same command. `knowledge`
|
||||
additionally answers to `kb`.
|
||||
|
||||
## Global options
|
||||
|
||||
These apply to every command, and may be written before or after it.
|
||||
|
||||
| Option | Description |
|
||||
| --- | --- |
|
||||
| `-P, --profile <name>` | Profile to use (env: SIM_PROFILE). |
|
||||
| `--endpoint <url>` | Sim deployment to talk to (env: SIM_ENDPOINT). |
|
||||
| `-w, --workspace <id>` | Workspace to target (env: SIM_WORKSPACE). |
|
||||
| `--output <format>` | Output format for this command. Accepted values: `table`, `json`, `yaml`, `text`. |
|
||||
|
||||
## Command groups
|
||||
|
||||
| Group | Description |
|
||||
| --- | --- |
|
||||
| [`sim audit-logs`](/cli/audit-logs) | Manage audit logs |
|
||||
| [`sim billing`](/cli/billing) | Manage billing |
|
||||
| [`sim credentials`](/cli/credentials) | Manage credentials |
|
||||
| [`sim custom-tools`](/cli/custom-tools) | Manage custom tools |
|
||||
| [`sim files`](/cli/files) | Manage files |
|
||||
| [`sim knowledge`](/cli/knowledge) | Manage knowledge |
|
||||
| [`sim logs`](/cli/logs) | Manage logs |
|
||||
| [`sim mcp-servers`](/cli/mcp-servers) | Manage mcp servers |
|
||||
| [`sim secrets`](/cli/secrets) | Manage secrets |
|
||||
| [`sim skills`](/cli/skills) | Manage skills |
|
||||
| [`sim tables`](/cli/tables) | Manage tables |
|
||||
| [`sim workflows`](/cli/workflows) | Manage workflows |
|
||||
| [`sim workspaces`](/cli/workspaces) | Manage workspaces |
|
||||
|
||||
## Authorize this terminal and store an API key for the profile
|
||||
|
||||
```bash
|
||||
sim login [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--scope <scope>` | No | Key space to mint from: platform or copilot. Defaults to `platform`. |
|
||||
| `--no-browser` | No | Print the URL instead of opening a browser. |
|
||||
| `-y, --yes` | No | Overwrite an existing profile without prompting. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Remove the profile's stored API key
|
||||
|
||||
```bash
|
||||
sim logout [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--all` | No | Remove the profile entirely, including its settings. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Show the resolved profile and where each setting came from
|
||||
|
||||
```bash
|
||||
sim whoami
|
||||
```
|
||||
|
||||
## List the profiles defined in the config and credentials files
|
||||
|
||||
```bash
|
||||
sim profiles
|
||||
```
|
||||
|
||||
Also available as `sim profile`.
|
||||
|
||||
## Set a profile's endpoint, default workspace, or output format
|
||||
|
||||
```bash
|
||||
sim configure [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--set-endpoint <url>` | No | Sim deployment to talk to. |
|
||||
| `--set-workspace <id>` | No | Default workspace for workspace-scoped commands. |
|
||||
| `--set-output <format>` | No | Default output format (table \| json \| yaml \| text). |
|
||||
| `--unset <key...>` | No | Remove settings (endpoint, workspace, output). |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,147 @@
|
||||
---
|
||||
title: Configuration
|
||||
description: Profiles, config files, environment variables, and how each setting is resolved
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
The CLI has four settings: which **endpoint** to talk to, which **API key** to
|
||||
use, which **workspace** to target, and which **output format** to print. Each
|
||||
one resolves independently, so you can save a default and still override it for
|
||||
a single command.
|
||||
|
||||
## Profiles
|
||||
|
||||
A profile is one identity plus one set of defaults. Profiles work like the AWS
|
||||
CLI, which is what lets a production account and a local stack sit side by side
|
||||
without re-authenticating.
|
||||
|
||||
Select one with `-P`, `--profile`, or `SIM_PROFILE`:
|
||||
|
||||
```bash
|
||||
sim workflows list --profile dev
|
||||
SIM_PROFILE=dev sim workflows list
|
||||
```
|
||||
|
||||
The profile is named `default` when you do not pick one.
|
||||
|
||||
```bash
|
||||
sim profiles # list them; * marks the active one
|
||||
```
|
||||
|
||||
## Setting defaults
|
||||
|
||||
```bash
|
||||
sim configure --set-endpoint http://localhost:3000 --profile dev
|
||||
sim configure --set-workspace ws_local --profile dev
|
||||
sim configure --set-output json
|
||||
```
|
||||
|
||||
| Option | What it sets |
|
||||
| --- | --- |
|
||||
| `--set-endpoint <url>` | The Sim deployment to talk to |
|
||||
| `--set-workspace <id>` | Default workspace for workspace-scoped commands |
|
||||
| `--set-output <format>` | Default output format: `table`, `json`, `yaml`, or `text` |
|
||||
| `--unset <key...>` | Remove settings — `endpoint`, `workspace`, or `output` |
|
||||
|
||||
Run `sim configure` with no flags to print the profile's stored settings.
|
||||
|
||||
<Callout type="info">
|
||||
API keys are deliberately **not** settable through `sim configure`. Use
|
||||
[`sim login`](/cli/authentication), or `SIM_API_KEY` for CI.
|
||||
</Callout>
|
||||
|
||||
## Where settings come from
|
||||
|
||||
Each setting resolves independently, and the first match wins:
|
||||
|
||||
| Rank | Source |
|
||||
| --- | --- |
|
||||
| 1 | Command-line flag — `--endpoint`, `--workspace`, `--output` |
|
||||
| 2 | Environment — `SIM_ENDPOINT`, `SIM_API_KEY`, `SIM_WORKSPACE`, `SIM_OUTPUT` |
|
||||
| 3 | `~/.sim/config` and `~/.sim/credentials`, for the selected profile |
|
||||
| 4 | Built-in default — `https://sim.ai` and `table` |
|
||||
|
||||
Because they resolve independently, a saved profile still supplies the workspace
|
||||
when you override only the output format.
|
||||
|
||||
`sim whoami` prints the winning source for each setting, which is usually the
|
||||
fastest way to explain a surprising result:
|
||||
|
||||
```bash
|
||||
sim whoami
|
||||
```
|
||||
|
||||
## The files
|
||||
|
||||
Non-secret settings live in `~/.sim/config`. It is safe to commit to a dotfiles
|
||||
repo:
|
||||
|
||||
```ini title="~/.sim/config"
|
||||
[default]
|
||||
endpoint = https://sim.ai
|
||||
workspace = ws_abc123
|
||||
output = table
|
||||
|
||||
[profile dev]
|
||||
endpoint = http://localhost:3000
|
||||
workspace = ws_local
|
||||
```
|
||||
|
||||
Keys live in `~/.sim/credentials`, written `0600`:
|
||||
|
||||
```ini title="~/.sim/credentials"
|
||||
[default]
|
||||
api_key = sim_…
|
||||
|
||||
[dev]
|
||||
api_key = sim_…
|
||||
```
|
||||
|
||||
<Callout type="info">
|
||||
The section-naming asymmetry — `[profile dev]` in config, `[dev]` in credentials
|
||||
— is the AWS convention, kept so existing habits and tooling carry over. The
|
||||
`default` profile is spelled `[default]` in both.
|
||||
</Callout>
|
||||
|
||||
## Environment variables
|
||||
|
||||
| Variable | Effect |
|
||||
| --- | --- |
|
||||
| `SIM_PROFILE` | Profile to use |
|
||||
| `SIM_ENDPOINT` | Deployment to talk to |
|
||||
| `SIM_API_KEY` | API key — skips `sim login` entirely |
|
||||
| `SIM_WORKSPACE` | Workspace to target |
|
||||
| `SIM_OUTPUT` | Output format |
|
||||
| `SIM_CONFIG_DIR` | Relocate both files away from `~/.sim` |
|
||||
| `SIM_CONFIG_FILE` | Relocate only the config file |
|
||||
| `SIM_CREDENTIALS_FILE` | Relocate only the credentials file |
|
||||
|
||||
For CI, set `SIM_API_KEY` and `SIM_WORKSPACE` and nothing needs to touch the
|
||||
filesystem at all.
|
||||
|
||||
## Choosing a workspace
|
||||
|
||||
Workspace-scoped commands need a workspace. Supply it per command, save it to
|
||||
the profile, or set it in the environment:
|
||||
|
||||
```bash
|
||||
sim tables list --workspace ws_other
|
||||
sim configure --set-workspace ws_abc123
|
||||
export SIM_WORKSPACE=ws_abc123
|
||||
```
|
||||
|
||||
Without one, the command fails and tells you how to set it. A few commands —
|
||||
`sim billing status`, `sim billing logs`, and `sim audit-logs list` — accept
|
||||
`--all-workspaces` to drop the filter instead. It cannot be combined with
|
||||
`--workspace`.
|
||||
|
||||
## Repairing a bad setting
|
||||
|
||||
An invalid `output` value fails with the list of accepted formats. Because a
|
||||
higher-priority source still wins, you can repair a profile without editing the
|
||||
file by hand:
|
||||
|
||||
```bash
|
||||
sim --output table configure --set-output json
|
||||
```
|
||||
@@ -0,0 +1,144 @@
|
||||
---
|
||||
title: Credentials
|
||||
description: Manage credentials — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim credentials` is also spelled `sim credential`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Disconnect credential
|
||||
|
||||
```bash
|
||||
sim credentials delete <credentialId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `credentialId` | Yes | Credential to disconnect. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List credential providers
|
||||
|
||||
```bash
|
||||
sim credentials providers list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the credential provider name. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List credentials
|
||||
|
||||
```bash
|
||||
sim credentials list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--type <value>` | No | Restrict results to this credential type. Accepted values: `oauth`, `service_account`. |
|
||||
| `--provider-id <value>` | No | Restrict results to credentials for this integration provider. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the credential display name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Accepted values: `displayName`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a service-account credential using its discovered provider schema
|
||||
|
||||
```bash
|
||||
sim credentials create <providerId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `providerId` | Yes | Service-account provider to create a credential for |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <displayName>` | Yes | Name shown for the credential in Sim. |
|
||||
| `--credentials <json\|@file>` | Yes | Provider credentials as JSON (or @path / @- to read a file or stdin). |
|
||||
| `--description <description>` | No | Optional credential description. |
|
||||
| `--id <credentialId>` | No | Client-generated credential ID when provider discovery requires it. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a short-lived link for connecting an OAuth provider
|
||||
|
||||
```bash
|
||||
sim credentials connect <providerId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `providerId` | Yes | OAuth provider to connect |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <displayName>` | Yes | Name shown for the new credential in Sim. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a short-lived link for reconnecting an OAuth credential
|
||||
|
||||
```bash
|
||||
sim credentials reconnect <credentialId>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `credentialId` | Yes | Existing OAuth credential to re-authorize |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,117 @@
|
||||
---
|
||||
title: Custom Tools
|
||||
description: Manage custom tools — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim custom-tools` is also spelled `sim custom-tool`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Create custom tool
|
||||
|
||||
```bash
|
||||
sim custom-tools create [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--title <value>` | Yes | Display title, unique within the workspace. |
|
||||
| `--schema <json\|@file>` | Yes | OpenAI function schema: {"type":"function","function":{"name":"...","parameters":{"type":"object","properties":{}}}} (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--code <value>` | Yes | Tool implementation executed in the sandboxed function runtime. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete custom tool
|
||||
|
||||
```bash
|
||||
sim custom-tools delete <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique custom tool identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get custom tool
|
||||
|
||||
```bash
|
||||
sim custom-tools get <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique custom tool identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List custom tools
|
||||
|
||||
```bash
|
||||
sim custom-tools list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the tool title. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Accepted values: `title`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Update custom tool
|
||||
|
||||
```bash
|
||||
sim custom-tools update <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique custom tool identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--title <value>` | No | New display title for the tool. |
|
||||
| `--schema <json\|@file>` | No | OpenAI function schema: {"type":"function","function":{"name":"...","parameters":{"type":"object","properties":{}}}} (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--code <value>` | No | Replacement tool implementation. |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,433 @@
|
||||
---
|
||||
title: Files
|
||||
description: Manage files — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim files` is also spelled `sim file`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Delete several files at once
|
||||
|
||||
```bash
|
||||
sim files batch-delete [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--file-ids <value...>` | Yes | File identifiers to update. (space-separated, or @path / @- with one value per line). |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create file
|
||||
|
||||
```bash
|
||||
sim files create [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | Yes | File name, including its extension. Path separators and dot segments are rejected. |
|
||||
| `--content-type <value>` | No | MIME type. When omitted, it is inferred from the file extension. |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
| `--content <value>` | No | Initial file content. Omit or send an empty string for a zero-byte file. The 70,000,000-character bound guards the JSON envelope; the decoded bytes must be at most 50 MiB, and a longer base64 payload is rejected with `413`. Use an upload session for anything larger. |
|
||||
| `--encoding <value>` | No | Encoding of the content field. Accepted values: `utf-8`, `base64`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a file folder at a path
|
||||
|
||||
```bash
|
||||
sim files folders create <path>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete folder
|
||||
|
||||
```bash
|
||||
sim files folders delete <path> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--recursive` | No | Delete the folder and its descendants. |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List folders
|
||||
|
||||
```bash
|
||||
sim files folders list [options]
|
||||
```
|
||||
|
||||
Also available as `sim files folders ls`.
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--parent <value>` | No | Direct parent folder path. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the folder name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Rename or move a file folder
|
||||
|
||||
```bash
|
||||
sim files folders move <path> <destination>
|
||||
```
|
||||
|
||||
Also available as `sim files folders mv`.
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
| `destination` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete file
|
||||
|
||||
```bash
|
||||
sim files delete <fileId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Show file metadata and sharing status
|
||||
|
||||
```bash
|
||||
sim files describe <fileId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--scope <value>` | No | Which lifecycle set to read from: `active` (default) resolves live files only and returns `404` for a file a `DELETE` soft-deleted; `archived` also resolves soft-deleted files, so metadata stays readable before `POST /files/{fileId}/restore`. Authorization is identical for both. Accepted values: `active`, `archived`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Show a file’s share settings
|
||||
|
||||
```bash
|
||||
sim files share get <fileId>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Enable or disable sharing for a file
|
||||
|
||||
```bash
|
||||
sim files share set <fileId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--is-active <true\|false>` | Yes | Whether the share should resolve. Disabling preserves the token and the whole access configuration, so re-enabling restores the share as it was; enabling rewrites the credentials the resulting mode does not use. Accepted values: `true`, `false`. |
|
||||
| `--auth-type <value>` | No | How access to the share is gated. The stored mode is kept when omitted. Enabling `public` clears the stored password and empties `allowedEmails`; `password` empties `allowedEmails`; `email` and `sso` clear the stored password. Accepted values: `public`, `password`, `email`, `sso`. |
|
||||
| `--password <value>` | No | Password for a password-gated share. Kept when omitted; enabling `password` with neither a supplied nor a stored password is a 400. |
|
||||
| `--allowed-emails <value...>` | No | Allowed addresses or `@domain` patterns for email and SSO shares. Kept when omitted; enabling `email` or `sso` with an empty resulting list is a 400. (space-separated, or @path / @- with one value per line). |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List files
|
||||
|
||||
```bash
|
||||
sim files list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
| `--scope <value>` | No | Which lifecycle set to list: `active` (default) for live files, `archived` for files a `DELETE` soft-deleted. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too. Accepted values: `active`, `archived`. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the file name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `size`, `uploadedAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Move files into another folder
|
||||
|
||||
```bash
|
||||
sim files move [options]
|
||||
```
|
||||
|
||||
Also available as `sim files mv`.
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--file-ids <value...>` | Yes | File identifiers to update. (space-separated, or @path / @- with one value per line). |
|
||||
| `--to <value>` | No | Destination folder path; omit for root. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Rename a file
|
||||
|
||||
```bash
|
||||
sim files rename <fileId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | Yes | New file name, including its extension. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Restore file
|
||||
|
||||
```bash
|
||||
sim files restore create <fileId>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Replace a file’s contents
|
||||
|
||||
```bash
|
||||
sim files set-content <fileId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--content <value>` | Yes | Complete replacement content for the file. The 70,000,000-character bound guards the JSON envelope; the decoded bytes must be at most 50 MiB, and a longer base64 payload is rejected with `413`. |
|
||||
| `--encoding <value>` | No | Content encoding. Accepted values: `utf-8`, `base64`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Upload a file to the workspace
|
||||
|
||||
```bash
|
||||
sim files upload <path> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Local file to upload |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--folder <path>` | No | Destination folder path (defaults to /). |
|
||||
| `--name <name>` | No | Store it under a different name. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get a file’s content
|
||||
|
||||
```bash
|
||||
sim files get <fileId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `fileId` | Yes | File whose content to read |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-o, --output-file <path>` | No | Write content to a file instead of stdout. |
|
||||
| `--force` | No | Overwrite --output-file if it already exists. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List file resources and child folders together
|
||||
|
||||
```bash
|
||||
sim files ls [path] [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | No | Folder path to list; defaults to the root folder |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <text>` | No | Filter folders and resources by name. |
|
||||
| `--limit <n>` | No | Maximum combined items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a file directory at a path
|
||||
|
||||
```bash
|
||||
sim files mkdir <path>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path to create; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,162 @@
|
||||
---
|
||||
title: Sim CLI
|
||||
description: Drive workflows, tables, files, knowledge bases, and logs from your shell
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
import { Step, Steps } from 'fumadocs-ui/components/steps'
|
||||
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
|
||||
|
||||
`sim` is the command line for Sim. Sign in once, then run workflows, query tables,
|
||||
move files, search knowledge bases, and read run logs from the terminal. Every
|
||||
command has a `--output json` mode, so results pipe cleanly into `jq`, cron jobs,
|
||||
CI pipelines, and any other tool you already use.
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs items={['npm', 'pnpm', 'bun', 'yarn']}>
|
||||
<Tab value="npm">
|
||||
```bash
|
||||
npm install --global sim
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="pnpm">
|
||||
```bash
|
||||
pnpm add --global sim
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="bun">
|
||||
```bash
|
||||
bun add --global sim
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="yarn">
|
||||
```bash
|
||||
yarn global add sim
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
The CLI needs **Node.js 20 or newer**. Verify the install:
|
||||
|
||||
```bash
|
||||
sim --version
|
||||
```
|
||||
|
||||
Prefer using Sim as a library? See the [TypeScript](/api-reference/typescript)
|
||||
and [Python](/api-reference/python) SDKs, or call the
|
||||
[HTTP API](/api-reference/getting-started) directly.
|
||||
|
||||
## Your first command
|
||||
|
||||
<Steps>
|
||||
|
||||
<Step>
|
||||
### Sign in
|
||||
|
||||
```bash
|
||||
sim login
|
||||
```
|
||||
|
||||
The terminal prints a pairing code and a URL. Approve it in the browser, pick a
|
||||
workspace, and the key comes back over the CLI's own connection. Nothing
|
||||
redeemable crosses the browser leg and there is no loopback listener, so this
|
||||
works over SSH and inside containers.
|
||||
|
||||
See [Authentication](/cli/authentication) for CI keys, multiple accounts, and
|
||||
self-hosted deployments.
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
### Check what you are pointed at
|
||||
|
||||
```bash
|
||||
sim whoami
|
||||
```
|
||||
|
||||
This prints the resolved endpoint, workspace, and output format — and **where
|
||||
each one came from**. It is the fastest way to explain a surprising result.
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
### List your workflows
|
||||
|
||||
```bash
|
||||
sim workflows list
|
||||
```
|
||||
|
||||
```
|
||||
ID NAME FOLDER DEPLOYED RUNS LAST RUN
|
||||
wf_7Yb2 Refund triage /Support yes 412 2026-08-15 14:02:11
|
||||
wf_9Kd4 Weekly digest /Reporting no 18 2026-08-11 09:00:04
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
### Run one
|
||||
|
||||
```bash
|
||||
sim workflows run wf_7Yb2 --input '{"ticketId":"T-4821"}'
|
||||
```
|
||||
|
||||
A workflow must be deployed before it can be run. Deploy from the editor, or
|
||||
with `sim workflows deploy <id>`.
|
||||
</Step>
|
||||
|
||||
</Steps>
|
||||
|
||||
## How commands are shaped
|
||||
|
||||
Every command reads the same way:
|
||||
|
||||
```bash
|
||||
sim <resource> [sub-resource] <verb> [arguments] [options]
|
||||
```
|
||||
|
||||
```bash
|
||||
sim workflows list
|
||||
sim tables rows query tbl_123 --limit 50
|
||||
sim knowledge documents upload kb_123 ./handbook.pdf
|
||||
```
|
||||
|
||||
Resource groups are plural, and each also accepts its singular spelling —
|
||||
`sim workflow get` and `sim workflows get` are the same command. `knowledge`
|
||||
also answers to `kb`.
|
||||
|
||||
Every command accepts `--help`, at any depth:
|
||||
|
||||
```bash
|
||||
sim --help
|
||||
sim tables --help
|
||||
sim tables rows query --help
|
||||
```
|
||||
|
||||
## What you can do
|
||||
|
||||
| Group | What it covers |
|
||||
| --- | --- |
|
||||
| [`workflows`](/cli/workflows) | Run, deploy, roll back, import, export, and organize workflows |
|
||||
| [`logs`](/cli/logs) | Read run diagnostics, including the full trace tree |
|
||||
| [`tables`](/cli/tables) | Query, insert, update, and import rows; manage columns and views |
|
||||
| [`files`](/cli/files) | Upload, download, share, and organize workspace files |
|
||||
| [`knowledge`](/cli/knowledge) | Search knowledge bases and manage their documents and tags |
|
||||
| [`skills`](/cli/skills) | Manage agent skills |
|
||||
| [`mcp-servers`](/cli/mcp-servers) | Manage MCP server connections and their tools |
|
||||
| [`custom-tools`](/cli/custom-tools) | Manage custom tool definitions |
|
||||
| [`credentials`](/cli/credentials) | Connect, reconnect, and disconnect integration credentials |
|
||||
| [`secrets`](/cli/secrets) | Set and remove workspace secrets |
|
||||
| [`billing`](/cli/billing) | Check plan status and credit usage |
|
||||
| [`audit-logs`](/cli/audit-logs) | Read organization audit logs |
|
||||
| [`workspaces`](/cli/workspaces) | Inspect the active workspace and its members |
|
||||
|
||||
The [command reference](/cli/commands) documents every subcommand, argument, and
|
||||
flag, and is generated from the CLI itself.
|
||||
|
||||
## Where to go next
|
||||
|
||||
- [Authentication](/cli/authentication) — signing in, API keys for CI, and multiple accounts
|
||||
- [Configuration](/cli/configuration) — profiles, config files, environment variables, and precedence
|
||||
- [Output formats](/cli/output) — `table`, `json`, `yaml`, and `text`, and when to use each
|
||||
- [Scripting](/cli/scripting) — piping, file inputs, exit codes, and automation recipes
|
||||
- [Troubleshooting](/cli/troubleshooting) — what each error means, and how to resolve it
|
||||
- [Command reference](/cli/commands) — every command, argument, and flag
|
||||
@@ -0,0 +1,488 @@
|
||||
---
|
||||
title: Knowledge
|
||||
description: Manage knowledge — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim knowledge` is also spelled `sim kb`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Enable or disable every matching document
|
||||
|
||||
```bash
|
||||
sim knowledge documents batch-update <knowledgeBaseId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `knowledgeBaseId` | Yes | Unique knowledge base identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--operation <value>` | Yes | Whether the selected documents become enabled or disabled for search. Accepted values: `enable`, `disable`. |
|
||||
| `--document <value...>` | No | Documents to update, by identifier. (space-separated, or @path / @- with one value per line). |
|
||||
| `--select-all` | No | Apply to every document in the knowledge base. |
|
||||
| `--enabled-filter <value>` | No | With `selectAll`, restrict the update to documents in this state. Accepted values: `all`, `enabled`, `disabled`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete document
|
||||
|
||||
```bash
|
||||
sim knowledge documents delete <knowledgeBaseId> <documentId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `knowledgeBaseId` | Yes | Unique knowledge base identifier. |
|
||||
| `documentId` | Yes | Unique knowledge document identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get document
|
||||
|
||||
```bash
|
||||
sim knowledge documents get <knowledgeBaseId> <documentId>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `knowledgeBaseId` | Yes | Unique knowledge base identifier. |
|
||||
| `documentId` | Yes | Unique knowledge document identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List documents
|
||||
|
||||
```bash
|
||||
sim knowledge documents list <knowledgeBaseId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `knowledgeBaseId` | Yes | Unique knowledge base identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the document filename. |
|
||||
| `--enabled-filter <value>` | No | Filter by whether documents are enabled for search. Accepted values: `all`, `enabled`, `disabled`. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `filename` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `filename`, `fileSize`, `tokenCount`, `chunkCount`, `uploadedAt`, `processingStatus`, `enabled`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--tag-filters <value>` | No | A JSON-encoded array of at most 10 tag filters, using the same display-name shape as knowledge search: `[{"tagName":"category","operator":"eq","value":"billing"}]`. Every filter must hold, including two that name the same tag. A name that is not defined in this knowledge base is rejected, never ignored. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Update document
|
||||
|
||||
```bash
|
||||
sim knowledge documents update <id> <documentId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique knowledge base identifier. |
|
||||
| `documentId` | Yes | Unique knowledge document identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--filename <value>` | No | New filename for the document. |
|
||||
| `--enabled` | No | Whether the document participates in search. Disabling keeps it indexed. |
|
||||
| `--no-enabled` | No | Send --enabled as false. |
|
||||
| `--tag1 <value>` | No | New value for tag slot 1. |
|
||||
| `--tag2 <value>` | No | New value for tag slot 2. |
|
||||
| `--tag3 <value>` | No | New value for tag slot 3. |
|
||||
| `--tag4 <value>` | No | New value for tag slot 4. |
|
||||
| `--tag5 <value>` | No | New value for tag slot 5. |
|
||||
| `--tag6 <value>` | No | New value for tag slot 6. |
|
||||
| `--tag7 <value>` | No | New value for tag slot 7. |
|
||||
| `--number1 <value>` | No | New value for number tag slot 1. |
|
||||
| `--number2 <value>` | No | New value for number tag slot 2. |
|
||||
| `--number3 <value>` | No | New value for number tag slot 3. |
|
||||
| `--number4 <value>` | No | New value for number tag slot 4. |
|
||||
| `--number5 <value>` | No | New value for number tag slot 5. |
|
||||
| `--date1 <value>` | No | New value for date tag slot 1, formatted YYYY-MM-DD. |
|
||||
| `--date2 <value>` | No | New value for date tag slot 2, formatted YYYY-MM-DD. |
|
||||
| `--boolean1` | No | New value for boolean tag slot 1. |
|
||||
| `--no-boolean1` | No | Send --boolean1 as false. |
|
||||
| `--boolean2` | No | New value for boolean tag slot 2. |
|
||||
| `--no-boolean2` | No | Send --boolean2 as false. |
|
||||
| `--boolean3` | No | New value for boolean tag slot 3. |
|
||||
| `--no-boolean3` | No | Send --boolean3 as false. |
|
||||
| `--retry-processing` | No | Requeue a failed or stuck document for processing. Send it alone — no other field may accompany it — and it answers with a queue acknowledgement rather than the document. |
|
||||
| `--no-retry-processing` | No | Send --retry-processing as false. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Upload a document to a knowledge base
|
||||
|
||||
```bash
|
||||
sim knowledge documents upload <knowledgeBaseId> <path> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `knowledgeBaseId` | Yes | Knowledge base to upload into |
|
||||
| `path` | Yes | Local file to upload |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <name>` | No | Store it under a different name. |
|
||||
| `--tag <value...>` | No | Document tags, in tag1 through tag7 order. |
|
||||
| `--recipe <name>` | No | Document processing recipe. |
|
||||
| `--lang <code>` | No | Document language code. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create knowledge base
|
||||
|
||||
```bash
|
||||
sim knowledge create [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | Yes | Human-readable knowledge base name. |
|
||||
| `--description <value>` | No | Optional knowledge base description. |
|
||||
| `--chunking-config <json\|@file>` | No | Chunking configuration; defaults are applied when omitted. (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a knowledge folder at a path
|
||||
|
||||
```bash
|
||||
sim knowledge folders create <path>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete folder
|
||||
|
||||
```bash
|
||||
sim knowledge folders delete <path> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--recursive` | No | Delete the folder and its descendants. |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List folders
|
||||
|
||||
```bash
|
||||
sim knowledge folders list [options]
|
||||
```
|
||||
|
||||
Also available as `sim knowledge folders ls`.
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--parent <value>` | No | Direct parent folder path. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the folder name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Rename or move a knowledge folder
|
||||
|
||||
```bash
|
||||
sim knowledge folders move <path> <destination>
|
||||
```
|
||||
|
||||
Also available as `sim knowledge folders mv`.
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
| `destination` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete knowledge base
|
||||
|
||||
```bash
|
||||
sim knowledge delete <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique knowledge base identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get knowledge base
|
||||
|
||||
```bash
|
||||
sim knowledge get <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique knowledge base identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List knowledge bases
|
||||
|
||||
```bash
|
||||
sim knowledge list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the resource name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List tags
|
||||
|
||||
```bash
|
||||
sim knowledge tags list <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique knowledge base identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Search knowledge
|
||||
|
||||
```bash
|
||||
sim knowledge search [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--kb <value...>` | Yes | Knowledge base ID (repeatable) (space-separated, or @path / @- with one value per line). |
|
||||
| `--query <value>` | No | Text to search for. |
|
||||
| `--top-k <value>` | No | Maximum number of search results to return. Must be a whole number between 1 and 100; the boundary schema only bounds the range, so a fractional value is admitted here and then rejected with 400 during search. |
|
||||
| `--tag-filters <json\|@file>` | No | Tag filters as [{"tagName":"...","operator":"...","value":"..."}] (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--search-mode <value>` | No | Search algorithm. Accepted values: `vector`, `hybrid`. |
|
||||
| `--reranker-enabled` | No | Re-order retrieved chunks with a reranking model before truncating to `topK`. Ignored for a tag-only search, and billed as an additional search unit. Reranking is best-effort — a provider failure falls back to vector ordering, so check `rerankerStatus` on the response. |
|
||||
| `--no-reranker-enabled` | No | Send --reranker-enabled as false. |
|
||||
| `--reranker-model <value>` | No | Reranking model to use when `rerankerEnabled` is true. Defaults to `rerank-v4.0-fast`. Accepted values: `rerank-v4.0-pro`, `rerank-v4.0-fast`, `rerank-v3.5`. |
|
||||
| `--reranker-input-count <value>` | No | How many candidate chunks to retrieve before reranking. Defaults to four times `topK`, capped at 100. A larger pool costs more retrieval work but gives the reranker more to choose from. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Update knowledge base
|
||||
|
||||
```bash
|
||||
sim knowledge update <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique knowledge base identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | No | New knowledge base name. |
|
||||
| `--description <value>` | No | New knowledge base description. |
|
||||
| `--chunking-config <json\|@file>` | No | New document chunking configuration. (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Move a knowledge base to a folder
|
||||
|
||||
```bash
|
||||
sim knowledge mv <id> <folder>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique knowledge base identifier. |
|
||||
| `folder` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List knowledge resources and child folders together
|
||||
|
||||
```bash
|
||||
sim knowledge ls [path] [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | No | Folder path to list; defaults to the root folder |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <text>` | No | Filter folders and resources by name. |
|
||||
| `--limit <n>` | No | Maximum combined items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a knowledge directory at a path
|
||||
|
||||
```bash
|
||||
sim knowledge mkdir <path>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path to create; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Logs
|
||||
description: Manage logs — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim logs` is also spelled `sim log`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Show run diagnostics
|
||||
|
||||
```bash
|
||||
sim logs get <runId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `runId` | Yes | Unique workflow run identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--trace` | No | Show expanded trace spans with inputs, outputs, errors, timing, and cost. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List logs
|
||||
|
||||
```bash
|
||||
sim logs list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--workflow <value...>` | No | Comma-separated workflow identifiers to include. An empty entry is rejected. (space-separated, or @path / @- with one value per line). |
|
||||
| `--trigger <value...>` | No | Comma-separated trigger types to include. An empty entry is rejected. Values are matched exactly and are case-sensitive — every recorded trigger is lowercase, so `API` matches nothing while `api` matches. The vocabulary is open: it covers the core trigger types (`manual`, `api`, `schedule`, `chat`, `webhook`, `mcp`, `copilot`, `workflow`, `custom_block`) and the provider id of any webhook trigger (`slack`, `gmail`, `github`, …), so an unrecognized member is not rejected — it selects no runs. The literal value `all` is a sentinel that disables this filter entirely, so a list containing it returns runs of every trigger type; no real trigger type is named `all`. (space-separated, or @path / @- with one value per line). |
|
||||
| `--level <value>` | No | Severity level to include. Accepted values: `info`, `error`. |
|
||||
| `--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. |
|
||||
| `--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. |
|
||||
| `--min-duration-ms <value>` | No | Minimum total execution duration in milliseconds. Whole milliseconds from 0 to 2147483647; the stored duration is a 32-bit integer, so a fractional or out-of-range bound is rejected. |
|
||||
| `--max-duration-ms <value>` | No | Maximum total execution duration in milliseconds. Whole milliseconds from 0 to 2147483647; the stored duration is a 32-bit integer, so a fractional or out-of-range bound is rejected. |
|
||||
| `--min-cost <value>` | No | Minimum execution cost in USD, from 0 to 1000000. A run is never charged a negative amount, so a negative bound is rejected rather than treated as a filter that matches every run. |
|
||||
| `--max-cost <value>` | No | Maximum execution cost in USD, from 0 to 1000000. A run is never charged a negative amount, so a negative bound is rejected rather than treated as a filter that matches every run. |
|
||||
| `--model <value>` | No | AI model used during execution. |
|
||||
| `--details <value>` | No | Response detail level. Accepted values: `basic`, `full`. |
|
||||
| `--include-trace-spans` | No | Include trace spans in JSON or YAML output (implies full detail). |
|
||||
| `--include-final-output` | No | Include final output in JSON or YAML output (implies full detail). |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
| `--order <value>` | No | Sort direction by execution start time. This list is sortable only by execution start time, so it takes `order` in place of `sortBy`/`sortOrder`, which it rejects. Accepted values: `asc`, `desc`. |
|
||||
| `--run-id <value>` | No | Exact run identifier to match. |
|
||||
| `--folder <value...>` | No | Folder path; the leading / is optional (space-separated, or @path / @- with one value per line). |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,162 @@
|
||||
---
|
||||
title: MCP Servers
|
||||
description: Manage mcp servers — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim mcp-servers` is also spelled `sim mcp-server`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Create MCP server
|
||||
|
||||
```bash
|
||||
sim mcp-servers create [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | Yes | Server display name. |
|
||||
| `--description <value>` | No | Optional server description. |
|
||||
| `--transport <value>` | No | Transport used to communicate with the server. Applied server-side as `streamable-http` when omitted on create. Accepted values: `streamable-http`. |
|
||||
| `--url <value>` | Yes | Absolute HTTP or HTTPS endpoint URL without `{{ENV_VAR}}` references. It determines server identity and is immutable: delete and recreate the server to change endpoints. |
|
||||
| `--auth-type <value>` | No | Authentication method. When omitted, and no `headers` are sent, registration probes the endpoint once to classify it, falling back to `headers` when the probe fails or the server does not advertise OAuth. A server publishing RFC 9728 metadata is therefore stored as `oauth`, and headers configured afterwards will not authenticate — send this field explicitly to pin the method. Accepted values: `none`, `headers`, `oauth`. |
|
||||
| `--headers <json\|@file>` | No | Write-only request headers sent to the server. Replaced wholesale rather than merged on update: sending this field drops every stored header it does not repeat. (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--timeout <value>` | No | Per-request timeout in milliseconds. Applied server-side as 30000 when omitted on create. |
|
||||
| `--retries <value>` | No | Number of retries per request. Applied server-side as 3 when omitted on create. |
|
||||
| `--enabled` | No | Whether the server tools are available to workflows. Applied server-side as true when omitted on create. |
|
||||
| `--no-enabled` | No | Send --enabled as false. |
|
||||
| `--oauth-client-id <value>` | No | Pre-registered OAuth client identifier. Changing it on update revokes the stored OAuth grant and forces reauthorization. |
|
||||
| `--oauth-client-secret <value>` | No | Write-only pre-registered OAuth client secret. Sending it on update as null or a new value revokes the stored OAuth grant and forces reauthorization, as does switching away from OAuth authentication. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete MCP server
|
||||
|
||||
```bash
|
||||
sim mcp-servers delete <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique MCP server identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get MCP server
|
||||
|
||||
```bash
|
||||
sim mcp-servers get <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique MCP server identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List MCP servers
|
||||
|
||||
```bash
|
||||
sim mcp-servers list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the server name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List MCP server tools
|
||||
|
||||
```bash
|
||||
sim mcp-servers tools list <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique MCP server identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--refresh` | No | Bypass the short-lived per-workspace tool cache and reconnect under your own credentials. A cached result reflects whichever workspace member last ran discovery, so this is the only way to pick up a tool added since then; it costs a live round trip. |
|
||||
| `--no-refresh` | No | Send --refresh as false. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Update MCP server
|
||||
|
||||
```bash
|
||||
sim mcp-servers update <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique MCP server identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | No | Server display name. |
|
||||
| `--description <value>` | No | Optional server description. |
|
||||
| `--transport <value>` | No | Transport used to communicate with the server. Applied server-side as `streamable-http` when omitted on create. Accepted values: `streamable-http`. |
|
||||
| `--url <value>` | No | Immutable server URL. When provided, it must equal the current URL; use delete and create to change endpoints. |
|
||||
| `--auth-type <value>` | No | Authentication method. When omitted, and no `headers` are sent, registration probes the endpoint once to classify it, falling back to `headers` when the probe fails or the server does not advertise OAuth. A server publishing RFC 9728 metadata is therefore stored as `oauth`, and headers configured afterwards will not authenticate — send this field explicitly to pin the method. Accepted values: `none`, `headers`, `oauth`. |
|
||||
| `--headers <json\|@file>` | No | Write-only request headers sent to the server. Replaced wholesale rather than merged on update: sending this field drops every stored header it does not repeat. (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--timeout <value>` | No | Per-request timeout in milliseconds. Applied server-side as 30000 when omitted on create. |
|
||||
| `--retries <value>` | No | Number of retries per request. Applied server-side as 3 when omitted on create. |
|
||||
| `--enabled` | No | Whether the server tools are available to workflows. Applied server-side as true when omitted on create. |
|
||||
| `--no-enabled` | No | Send --enabled as false. |
|
||||
| `--oauth-client-id <value>` | No | Pre-registered OAuth client identifier. Changing it on update revokes the stored OAuth grant and forces reauthorization. |
|
||||
| `--oauth-client-secret <value>` | No | Write-only pre-registered OAuth client secret. Sending it on update as null or a new value revokes the stored OAuth grant and forces reauthorization, as does switching away from OAuth authentication. |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"title": "CLI",
|
||||
"root": true,
|
||||
"pages": [
|
||||
"---Sim CLI---",
|
||||
"index",
|
||||
"authentication",
|
||||
"configuration",
|
||||
"output",
|
||||
"scripting",
|
||||
"troubleshooting",
|
||||
"---Commands---",
|
||||
"commands",
|
||||
"audit-logs",
|
||||
"billing",
|
||||
"credentials",
|
||||
"custom-tools",
|
||||
"files",
|
||||
"knowledge",
|
||||
"logs",
|
||||
"mcp-servers",
|
||||
"secrets",
|
||||
"skills",
|
||||
"tables",
|
||||
"workflows",
|
||||
"workspaces",
|
||||
"reference"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
---
|
||||
title: Output formats
|
||||
description: table, json, yaml, and text — what each is for, and how to select one
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
Every command renders through the same four formats. Pick one per command with
|
||||
`--output`, save a profile default with `sim configure --set-output`, or set
|
||||
`SIM_OUTPUT` ambiently for CI.
|
||||
|
||||
| Format | For |
|
||||
| --- | --- |
|
||||
| `table` | reading (default) |
|
||||
| `json` | piping into `jq` |
|
||||
| `yaml` | piping into anything that reads YAML |
|
||||
| `text` | shell loops — tab-separated, no header, no colour |
|
||||
|
||||
```bash
|
||||
sim --output json tables get tbl_123 # before the command
|
||||
sim tables get tbl_123 --output json # or after; both work
|
||||
sim configure --set-output json # for this profile, from now on
|
||||
SIM_OUTPUT=yaml sim logs list > logs.yaml # for one invocation or a whole job
|
||||
```
|
||||
|
||||
## Raw values versus rendered cells
|
||||
|
||||
`json` and `yaml` emit the API's **raw** values, not the table's formatting — a
|
||||
duration stays `1500`, not `"1.5s"`. Switching format never changes the data,
|
||||
only how it is displayed.
|
||||
|
||||
`text` uses the rendered cells, because it exists for shell plumbing rather than
|
||||
parsing.
|
||||
|
||||
<Callout type="info">
|
||||
An absent value prints as an em-dash (`—`) in `table` and as an **empty field**
|
||||
in `text`, so emptiness tests downstream behave as you would expect.
|
||||
</Callout>
|
||||
|
||||
## table
|
||||
|
||||
The default. Uppercase dim headers, one row per record, values formatted for
|
||||
reading — timestamps without milliseconds, sizes as `4.2 MB`, booleans as
|
||||
`yes`/`no`, costs as `$0.0142`.
|
||||
|
||||
Long cells are clipped so rows stay on one line. When you need the untruncated
|
||||
value, switch to `json`.
|
||||
|
||||
```bash
|
||||
sim files list
|
||||
```
|
||||
|
||||
## json
|
||||
|
||||
```bash
|
||||
sim logs list --level error --output json | jq -r '.[].runId'
|
||||
sim tables rows query tbl_123 --output json | jq '.[] | select(.score > 10)'
|
||||
```
|
||||
|
||||
## yaml
|
||||
|
||||
```bash
|
||||
sim workflows get wf_123 --output yaml
|
||||
sim logs get run_123 --output yaml > run.yaml
|
||||
```
|
||||
|
||||
## text
|
||||
|
||||
Tab-separated, no header, no colour — built for `read` loops:
|
||||
|
||||
```bash
|
||||
SIM_OUTPUT=text sim files list | while IFS=$'\t' read -r id name folder size type uploader uploaded; do
|
||||
echo "$id $name"
|
||||
done
|
||||
```
|
||||
|
||||
## Reading a run in detail
|
||||
|
||||
`sim logs get` keeps its default human output concise. Add `--trace` for the
|
||||
expanded recursive trace — span inputs, outputs, errors, timing, and cost:
|
||||
|
||||
```bash
|
||||
sim logs get run_123 --trace
|
||||
```
|
||||
|
||||
`json` and `yaml` always carry the complete structured response, so `--trace` is
|
||||
a no-op there — the data is already present:
|
||||
|
||||
```bash
|
||||
sim logs get run_123 --output json | jq '.traceSpans'
|
||||
sim logs list --include-trace-spans --output json
|
||||
```
|
||||
|
||||
## Commands that ignore the format
|
||||
|
||||
`sim profiles` and `sim configure`'s listing mode always print for humans — they
|
||||
report on your local configuration rather than on API data.
|
||||
|
||||
`sim workflows export` is the opposite case: it emits a document rather than a
|
||||
record to look at, so it prints raw JSON — or YAML when the profile says so —
|
||||
whatever the display format is. That is what makes it round-trip:
|
||||
|
||||
```bash
|
||||
sim workflows export wf_123 > wf.json
|
||||
sim workflows import --workflow @wf.json
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,178 @@
|
||||
---
|
||||
title: Scripting
|
||||
description: File and stdin inputs, list flags, pagination, exit codes, and automation recipes
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
The CLI is built to be driven by other programs. Everything below applies to
|
||||
every command.
|
||||
|
||||
## Reading input from files and stdin
|
||||
|
||||
Any flag that takes JSON or a list also accepts `@path` to read a file, or `@-`
|
||||
to read stdin.
|
||||
|
||||
```bash
|
||||
sim workflows import --workflow @wf.json
|
||||
sim tables rows query tbl_123 --filter @filter.json
|
||||
cat wf.json | sim workflows import --workflow @-
|
||||
```
|
||||
|
||||
This keeps large payloads out of your shell history and out of the argument
|
||||
length limit.
|
||||
|
||||
## List flags
|
||||
|
||||
Primitive lists take space-separated values. With `@`, the file supplies one
|
||||
value per line:
|
||||
|
||||
```bash
|
||||
sim files mv --file-ids file_1 file_2 --to Archive
|
||||
sim files mv --file-ids @file-ids.txt --to Archive
|
||||
printf 'file_1\nfile_2\n' | sim files mv --file-ids @- --to Archive
|
||||
```
|
||||
|
||||
Arrays of objects stay JSON inputs, because they cannot be flattened to a list
|
||||
without losing structure.
|
||||
|
||||
## Filtering table rows
|
||||
|
||||
`--filter` takes the same predicate tree the API uses: `all` (AND) or `any` (OR)
|
||||
groups of `{field, op, value}` conditions, nestable. It is JSON because the
|
||||
grammar is a tree, and there is no honest flag encoding for one.
|
||||
|
||||
```bash
|
||||
sim tables rows query tbl_123 \
|
||||
--filter '{"all":[{"field":"status","op":"eq","value":"open"},
|
||||
{"field":"score","op":"gt","value":10}]}' \
|
||||
--limit 50
|
||||
```
|
||||
|
||||
Operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`, `contains`,
|
||||
`ncontains`, `startsWith`, `endsWith`, `like`, `ilike`, `nlike`, `nilike`,
|
||||
`isEmpty`, `isNotEmpty`, `isNull`, `isNotNull`.
|
||||
|
||||
`--sort` is also JSON, an ordered list of keys:
|
||||
|
||||
```bash
|
||||
sim tables rows query tbl_123 --sort '[{"field":"createdAt","direction":"desc"}]'
|
||||
```
|
||||
|
||||
Row columns are discovered at runtime from the returned data, unioned across the
|
||||
page, so a sparse row does not hide a column.
|
||||
|
||||
## Pagination
|
||||
|
||||
List commands page automatically up to `--limit`, which defaults to `100`. Pass
|
||||
`--limit 0` to fetch everything:
|
||||
|
||||
```bash
|
||||
sim logs list --limit 0 --output json > all-logs.json
|
||||
```
|
||||
|
||||
## Destructive commands
|
||||
|
||||
Deletions require an explicit selector **and** `--yes`. There is no "delete
|
||||
everything" default:
|
||||
|
||||
```bash
|
||||
sim tables rows batch-delete tbl_123 --row row_1 row_2 --yes
|
||||
sim files delete file_123 --yes
|
||||
```
|
||||
|
||||
Without `--yes` the command explains what it would have destroyed and stops.
|
||||
|
||||
<Callout type="warn">
|
||||
`batch-delete` and `batch-update` also carry the standard `--limit` default of
|
||||
`100`. Set `--limit 0` when you intend to affect every matching row.
|
||||
</Callout>
|
||||
|
||||
## Exit codes
|
||||
|
||||
| Code | Meaning |
|
||||
| --- | --- |
|
||||
| `0` | Success |
|
||||
| `1` | Anything else — API error, bad configuration, invalid arguments, or a missing `--yes` |
|
||||
|
||||
Errors print one line to stderr, prefixed `Error:`, plus the API's error code and
|
||||
validation details when it supplies them. Failures are safe to branch on:
|
||||
|
||||
```bash
|
||||
if ! sim workflows run wf_7Yb2 --output json > result.json; then
|
||||
echo "run failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
<Callout type="info">
|
||||
An unexpected error keeps its stack trace on purpose — that is a bug in the CLI,
|
||||
and hiding it behind a friendly message would make it unreportable. Please
|
||||
[open an issue](https://github.com/simstudioai/sim/issues) if you see one.
|
||||
</Callout>
|
||||
|
||||
## Selecting workflow output
|
||||
|
||||
`--select-output` takes `blockName.field` selectors. Fields that a run did not
|
||||
produce are simply omitted:
|
||||
|
||||
```bash
|
||||
sim workflows run wf_7Yb2 --select-output agent_1.content --output json
|
||||
```
|
||||
|
||||
## Polling a long run
|
||||
|
||||
Start the run asynchronously, then poll its status:
|
||||
|
||||
```bash
|
||||
run_id=$(sim workflows run wf_7Yb2 --async --output json | jq -r '.runId')
|
||||
|
||||
until sim workflows runs get "$run_id" --workflow wf_7Yb2 --output json \
|
||||
| jq -e '.status | IN("completed","failed","cancelled")' > /dev/null; do
|
||||
sleep 5
|
||||
done
|
||||
|
||||
sim logs get "$run_id" --trace
|
||||
```
|
||||
|
||||
`workflows runs get` is the lightweight status resource; `logs get` is the full
|
||||
diagnostic one. For a paused run, the status includes the context ID that
|
||||
`sim workflows runs resume` needs.
|
||||
|
||||
## Working with folders
|
||||
|
||||
Every folder-backed resource — `workflows`, `tables`, `files`, `knowledge` —
|
||||
shares the same path commands:
|
||||
|
||||
```bash
|
||||
sim tables ls Reports
|
||||
sim tables mkdir Reports/Quarterly
|
||||
sim tables folders mv Reports/Quarterly Archive/Quarterly
|
||||
sim tables folders delete Archive --recursive --yes
|
||||
```
|
||||
|
||||
`ls` is a directory view: it combines the resources at its path with that
|
||||
folder's direct child folders, and never includes deeper descendants. Its `ref`
|
||||
column is the resource ID or canonical folder path to pass to the next command.
|
||||
Use `list` when you want resources only, or `folders ls` for folders only.
|
||||
|
||||
The leading `/` is optional on input; the API returns the canonical
|
||||
leading-slash form.
|
||||
|
||||
## A nightly job, end to end
|
||||
|
||||
```bash title="nightly-digest.sh"
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
export SIM_API_KEY="${SIM_API_KEY:?missing}"
|
||||
export SIM_WORKSPACE="${SIM_WORKSPACE:?missing}"
|
||||
export SIM_OUTPUT=json
|
||||
|
||||
run_id=$(sim workflows run wf_7Yb2 --input '{"source":"nightly"}' | jq -r '.runId')
|
||||
|
||||
if [ "$(sim workflows runs get "$run_id" --workflow wf_7Yb2 | jq -r '.status')" != "completed" ]; then
|
||||
sim logs get "$run_id" >&2
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
title: Secrets
|
||||
description: Manage secrets — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim secrets` is also spelled `sim secret`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Delete secret
|
||||
|
||||
```bash
|
||||
sim secrets delete <name> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `name` | Yes | Secret to create, replace, or delete. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--scope <value>` | Yes | Whether the secret belongs to the workspace or to the caller. A personal secret belongs to the caller across every workspace, not to one workspace. Accepted values: `workspace`, `personal`. |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List secrets
|
||||
|
||||
```bash
|
||||
sim secrets list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--scope <value>` | No | Restrict results to one ownership scope. Accepted values: `workspace`, `personal`. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the secret name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create or replace a named secret
|
||||
|
||||
```bash
|
||||
sim secrets set <name> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `name` | Yes | Secret name, as referenced in workflows |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--scope <scope>` | Yes | Secret ownership scope. Accepted values: `workspace`, `personal`. |
|
||||
| `--value <value>` | No | Secret value; visible to shell history when supplied directly. |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,117 @@
|
||||
---
|
||||
title: Skills
|
||||
description: Manage skills — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim skills` is also spelled `sim skill`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Create skill
|
||||
|
||||
```bash
|
||||
sim skills create [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | Yes | Kebab-case name, unique within the workspace and not reserved by a built-in skill. |
|
||||
| `--description <value>` | Yes | One-line summary of when the skill applies. |
|
||||
| `--content <value>` | Yes | Skill body containing the instructions given to the agent. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete skill
|
||||
|
||||
```bash
|
||||
sim skills delete <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get skill
|
||||
|
||||
```bash
|
||||
sim skills get <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List skills
|
||||
|
||||
```bash
|
||||
sim skills list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the skill name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Update skill
|
||||
|
||||
```bash
|
||||
sim skills update <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | No | New kebab-case skill name. |
|
||||
| `--description <value>` | No | New one-line summary of when the skill applies. |
|
||||
| `--content <value>` | No | Replacement skill body. |
|
||||
|
||||
</CommandTable>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,244 @@
|
||||
---
|
||||
title: Troubleshooting
|
||||
description: What the CLI's errors mean, and the fastest way to resolve each one
|
||||
---
|
||||
|
||||
import { Callout } from 'fumadocs-ui/components/callout'
|
||||
|
||||
Every error the CLI can explain prints one line to stderr, prefixed `Error:`, and
|
||||
exits `1`. Where the API supplies an error code or validation details, those
|
||||
follow on dimmed lines.
|
||||
|
||||
<Callout type="info">
|
||||
Start with `sim whoami`. Most surprises are a command running against a different
|
||||
profile, endpoint, or workspace than you assumed, and `whoami` prints the winning
|
||||
value for each setting **and where it came from**.
|
||||
</Callout>
|
||||
|
||||
## Authentication
|
||||
|
||||
### `Not logged in on profile "default". Run: sim login --profile default`
|
||||
|
||||
No API key resolved for the profile. Either sign in, or supply a key through the
|
||||
environment:
|
||||
|
||||
```bash
|
||||
sim login
|
||||
# or, for CI
|
||||
export SIM_API_KEY="sim_…"
|
||||
```
|
||||
|
||||
Remember that the key is per profile. If you signed in as `dev` and are running
|
||||
without `--profile dev`, the default profile is still unauthenticated.
|
||||
|
||||
### An error ending in `— run: sim login --profile <name>`
|
||||
|
||||
The API rejected the key with a `401`. The key was revoked, or it belongs to a
|
||||
different deployment than the endpoint you are pointed at. Sign in again:
|
||||
|
||||
```bash
|
||||
sim login --profile <name>
|
||||
```
|
||||
|
||||
Check the endpoint first if you did not expect this — a key minted against a
|
||||
local stack will not authenticate against production:
|
||||
|
||||
```bash
|
||||
sim whoami --profile <name>
|
||||
```
|
||||
|
||||
### `Timed out waiting for browser approval.`
|
||||
|
||||
`sim login` waits 15 minutes for you to approve the pairing code. Run it again.
|
||||
If the browser never opened, use the printed URL directly:
|
||||
|
||||
```bash
|
||||
sim login --no-browser
|
||||
```
|
||||
|
||||
### `Profile "default" already exists. Re-run with --yes to overwrite it.`
|
||||
|
||||
Signing in again over a profile that already holds a key. This is a guard, not a
|
||||
failure — confirm you mean to replace it:
|
||||
|
||||
```bash
|
||||
sim login --yes
|
||||
```
|
||||
|
||||
## Workspace
|
||||
|
||||
### `No workspace set for profile "default". Pass --workspace, or run: sim configure --profile default --set-workspace <id>`
|
||||
|
||||
The command is workspace-scoped and no workspace resolved. Set one for the
|
||||
profile, pass it per command, or export it:
|
||||
|
||||
```bash
|
||||
sim configure --set-workspace ws_abc123
|
||||
sim tables list --workspace ws_abc123
|
||||
export SIM_WORKSPACE=ws_abc123
|
||||
```
|
||||
|
||||
The workspace ID is in the Sim URL: `https://sim.ai/workspace/{workspaceId}/…`.
|
||||
|
||||
<Callout type="warn">
|
||||
`sim login` sets the profile's default workspace to whichever one you picked on
|
||||
the approval page. It does **not** limit the key to that workspace — use
|
||||
`--workspace` to reach any other workspace the key can access.
|
||||
</Callout>
|
||||
|
||||
### A command returns rows from the wrong workspace
|
||||
|
||||
The workspace resolved from a higher-priority source than you expected. `--workspace`
|
||||
beats `SIM_WORKSPACE`, which beats the profile. Confirm with `sim whoami`.
|
||||
|
||||
`sim billing status`, `sim billing logs`, and `sim audit-logs list` also accept
|
||||
`--all-workspaces`, which drops the filter entirely and cannot be combined with
|
||||
`--workspace`.
|
||||
|
||||
## Connectivity
|
||||
|
||||
### `Could not reach https://sim.ai: <reason>`
|
||||
|
||||
The request never got a response — DNS, TLS, a proxy, or a self-hosted stack that
|
||||
is not running. Check the endpoint the CLI actually used:
|
||||
|
||||
```bash
|
||||
sim whoami
|
||||
```
|
||||
|
||||
For a local deployment, confirm it is up and that the endpoint has the right port
|
||||
and scheme:
|
||||
|
||||
```bash
|
||||
sim configure --set-endpoint http://localhost:3000 --profile local
|
||||
```
|
||||
|
||||
### `Request cancelled.`
|
||||
|
||||
The request was aborted, usually by `Ctrl-C` or a CI job timeout. Re-run it.
|
||||
|
||||
## Arguments and flags
|
||||
|
||||
### `error: missing required argument '<name>'`
|
||||
|
||||
The CLI prints an `Example:` line beneath showing the full invocation. `--help`
|
||||
gives the complete signature at any depth:
|
||||
|
||||
```bash
|
||||
sim tables rows query --help
|
||||
```
|
||||
|
||||
### `error: option '--x <value>' argument 'y' is invalid. Allowed choices are …`
|
||||
|
||||
The value is outside the accepted set. The accepted values are in `--help` and in
|
||||
this section's [command reference](/cli/commands).
|
||||
|
||||
### `<message> Re-run with --yes to confirm.`
|
||||
|
||||
A destructive command needs explicit confirmation. The message says what would be
|
||||
destroyed — read it, then repeat the command with `--yes`:
|
||||
|
||||
```bash
|
||||
sim files delete file_123 --yes
|
||||
```
|
||||
|
||||
There is no "delete everything" default: deletions require an explicit selector
|
||||
**and** `--yes`.
|
||||
|
||||
### `--limit must be a non-negative number`
|
||||
|
||||
Use `0` for "everything" rather than a negative number:
|
||||
|
||||
```bash
|
||||
sim logs list --limit 0
|
||||
```
|
||||
|
||||
### `--input @- reads stdin, but nothing is piped in`
|
||||
|
||||
`@-` reads from stdin, so something has to be piped to it. Either pipe a value or
|
||||
point at a file:
|
||||
|
||||
```bash
|
||||
cat wf.json | sim workflows import --workflow @-
|
||||
sim workflows import --workflow @wf.json
|
||||
```
|
||||
|
||||
### A JSON flag rejects a value that looks like valid JSON
|
||||
|
||||
Your shell probably consumed the quotes. Wrap the whole value in single quotes,
|
||||
or read it from a file:
|
||||
|
||||
```bash
|
||||
sim tables rows query tbl_123 --filter '{"all":[{"field":"status","op":"eq","value":"open"}]}'
|
||||
sim tables rows query tbl_123 --filter @filter.json
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
### `Error: … output …` naming the accepted formats
|
||||
|
||||
A stored or exported output format is not one of `table`, `json`, `yaml`, or
|
||||
`text`. A higher-priority source still wins, so you can repair the profile
|
||||
without editing the file:
|
||||
|
||||
```bash
|
||||
sim --output table configure --set-output json
|
||||
```
|
||||
|
||||
### A value looks truncated
|
||||
|
||||
`table` clips long cells so rows stay on one line. The data is not truncated —
|
||||
switch to a machine format to see it in full:
|
||||
|
||||
```bash
|
||||
sim logs get run_123 --output json
|
||||
```
|
||||
|
||||
### `sim profiles` ignores `--output`
|
||||
|
||||
`sim profiles` and `sim configure`'s listing mode always print for humans; they
|
||||
report on your local configuration rather than on API data.
|
||||
|
||||
## Files
|
||||
|
||||
### `<path> already exists. Pass --force to overwrite it, or choose another output path.`
|
||||
|
||||
`sim files get -o` will not overwrite an existing file by accident:
|
||||
|
||||
```bash
|
||||
sim files get file_123 -o ./report.csv --force
|
||||
```
|
||||
|
||||
### `sim files get` refuses to print to the terminal
|
||||
|
||||
Writing arbitrary binary to an interactive terminal can corrupt it, so non-text
|
||||
content must go to a file or a pipe:
|
||||
|
||||
```bash
|
||||
sim files get file_123 -o ./image.png
|
||||
sim files get file_123 | shasum
|
||||
```
|
||||
|
||||
## Secrets
|
||||
|
||||
### `Interactive secret input requires a terminal. Pass --value instead.`
|
||||
|
||||
`sim secrets set` prompts with masked input when it can. In CI there is no
|
||||
terminal, so supply the value directly — from a CI secret, not a literal:
|
||||
|
||||
```bash
|
||||
sim secrets set MY_KEY --scope workspace --value "$MY_KEY"
|
||||
```
|
||||
|
||||
## Something else
|
||||
|
||||
An unexpected error keeps its stack trace on purpose — that is a bug in the CLI,
|
||||
not a message meant for you. Please
|
||||
[open an issue](https://github.com/simstudioai/sim/issues) with the command you
|
||||
ran and the trace.
|
||||
|
||||
Include the version:
|
||||
|
||||
```bash
|
||||
sim --version
|
||||
```
|
||||
@@ -0,0 +1,566 @@
|
||||
---
|
||||
title: Workflows
|
||||
description: Manage workflows — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim workflows` is also spelled `sim workflow`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Cancel a running workflow run
|
||||
|
||||
```bash
|
||||
sim workflows runs cancel <runId> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `runId` | Yes | Unique workflow run identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--workflow <workflowId>` | Yes | Workflow ID. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Show run status
|
||||
|
||||
```bash
|
||||
sim workflows runs get <runId> [options]
|
||||
```
|
||||
|
||||
Show run status (requested outputs are included in JSON or YAML output)
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `runId` | Yes | Unique workflow run identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--workflow <workflowId>` | Yes | Workflow ID. |
|
||||
| `--include-output` | No | Include the final output in JSON or YAML output. |
|
||||
| `--select-output <value...>` | No | Include blockName.field values in JSON or YAML output (e.g. agent_1.content) (space-separated, or @path / @- with one value per line). |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List runs for a workflow
|
||||
|
||||
```bash
|
||||
sim workflows runs list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--workflow <workflowId>` | Yes | Workflow ID. |
|
||||
| `--status <value>` | No | Filter by run status. Accepted values: `pending`, `running`, `completed`, `failed`, `cancelled`, `paused`. |
|
||||
| `--trigger <value>` | No | Filter by trigger type. |
|
||||
| `--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. |
|
||||
| `--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. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
| `--order <value>` | No | Sort direction by run start time. This list is sortable only by run start time, so it takes `order` in place of `sortBy`/`sortOrder`, which it rejects. Accepted values: `asc`, `desc`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Resume a paused run
|
||||
|
||||
```bash
|
||||
sim workflows runs resume <runId> [options]
|
||||
```
|
||||
|
||||
Resume a paused run (output is included in JSON or YAML output)
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `runId` | Yes | Unique workflow run identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--workflow <workflowId>` | Yes | Workflow ID. |
|
||||
| `--context <value>` | Yes | Pause context ID returned by run status. |
|
||||
| `--input <json\|@file>` | No | Resume input as JSON (JSON, or @path / @- to read a file or stdin). |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create workflow
|
||||
|
||||
```bash
|
||||
sim workflows create [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | Yes | Workflow name. |
|
||||
| `--description <value>` | No | Optional workflow description. |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a workflow folder at a path
|
||||
|
||||
```bash
|
||||
sim workflows folders create <path>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete workflow folder
|
||||
|
||||
```bash
|
||||
sim workflows folders delete <path> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--recursive` | No | Delete the folder and its descendants. |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List workflow folders
|
||||
|
||||
```bash
|
||||
sim workflows folders list [options]
|
||||
```
|
||||
|
||||
Also available as `sim workflows folders ls`.
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--parent <value>` | No | Direct parent folder path. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the folder name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Rename or move a workflow folder
|
||||
|
||||
```bash
|
||||
sim workflows folders move <path> <destination>
|
||||
```
|
||||
|
||||
Also available as `sim workflows folders mv`.
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path; the leading / is optional |
|
||||
| `destination` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Delete workflow
|
||||
|
||||
```bash
|
||||
sim workflows delete <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `-y, --yes` | No | Skip the confirmation. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Deploy workflow
|
||||
|
||||
```bash
|
||||
sim workflows deploy <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | No | Optional label for the deployment version. |
|
||||
| `--description <value>` | No | Optional release note for the deployment version. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Run a deployed workflow
|
||||
|
||||
```bash
|
||||
sim workflows run <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--input <json\|@file>` | No | Trigger input as JSON (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--async` | No | Queue the run and return immediately. |
|
||||
| `--execution-timeout-seconds <value>` | No | Requested server-side timeout for an asynchronous run, in seconds. An upper bound, not the effective timeout: the run uses the smaller of this value and the plan's execution timeout, so requesting more than the plan allows silently yields the plan timeout. Rejected with `400` unless `async` is true. |
|
||||
| `--select-output <value...>` | No | Return blockName.field values (e.g. agent_1.content); missing fields are omitted (space-separated, or @path / @- with one value per line). |
|
||||
| `--include-file-base64` | No | Inline eligible output files as base64 content. Rejected when `async` is true. |
|
||||
| `--no-include-file-base64` | No | Send --include-file-base64 as false. |
|
||||
| `--base64-max-bytes <value>` | No | Maximum total bytes of file content to inline as base64. Rejected when `async` is true. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Print a workflow as a portable JSON document
|
||||
|
||||
```bash
|
||||
sim workflows export <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get workflow
|
||||
|
||||
```bash
|
||||
sim workflows get <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get workflow deployment
|
||||
|
||||
```bash
|
||||
sim workflows deployment list <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Get workflow version
|
||||
|
||||
```bash
|
||||
sim workflows versions get <id> <version>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
| `version` | Yes | Numeric deployment version. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List workflow versions
|
||||
|
||||
```bash
|
||||
sim workflows versions list <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Import workflow
|
||||
|
||||
```bash
|
||||
sim workflows import [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--workflow <json\|@file>` | Yes | Workflow export object, bare workflow state, or JSON string containing either form. (JSON, or @path / @- to read a file or stdin). |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
| `--name <value>` | No | Override for the imported workflow name. |
|
||||
| `--description <value>` | No | Override for the imported workflow description. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List workflows
|
||||
|
||||
```bash
|
||||
sim workflows list [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
| `--deployed-only` | No | Return only workflows with an active deployment when true. |
|
||||
| `--no-deployed-only` | No | Send --deployed-only as false. |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
| `--search <value>` | No | Case-insensitive substring match against the resource name. |
|
||||
| `--sort-by <value>` | No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `position`, `name`, `createdAt`, `updatedAt`, `runCount`. |
|
||||
| `--sort-order <value>` | No | Sort direction. Accepted values: `asc`, `desc`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Rollback workflow
|
||||
|
||||
```bash
|
||||
sim workflows rollback <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--version <value>` | No | Deployment version to reactivate. Omit to select the previous active version. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Take a workflow out of deployment
|
||||
|
||||
```bash
|
||||
sim workflows undeploy <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Update workflow
|
||||
|
||||
```bash
|
||||
sim workflows update <id> [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--name <value>` | No | Replacement workflow name. |
|
||||
| `--description <value>` | No | Replacement workflow description; null clears it. |
|
||||
| `--folder <value>` | No | Folder path; the leading / is optional. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Move a workflow to a folder
|
||||
|
||||
```bash
|
||||
sim workflows mv <id> <folder>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `id` | Yes | Unique workflow identifier. |
|
||||
| `folder` | Yes | Folder path; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## List workflow resources and child folders together
|
||||
|
||||
```bash
|
||||
sim workflows ls [path] [options]
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | No | Folder path to list; defaults to the root folder |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--search <text>` | No | Filter folders and resources by name. |
|
||||
| `--limit <n>` | No | Maximum combined items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
|
||||
## Create a workflow directory at a path
|
||||
|
||||
```bash
|
||||
sim workflows mkdir <path>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Argument | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `path` | Yes | Folder path to create; the leading / is optional |
|
||||
|
||||
</CommandTable>
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: Workspaces
|
||||
description: Manage workspaces — every subcommand, argument, and flag
|
||||
---
|
||||
|
||||
import { CommandTable } from '@/components/ui/command-table'
|
||||
|
||||
`sim workspaces` is also spelled `sim workspace`.
|
||||
|
||||
Every command below also accepts the [global options](/cli/commands#global-options).
|
||||
|
||||
## Get workspace
|
||||
|
||||
```bash
|
||||
sim workspaces get
|
||||
```
|
||||
|
||||
## List workspace members
|
||||
|
||||
```bash
|
||||
sim workspaces members [options]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
<CommandTable>
|
||||
|
||||
| Option | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
|
||||
|
||||
</CommandTable>
|
||||
Reference in New Issue
Block a user