sim 2.1.28 → 2.2.0-preview.172.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -166,7 +166,7 @@ is saved with the profile.
166
166
  sim profiles
167
167
  sim configure --profile work
168
168
  sim configure --profile work --set-workspace <workspaceId>
169
- sim configure --profile work --set-output json
169
+ sim configure --profile work --set-output table
170
170
  sim configure --profile local --set-endpoint http://localhost:3000
171
171
  sim whoami --profile work
172
172
  ```
@@ -198,6 +198,17 @@ sim workflows --help
198
198
  sim tables rows query --help
199
199
  ```
200
200
 
201
+ Or describe the task and let the CLI find the command. Search ranks the commands
202
+ this version ships, locally; your query is never sent anywhere:
203
+
204
+ ```bash
205
+ sim cli search "cancel a running workflow"
206
+ sim --output table cli search list table rows
207
+ ```
208
+
209
+ It returns the five best matches. When a coding agent runs the CLI, root and
210
+ group `--help` open with a note pointing it to `sim cli search`.
211
+
201
212
  The commands you will use most often are:
202
213
 
203
214
  | Task | Command |
@@ -242,16 +253,20 @@ argument, and flag.
242
253
 
243
254
  ## JSON input and output
244
255
 
245
- Human-readable tables are the default. Use JSON or YAML when another program
246
- will consume the result, and `text` for tab-separated shell output:
256
+ JSON is the default, so agents and scripts can parse every result directly.
257
+ Use `table` for aligned human-readable output, YAML if you prefer it, and `text`
258
+ for tab-separated shell output:
247
259
 
248
260
  ```bash
249
- sim workflows list --output json
250
- sim logs list --output json | jq -r '.data[].runId'
261
+ sim workflows list --output table
262
+ sim logs list | jq -r '.data[].runId'
251
263
  SIM_OUTPUT=yaml sim tables get <tableId>
252
- sim configure --set-output json
264
+ sim configure --set-output table
253
265
  ```
254
266
 
267
+ Scripts that must not depend on a profile's saved format can still pass
268
+ `--output json` explicitly.
269
+
255
270
  Paginated lists return `{ "data": [...], "nextCursor": "..." }` in JSON and YAML.
256
271
  `nextCursor` is `null` when no pages remain. Resource lists and directory `ls`
257
272
  fetch every page by default; use `--limit N` to cap them. Table rows (including
@@ -9,6 +9,9 @@ Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
9
9
  js-yaml
10
10
  Copyright (C) 2011-2015 by Vitaly Puzrin
11
11
 
12
+ minisearch
13
+ Copyright 2022 Luca Ongaro
14
+
12
15
  proper-lockfile
13
16
  Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
14
17
 
@@ -0,0 +1,10 @@
1
+ import { Command } from 'commander';
2
+ export interface SearchResult {
3
+ command: string;
4
+ summary: string;
5
+ }
6
+ /** Ranks every command in `program` against a plain-language query, best first. */
7
+ export declare function searchCommands(program: Command, query: string, exclude: Command): SearchResult[];
8
+ export declare function searchCommand(): Command;
9
+ /** Commands about the CLI itself rather than a Sim resource. */
10
+ export declare function cliCommand(): Command;
@@ -1,2 +1,2 @@
1
1
  export { configDir, configPath, credentialsPath, telemetryStatePath } from './paths';
2
- export { DEFAULT_ENDPOINT, DEFAULT_PROFILE, deleteProfile, FORBIDDEN_IN_VALUE, listAuthenticationDependents, listProfiles, normalizeEndpoint, normalizeWorkspaceId, OUTPUT_FORMATS, type OutputFormat, oauthIssuerForEndpoint, PROFILE_NAME_PATTERN, ProfileConfigError, type ProfileOverrides, type ResolvedProfile, readConfigProfile, readCredentialsProfile, readStoredCredential, readStoredOAuth, resolveAuthenticationProfileName, resolveProfile, type SettingSource, type StoredCredential, type StoredOAuthCredential, validateProfileName, withCredentialsLock, withProfileLoginLease, writeConfigProfile, writeCredentialsProfile, } from './profile';
2
+ export { DEFAULT_ENDPOINT, DEFAULT_OUTPUT_FORMAT, DEFAULT_PROFILE, deleteProfile, FORBIDDEN_IN_VALUE, listAuthenticationDependents, listProfiles, normalizeEndpoint, normalizeWorkspaceId, OUTPUT_FORMATS, type OutputFormat, oauthIssuerForEndpoint, PROFILE_NAME_PATTERN, ProfileConfigError, type ProfileOverrides, type ResolvedProfile, readConfigProfile, readCredentialsProfile, readStoredCredential, readStoredOAuth, resolveAuthenticationProfileName, resolveProfile, type SettingSource, type StoredCredential, type StoredOAuthCredential, validateProfileName, withCredentialsLock, withProfileLoginLease, writeConfigProfile, writeCredentialsProfile, } from './profile';
@@ -20,6 +20,12 @@ export declare const DEFAULT_ENDPOINT = "https://www.sim.ai";
20
20
  */
21
21
  export declare const OUTPUT_FORMATS: readonly ['table', 'json', 'yaml', 'text'];
22
22
  export type OutputFormat = (typeof OUTPUT_FORMATS)[number];
23
+ /**
24
+ * JSON unless the flag, `SIM_OUTPUT`, or the profile says otherwise: agents and
25
+ * scripts are the main callers and parse it directly, and a person who prefers
26
+ * tables saves that once with `sim configure --set-output table`.
27
+ */
28
+ export declare const DEFAULT_OUTPUT_FORMAT: OutputFormat;
23
29
  export { FORBIDDEN_IN_VALUE, ProfileConfigError } from './ini';
24
30
  /**
25
31
  * Makes a rejected value safe to quote inside an error message.