Skip to content

Commit 7612e8d

Browse files
fix(cli): improve command usability and structure
1 parent e1810a6 commit 7612e8d

29 files changed

Lines changed: 1619 additions & 1222 deletions

‎packages/sim-cli/README.md‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ Settings → API keys.
107107

108108
## Commands
109109

110+
Plural resource names are canonical, but every plural top-level resource group
111+
also accepts its singular form: for example, `sim table list`,
112+
`sim file download`, and `sim workflow get` are equivalent to their plural
113+
spellings.
114+
110115
```bash
111116
sim workflows list [--folder <id>] [--deployed] [--limit <n>]
112117
sim workflows get <id>
@@ -119,9 +124,10 @@ sim logs execution <executionId>
119124
sim tables list
120125
sim tables get <tableId>
121126
sim tables columns <tableId>
122-
sim tables rows <tableId> [--filter <json>] [--sort <field:dir>…] [--limit <n>]
123-
sim tables insert <tableId> --data <json>
124-
sim tables delete-rows <tableId> (--row <id>… | --filter <json>) --yes
127+
sim tables rows list <tableId> [--limit <n>]
128+
sim tables rows query <tableId> [--filter <json>] [--sort <json>] [--limit <n>]
129+
sim tables upsert <tableId> --data <json>
130+
sim tables rows batch-delete <tableId> (--row <id>… | --filter <json>) --yes
125131

126132
sim files list
127133
sim files download <fileId> [-o <path>]
@@ -130,7 +136,7 @@ sim files delete <fileId>
130136
sim knowledge list
131137
sim knowledge get <id>
132138
sim knowledge documents <id> [--search <text>]
133-
sim knowledge search <query> --kb <id>…
139+
sim knowledge search --query <text> --kb <id>… [--search-mode vector|hybrid]
134140
```
135141

136142
### Filtering table rows
@@ -140,7 +146,7 @@ sim knowledge search <query> --kb <id>…
140146
grammar is a tree; there's no honest flag encoding for it.
141147

142148
```bash
143-
sim tables rows tbl_123 \
149+
sim tables rows query tbl_123 \
144150
--filter '{"all":[{"field":"status","op":"eq","value":"open"},
145151
{"field":"score","op":"gt","value":10}]}' \
146152
--sort score:desc --limit 50
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { profilesCommand } from './auth.js'
3+
4+
describe('profiles command', () => {
5+
it('accepts the singular profile alias', () => {
6+
expect(profilesCommand().alias()).toBe('profile')
7+
})
8+
})

‎packages/sim-cli/src/commands/auth.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export function whoamiCommand(): Command {
185185

186186
export function profilesCommand(): Command {
187187
return new Command('profiles')
188+
.alias('profile')
188189
.description('List the profiles defined in the config and credentials files')
189190
.action((_options: unknown, command: Command) => {
190191
const profiles = listProfiles()

‎packages/sim-cli/src/commands/hand-written.test.ts‎

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

0 commit comments

Comments
 (0)