@toloka-platform/sdk 0.19.0 → 0.19.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/docs/cli.md DELETED
@@ -1,561 +0,0 @@
1
- # CLI reference
2
-
3
- The `toloka` CLI reads TypeScript source as the desired state, compares it with the live platform state, and reconciles the two.
4
-
5
- The CLI and SDK are versioned together. Before 1.0, commands and authoring APIs can change between minor releases.
6
-
7
- ## Install
8
-
9
- ```sh
10
- curl -fsSL https://platform.toloka.ai/cli/install.sh | sh
11
- ```
12
-
13
- The installer prefers stable Bun 1.4.0 or newer matching the host architecture and installs the SDK's CLI into Bun's global binary directory. If Bun is missing, older, or built for a different architecture, it installs a standalone executable in `~/.local/bin` without changing Bun. Native downloads support macOS and glibc Linux on ARM64/x64 and require `curl`, `tar`, `mktemp`, and `shasum` or `sha256sum`. Compatible Bun can be used on musl Linux; this shell installer does not support native Windows.
14
-
15
- Force the install mode:
16
-
17
- ```sh
18
- curl -fsSL https://platform.toloka.ai/cli/install.sh | sh -s -- --native
19
- curl -fsSL https://platform.toloka.ai/cli/install.sh | sh -s -- --bun
20
- ```
21
-
22
- `--native` ignores installed Bun. `--bun` fails if Bun is incompatible. A Bun package installation failure is reported, not retried as a native install.
23
-
24
- Add the printed directory to `PATH` if prompted. Verify the selected executable:
25
-
26
- ```sh
27
- toloka version --json
28
- ```
29
-
30
- Standalone installs report `"channel":"native"`. **Bun is the recommended runtime and package manager for SDK development:**
31
-
32
- ```sh
33
- bun add @toloka-platform/sdk@latest
34
- ```
35
-
36
- Use `bun i` for an existing project's dependencies. Training-only workflows need no SDK dependency. Local tests may also need Python or Chromium; see [Testing](./testing.md).
37
-
38
- The installer accepts these environment variables:
39
-
40
- | Variable | Effect |
41
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
42
- | `TOLOKA_CLI_INSTALL_DIR` | Override the native install directory; use with `--native`. Bun mode rejects this option and uses Bun's global binary directory. |
43
- | `TOLOKA_CLI_CHANNEL` | Select `latest` (the default) or `preview`. |
44
- | `TOLOKA_CLI_PACKAGE` | Override the selected mode's package: an SDK package for `--bun`, a matching native package for `--native`. A trailing version or tag overrides the channel. |
45
- | `TOLOKA_CLI_REGISTRY` | Fetch installer metadata and the tarball from another npm registry. Automatic updates still use the public npm registry. |
46
-
47
- Pass overrides to the `sh` process on the right side of the pipe, for example `curl -fsSL https://platform.toloka.ai/cli/install.sh | TOLOKA_CLI_CHANNEL=preview sh`.
48
-
49
- ### Updates and migration from Bun global installs
50
-
51
- Standalone and Bun-global CLIs check the public npm registry at most daily and install eligible releases at least 24 hours old, then rerun the command. Disable with `toloka config set auto-update false`. Project-local installs, CI, help, version, and config commands skip updates; `TOLOKA_SKIP_AUTO_UPDATE=1` also skips them. `TOLOKA_AUTO_UPDATE=0` or `1` overrides the stored setting for one command.
52
-
53
- For a manual update, rerun the installer with the original mode (`--bun` or `--native`), directory, channel, package, and registry overrides. A version pin does not disable auto-update; automatic updates always use the public npm registry.
54
-
55
- If both installations exist, put the desired directory first on `PATH`, run `hash -r` (Bash) or `rehash` (Zsh), and check `toloka version --json`: `native` means the standalone executable, `global-registry` means the Bun-global CLI. Credentials, settings, and project dependencies stay unchanged.
56
-
57
- ## Configuration
58
-
59
- Credentials and the platform base URL resolve independently. Credentials use this precedence, highest first.
60
-
61
- | Precedence | Credential source |
62
- | ----------- | ------------------------------------------------ |
63
- | 1 (highest) | `--api-key` flag |
64
- | 2 | `TOLOKA_SCOPED_TOKEN` environment variable |
65
- | 3 | `TOLOKA_API_KEY` environment variable |
66
- | 4 | API key stored by `toloka login --api-key-stdin` |
67
- | 5 (lowest) | browser session stored by `toloka login` |
68
-
69
- | Precedence | Base URL source |
70
- | ----------- | --------------------------------------- |
71
- | 1 (highest) | `--base-url` flag |
72
- | 2 | `TOLOKA_BASE_URL` environment variable |
73
- | 3 | base URL stored in the credentials file |
74
- | 4 (default) | `https://platform.toloka.ai` |
75
-
76
- | Precedence | Project id source |
77
- | ----------- | --------------------------------------------- |
78
- | 1 (highest) | `--project-id` flag |
79
- | 2 | `TOLOKA_PROJECT_ID` environment variable |
80
- | 3 | `projectId` in `toloka.json` |
81
- | 4 (lowest) | `current` alias in the credentials file |
82
-
83
- Earlier releases named these variables `POTATO_API_KEY`, `POTATO_BASE_URL`, and `POTATO_PROJECT_ID`. The CLI still reads each legacy name when its `TOLOKA_*` counterpart is unset, prefers the `TOLOKA_*` value when both are set, and prints `POTATO_API_KEY is deprecated and will stop being read; set TOLOKA_API_KEY instead.` (and the same line for the other two) on stderr once per command. The aliases remain supported for compatibility; rename them to silence the warning and use the current names in new automation.
84
-
85
- `TOLOKA_SCOPED_TOKEN` always sends its value in `X-Scoped-Token`, so it supports both issued `pst_…` tokens and secret placeholders such as `dtn_secret_…`. The `--api-key` and `TOLOKA_API_KEY` slots continue to recognize the `pst_` prefix for backward compatibility. Use the explicit scoped-token variable for new agent and CI configuration.
86
-
87
- `toloka login` verifies access against the platform before saving anything. A browser login is saved as a session file under `$TOLOKA_CLI_CREDENTIALS_DIR`, which defaults to `~/.toloka/cli/credentials/<auth-host>/<realm>/<client>.json`. When `TOLOKA_CREDENTIALS_FILE` points at an explicit credentials file, sessions go to a `browser-sessions` directory next to it instead, so that profile stays isolated. The platform choice, a stored API key, and local project aliases live in `$XDG_CONFIG_HOME/toloka/credentials.json`, which defaults to `~/.config/toloka/credentials.json`. Both are written with file mode `0600` in directories with mode `0700`. The legacy `~/.toloka/credentials.json` is still read when the new path has no file. `toloka logout` ends the browser session and deletes both files; it does not revoke an API key.
88
-
89
- Ordinary usage events (`sdk_cli_command_completed` / `sdk_cli_command_failed`) go to Toloka's PostHog project so we can see which commands run and which error classes they hit. Every failed command with an exception also emits a sanitized PostHog Error Tracking `$exception`; usage errors such as unknown commands or invalid flags do not. Command events contain only an allowlisted command classifier, duration, exit code, outcome or error code, optional HTTP status and server request ID, SDK and Bun versions, actor, and channel. Error Tracking receives the same bounded metadata plus a synthetic exception; raw arguments, flag values, environment variables, API keys, secret names, base URLs and hosts, local paths, project ids, error messages, stack traces, response bodies, and source context are not sent. GeoIP enrichment is disabled. Distinct id starts as a random UUID stored next to the credentials file. After a successful authenticated command, the CLI calls `GET /me` and aliases that UUID onto the platform user id without setting person properties. Set `TOLOKA_TELEMETRY=0` or `DO_NOT_TRACK=1` to disable capture. CI environments are disabled unless `TOLOKA_TELEMETRY=1`. The explicitly approved full-text `report` event is documented in [report](#report).
90
-
91
- The root program accepts these flags before any command:
92
-
93
- | Flag | Meaning |
94
- | --------------------------- | ---------------------------------------------------------------- |
95
- | `--source-root <directory>` | Project root; discovered from the working directory when omitted |
96
- | `--api-key <key>` | API key for this command only |
97
- | `--base-url <url>` | Platform base URL for this command only |
98
- | `--project-id <id>` | Target project; overrides env, checkout, and the registry |
99
-
100
- Commands resolve the project root by walking up from the working directory until they find a `toloka.json` file. The CLI reports that directory on stderr when it differs from the working directory. Passing `--source-root` disables discovery. With no marker found, the working directory is used. `init` and `report` do not walk up: they use the working directory or `--source-root` only. The authentication commands `login`, `logout`, and `auth-status` do not need a project root.
101
-
102
- The CLI colors its output only when standard output is a terminal. `NO_COLOR` with any value, or `TERM=dumb`, turns color off. `FORCE_COLOR` overrides the terminal detection in both directions: `FORCE_COLOR=0` turns color off even on a terminal, and any other value turns it on even when the output is piped.
103
-
104
- ## Errors and hints
105
-
106
- A failing command prints its message to stderr and exits `1`. Most messages are followed by a `Hint: …` line with the next command to run; messages that already spell out the remedy carry no hint. Platform failures print `Potato API request failed with status <code> (request id: <id>)`, the response body, and a status-based hint: `401`/`403` point at `toloka whoami` and `toloka login`, `404` at the selected project and the matching list command, `429` asks you to wait, and `5xx` asks you to retry and then send a report with `toloka report <report.md>`.
107
-
108
- ## Resources and Base Actions
109
-
110
- The CLI is resource-first: `toloka <resource> <action>`. A Base Action has one meaning wherever a resource implements it. A resource exposes only the Base Actions that have real behavior; there are no placeholder actions.
111
-
112
- | Base Action | Meaning |
113
- | ----------- | ----------------------------------------------------------------------------------------- |
114
- | `list` | Read a bounded, paginated collection of one Resource type. |
115
- | `get` | Read exactly one Resource selected by a stable identifier. |
116
- | `create` | Create exactly one Resource and return its stable identifier and representation. |
117
- | `delete` | Remove exactly one Resource selected by a stable identifier and return no representation. |
118
- | `url` | Read exactly one browser-ready URL with no surrounding prose. |
119
-
120
- Resources may also expose specialized actions beyond the Base Actions, such as `pipeline cost`, `skill search`, and `skill install`.
121
-
122
- ## version
123
-
124
- Print the SDK/CLI version. `toloka version --json` also prints build provenance: the build commit, the install channel (`native`, `global-registry`, `linked`, or `project-local`), the executable path for a native install, and the package path for a linked install. `toloka -v` and `toloka --version` remain semver-only for scripts.
125
-
126
- ```sh
127
- toloka version [--json]
128
- ```
129
-
130
- ## project
131
-
132
- Register and select the platform project later commands use.
133
-
134
- ```sh
135
- toloka project list [--limit <n>]
136
- toloka project add [alias] [projectId]
137
- toloka project switch <alias>
138
- toloka project current
139
- toloka project url
140
- toloka project remove <alias>
141
- toloka project create [alias] [--name <name>] [--team-id <id>] [--delivery-order-id <id>]
142
- toloka project untrack <pipeline|dataset> <name> [--confirm]
143
- toloka project token [--preset <name>] [--permissions <list>] [--expires-in <seconds>] [--projects <list>]
144
- toloka project tokens
145
- toloka project revoke-token <tokenId>
146
- toloka project revoke-tokens
147
- ```
148
-
149
- `token` mints a project-scoped token for the selected project and prints it once; it is never stored. The token acts as you inside that project (plus any `--projects`, which must belong to the same team) with the permissions of the `--preset` (`read`, `write`, `deploy`, `labeling-read`, `labeling-write`, `labeling-deploy`; default `write`) or an explicit `--permissions` list, and expires after `--expires-in` seconds (60..21600, default six hours). Hand it to an agent as `TOLOKA_API_KEY`. One user may hold at most 1000 live tokens per project, counted against every project the token covers; beyond that, `token` fails with `429 You already hold 1000 live tokens for project <id>; revoke unused tokens first`.
150
-
151
- `tokens` lists every live token of the selected project, newest first, with its id, user, expiry, projects, and permissions. `revoke-token <tokenId>` revokes one token and prints `Revoked <tokenId>.`; `revoke-tokens` revokes every live token of the selected project in one call and prints `Revoked <n> tokens.`. A token that covers several projects is revoked as a whole by either command. Revocation takes effect immediately.
152
-
153
- `add`, `switch`, `remove`, and `create` write the machine registry in the credentials file. They refuse `--api-key` / `--base-url` / `TOLOKA_*` when those would select a different key or platform than the stored file. `project list` prints project id, name, and team id. `create` uses the account's only writable team (`GET /me` lists the teams; `whoami` prints them) and asks for `--team-id` when there are several. A project owned by an internal team also needs `--delivery-order-id`; `toloka delivery-order list` shows the orders and answers with an explanation for accounts without internal teams.
154
-
155
- `project untrack` removes one pipeline or dataset binding from `toloka.json` without deleting the live resource. It previews the name and id in a terminal; outside a terminal, pass `--confirm` after reviewing the state file.
156
-
157
- `list` prints `CURRENT`, `ID`, `NAME`, and `ALIAS` columns. `*` marks the selected project and `-` marks an unselected project or missing alias.
158
-
159
- `url` fetches the selected project to resolve its team and prints only its platform UI URL to stdout, making the output safe to capture in scripts and agent workflows.
160
-
161
- ## delivery-order
162
-
163
- Lists the Sunday delivery orders this key can attach on `project create`. The command is always registered; the platform answers `403` for accounts without an internal team, which the CLI reports as `Delivery orders are available to internal teams only.`
164
-
165
- ```sh
166
- toloka delivery-order list
167
- ```
168
-
169
- Prints `ID`, `NAME`, `STATUS`, and `CLIENT` columns. Empty output is `No delivery orders visible.`
170
-
171
- ## audience
172
-
173
- Inspect the global, read-only expert audience catalog: the values a node's `audienceAndPricing.audience` filter can use.
174
-
175
- ```sh
176
- toloka audience specialization list [--json]
177
- ```
178
-
179
- Lists every expert specialization (platform qualification) with `ID`, `NAME`, and `EXPERTS` columns, sorted by name. Copy `ID` into `qualificationId` and `NAME` into `value` of `audience.specializations.values[]`; never invent a `qualificationId`. `EXPERTS` is the number of ID-verified experts currently eligible for tasks who hold the specialization; it can be `0` while the id is still valid. Pass `--json` for the full array. Empty output is `No specializations available.`
180
-
181
- ## generation-model
182
-
183
- Inspect the global, read-only catalog of models a synthetic `generation` node can use.
184
-
185
- ```sh
186
- toloka generation-model list [--json]
187
- ```
188
-
189
- Prints one row per model and reasoning effort with `ID`, `NAME`, `REASONING EFFORT`, `TYPICAL`, `MIN`, and `MAX` columns, then the default and recommended models. Copy `ID` into `generationModelId`. A `-` in `REASONING EFFORT` means the model does not support `reasoningEffort`; leave it unset there. `MIN` and `MAX` bound the `maxCostPerAttempt` apply accepts; a budget below `TYPICAL` is accepted with a warning because generation can stop before the result is complete. `--json` adds each model's description. Empty output is `No generation models available.`
190
-
191
- ## login
192
-
193
- Signs in through the browser, or stores an API key, after verifying access.
194
-
195
- ```sh
196
- toloka login
197
- toloka login --browser
198
- toloka login --no-browser
199
- toloka login --api-key-stdin < key.txt
200
- ```
201
-
202
- By default the command asks whether to sign in through the browser or with an API key. The browser choice opens a local page in the system browser where you continue with Google or Microsoft, the same providers as the platform's own sign-in page (testing environments also offer email and password and the testing users), or follow the link to create a Toloka account first; the page hands you to the Toloka login page, a one-time loopback redirect returns the result to the CLI, and the CLI verifies access by listing projects before saving anything. On success it prints `Logged in to <base-url> as <email>`, then the number of projects visible and when the session stops renewing. The session carries a short-lived access token that the CLI renews on its own; renewal stops 14 days after signing in, or after 8 days without use, and the next command asks you to run `toloka login` again. The session is a credential for the platform API only; it does not work against other Toloka services. `--browser` skips the question and goes straight to the browser flow, even when `TOLOKA_API_KEY` is set; coding agents and scripts that sign the user in should pass it. `--no-browser` does the same but prints the link instead of opening a browser. Set `BROWSER` to choose the browser command.
203
-
204
- Browser login is available for `https://platform.toloka.ai` and the `*.platform.toloka-test.ai` environments. Without a terminal the command opens the chooser page directly and fails fast when no browser can be opened; automation uses an API key instead.
205
-
206
- The API key choice does not expire: the key works until it is deleted in the Business Console, which suits scripts and CI. Choosing it asks for the key with masked input; `--api-key-stdin` reads it from standard input instead, so it never appears in shell history or the process list; `--api-key <key>` and `TOLOKA_API_KEY` also work but expose the key to both. For an already-issued project-scoped token, set `TOLOKA_SCOPED_TOKEN` for the command instead of storing it with `login`. Platforms without a known login service go straight to the API key prompt. The command verifies the key and prints `Authenticated against <base-url> with an API key`, then the number of projects visible, where the key is stored, and a reminder that the key does not expire until you delete it in the Business Console.
207
-
208
- ## logout
209
-
210
- Ends the browser login and removes stored credentials from this machine.
211
-
212
- ```sh
213
- toloka logout
214
- ```
215
-
216
- On success it prints `Removed <paths>.`; after a browser login it also ends every stored browser session (production and testing) at the login service, and after an API-key login it notes that the key is not revoked. When nothing is stored, it prints `No stored credentials found at <path>.`
217
-
218
- ## auth-status
219
-
220
- Shows which platform and login the CLI would use. Alias: `whoami`.
221
-
222
- ```sh
223
- toloka auth-status [--show-token]
224
- ```
225
-
226
- On success it prints the platform URL with its source, then either the masked API key, the masked scoped token with `from TOLOKA_SCOPED_TOKEN`, or a `Login:` line for the browser session and a `Session:` line with the current refresh window. It then prints the selected project, `Reachable: N project(s) visible.`, `Account:` with the email the platform reports, `Internal: true` or `Internal: false` for the account, and a `Teams:` line that marks each team `(internal)` and `(read-only)` where that applies. The project line is printed even when the probe fails. `--show-token` prints the full active credential instead of the mask; pass it only when you need the raw value on this terminal. It exits `1` when no login is in effect, when the browser session has expired, when the platform rejects the credential, or when the platform cannot be reached.
227
-
228
- ## config
229
-
230
- Reads and writes machine CLI settings. The only setting today is `auto-update`, which defaults to `true`.
231
-
232
- ```sh
233
- toloka config
234
- toloka config get
235
- toloka config get auto-update
236
- toloka config set auto-update false
237
- ```
238
-
239
- `config` and `config get` with no name print `auto-update=true` or `auto-update=false`. `config get auto-update` prints only the boolean. `config set auto-update <value>` accepts `true` / `false` / `1` / `0` / `on` / `off` / `yes` / `no` and prints `Set auto-update to <boolean>.` Unknown names and values exit `1`.
240
-
241
- ## init
242
-
243
- Initializes the current project directory and installs the Agent Bootstrap entry points.
244
-
245
- ```sh
246
- toloka init
247
- ```
248
-
249
- `init` does not require a selected platform project. It always maintains one `<toloka>` … `</toloka>` Agent Bootstrap block in `AGENTS.md` and writes minimal pointers to it: `.claude/skills/toloka-bootstrap/SKILL.md` when `.claude/` exists (or when no agent configuration exists at all) and `.cursor/rules/toloka-bootstrap.mdc` with `alwaysApply: true` when `.cursor/rules/` exists. The bootstrap tells an agent to run `toloka --help`, search the bundled Skill Catalog with `toloka skill search`, install a matching skill with `toloka skill install`, and read `.agents/skills/<skill-id>/SKILL.md`; it does not embed the build workflow. Bytes outside the block are preserved, and re-running `init` refreshes the block and both pointers in place without adding duplicates. When a project is already selected through `--project-id`, `TOLOKA_PROJECT_ID`, `toloka.json`, or the machine registry, it also writes `toloka.json` when missing. It does not walk up to a parent checkout.
250
-
251
- `init` removes only Toloka-generated legacy entry points that still carry the `<!-- toloka:sdk-version … -->` marker: the full `toloka-build` and `toloka-pipeline-as-code` Claude skills and Cursor rules, plus the `<!-- toloka:begin -->` … `<!-- toloka:end -->` block in `AGENTS.md`, which is replaced by the `<toloka>` block in place. Files without that marker, other skills and rules, and installed skills under `.agents/skills/` are left untouched. An `AGENTS.md` whose current or legacy block is unterminated, reversed, or duplicated is refused with the file's full path before anything, including `toloka.json`, is written.
252
-
253
- On success it prints `Initialized agent entry points for @toloka-platform/sdk <version> in <root>:` followed by the file list and one `removed <path>` line per legacy entry point, or `Agent entry points are up to date` when nothing changed. It warns on stderr when the SDK is not listed in the project dependencies. Every other project command warns on stderr when a generated legacy entry point is still present or the recorded bootstrap version differs from the installed SDK; that warning never blocks the command. `support` commands skip the check because they never read the checkout.
254
-
255
- ## import
256
-
257
- Generates TypeScript source from a live project.
258
-
259
- ```sh
260
- toloka import [projectId] [-f]
261
- ```
262
-
263
- When `projectId` is omitted, the selected project is imported. If `pipelines/` already exists, the command exits with `Folder already exists: <path>. Pass --force to replace it.` Pass `-f` or `--force` to replace that directory. On success it prints `Imported project <projectId> with N pipelines and M datasets into <root>.` A pipeline without a dataset is written without `dataset` in its `definePipeline`.
264
-
265
- The generated nodes keep every stored check case, including cases of the retired `ui` and `llmqa` types. A check type with no cases is left out, and a node whose check types are all empty gets no `checks` at all. `plan` and `apply` treat a check type that source leaves out as unmanaged: they neither report nor remove the cases the platform has for it, so set a type to an empty array to remove its cases.
266
-
267
- A field whose JSON Schema is stored on the platform as invalid JSON or as an unsupported schema, for example after an unfinished edit in the UI, is imported as `field("name", invalidJsonSchema({ field, reason, text }))` with the stored text. Loading the source then fails with `Field "<name>" has an unreadable JSON Schema on the platform.` until you replace the call with a valid JSON Schema object; the next `apply` writes that schema and repairs the field.
268
-
269
- ## plan
270
-
271
- Shows what `apply` would change.
272
-
273
- ```sh
274
- toloka plan [--json]
275
- ```
276
-
277
- On success it prints `No changes.` when the platform matches source, otherwise `Plan: N changes` followed by one line per change. The plan also lists missing project secrets and dataset field schema conflicts so you can resolve them before applying. `--json` prints `{ "changes": [...], "missingSecrets": [...] }` instead, where each change has `kind`, `action`, `label`, and, when they apply, `pipeline`, `dataset`, and `id`.
278
-
279
- ## validate
280
-
281
- Runs platform spec validation for each bound pipeline and reports the latest matching check jobs. Does not write the graph.
282
-
283
- ```sh
284
- toloka validate [--wait]
285
- ```
286
-
287
- It prints one line per pipeline with its status, then its issues: `valid`; `invalid`; `checks-pending` when only check state is open, such as a stored test case or a lint that has not run on this graph; `checks-running` when `--wait` gave up on running checks; or `skipped` when the pipeline or its dataset is not on the platform yet. A `note:` line explains what to do next when `--wait` could not finish. Exits `1` when any submitted graph is invalid or its checks were still running at the `--wait` deadline.
288
-
289
- The platform lints a pipeline a few seconds after every apply. While a lint or a check is running, or a lint is about to start after an apply, validate lists it as `running running_node_check`; a lint that has not run on this graph and is no longer expected to start is `pending not_ran_node_check`; start it with `toloka pipeline lint`. `--wait` validates again every 5 seconds until nothing is running, for up to 5 minutes, then prints the final report; a pipeline whose source differs from the applied graph is not waited on, because its lints start only after `toloka apply`. Right after an apply, plain `toloka validate` can print `valid` and exit `0` while lints are still running, so run `toloka validate --wait` before treating an applied pipeline as valid.
290
-
291
- ## check
292
-
293
- Runs the complete local gate without platform credentials.
294
-
295
- ```sh
296
- toloka check [pipeline] [--node <name-or-id>] [--json] [--watch]
297
- ```
298
-
299
- The command loads authored source, runs the project's TypeScript compiler, typechecks every Task UI against declarations bundled with the installed SDK, runs Vitest, and compares passing typed test evidence with every code node, human-work node, and pipeline. Statuses distinguish `missing`, `failed`, `partial`, `warning`, and `infrastructure_error`. `partial` marks a Task UI whose upload or recording fields the headless browser could not exercise; it is reported but does not fail the gate. `warning` marks a `platform-rules` result: nodes connected to the root that break a rule the platform enforces on write (node names, quality criteria, Human QA review time, price, data collection media, exam limits, Training structure and block contents, and the 150,000-character limit of one node setting), each named with its node and setting path. It does not fail the gate, but `toloka apply` refuses to write that pipeline until it is fixed. Exit code `0` means all required checks passed, `1` means source, types, tests, or required coverage failed, and `2` means a required checker could not run.
300
-
301
- Use `test.code`, `test.ui`, and `test.pipeline` from `@toloka-platform/sdk/testing` to produce required evidence. Plain Vitest tests still run and can fail the command, but do not satisfy graph coverage. A focused check accepts a pipeline plus `--node`; `--watch` serializes reruns after relevant file changes.
302
-
303
- With `--watch`, the command prints one complete report after each serialized run. With `--watch --json`, each report is one JSON line.
304
-
305
- ## apply
306
-
307
- Runs the complete local gate, then makes the platform match source. It takes no options and never asks for confirmation.
308
-
309
- ```sh
310
- toloka apply
311
- ```
312
-
313
- Checks run before credentials are resolved or any platform request is made. A failed or missing required check exits `1`; a checker infrastructure error exits `2`. After a pass, the preflight refuses before any write when a pipeline or dataset is removed from source, a project secret is missing, or a dataset field schema conflicts. On success it prints `No changes.` or reports both the number of approved planned changes and the lower-level platform writes used to apply them.
314
-
315
- Apply imports each new pipeline first, without its dataset, so the platform validates the graph before any dataset or field is created; then it creates the missing datasets and fields and binds each new pipeline's dataset. When the platform rejects a new pipeline's graph, no dataset or field was created, although pipelines imported earlier in the same apply remain. When a later step fails, the next apply finds the imported pipeline by name and binds its dataset. For a pipeline that already exists, apply adds new dataset fields before it writes the graph, and a created field cannot be changed. A rejected graph lists each error on its own line as `- node <name>, <setting path>: <reason>`, at most 100 of them followed by `- …and <n> more`.
316
-
317
- ## secret set
318
-
319
- Sets a secret value without writing it to disk.
320
-
321
- ```sh
322
- toloka secret set <name> [--from-env <variable>]
323
- ```
324
-
325
- `<name>` is a secret name referenced by a code node. The value is read from stdin, or from the environment variable named by `--from-env`. A project ID is required. On success it prints `Set secret <name>.` On failure it prints `Failed to set secret <name>.` on stderr and exits `1`.
326
-
327
- ## status
328
-
329
- Reports project health: live pipeline, dataset, and secret counts, plus whether source has pending apply-plan changes.
330
-
331
- ```sh
332
- toloka status
333
- ```
334
-
335
- On success it prints the project id and name, team id, live counts, and either `Source has no pending changes.` or `Source has N pending change(s).` That last line means the same thing as `toloka plan`, not that every live resource is declared in source. The command takes no pipeline argument.
336
-
337
- ## pipeline
338
-
339
- Operate on a live pipeline in the selected project. Name or id is required unless a TTY picker can choose among several live pipelines. There is no implicit "the only pipeline."
340
-
341
- ```sh
342
- toloka pipeline list [--limit <n>]
343
- toloka pipeline lint [name] [--wait] [--timeout <ms>]
344
- toloka pipeline run [name] [--wait] [--timeout <ms>]
345
- toloka pipeline status [name]
346
- toloka pipeline runs [name] [--limit <n>]
347
- toloka pipeline cost [name] [--item-limit <n>]
348
- toloka pipeline cancel <runId> [--accept-without-review]
349
- toloka pipeline results <runId> [--limit <n>] [--failed]
350
- ```
351
-
352
- `pipeline list` prints live `name`, id, and a bound source directory when one exists. Zero live pipelines prints `This project has no pipelines.`
353
-
354
- `pipeline run` without `--wait` prints `Started run <id> is <status> for <name>.` and a follow-up that uses the pipeline id. Exit code `0` means only that the run was accepted. With `--wait`, it prints `Run <id> succeeded.` or `Run <id> failed.` and sets the exit code accordingly; see [Exit codes](#exit-codes).
355
-
356
- The platform rejects a run until the built-in lints of every node on the path from Start to End have finished. Lints start a few seconds after every `apply`, but not when dataset items or their values change, and a lint that runs for more than 5 minutes or waits more than 15 minutes to start fails as timed out. `pipeline lint` starts every lint without a current result: one that has not run on the current graph and dataset items, or whose last run failed. It always runs the lints that check dataset contents again, because edits to item values do not invalidate their results. It leaves running lints and the other finished lints alone and prints one line per lint. With `--wait` it waits for them, 5 minutes by default; exit code `0` means every lint finished, `1` that one failed or could not start, and `2` that one was still running when the wait ended. Read the findings with `toloka validate`.
357
-
358
- `pipeline run` does the same before it starts a run, then waits only for the lints of nodes on the path from Start to End, up to 5 minutes or the `--timeout` you pass, which bounds the whole command including the wait for the run. When a lint is still running when that time is up, it prints the lints, starts nothing, and exits `2`. Otherwise it asks the platform to start the run, and the platform rejects it if a lint on a connected node failed.
359
-
360
- A run needs at least one dataset item that matches the root node's dataset and filter. Otherwise `pipeline run` fails with `No dataset items match, so a run would have nothing to process.` and starts nothing. `apply` and `validate` still succeed over an empty dataset, so upload items or widen the filter, then run again.
361
-
362
- `pipeline status` reports the latest run of that pipeline. `pipeline runs` lists recent runs (default 10). `pipeline cost` forecasts what a run would bill. `pipeline cancel` and `pipeline results` take a run id.
363
-
364
- ## base-model
365
-
366
- Inspect the global, read-only Base Model Catalog.
367
-
368
- ```sh
369
- toloka base-model list [--json]
370
- toloka base-model get <id> [--json]
371
- ```
372
-
373
- Human-readable output is the default. `base-model list` prints aligned ID, name, provider, upstream-model, revision (first 12 characters) and upstream-snapshot URL columns; `base-model get` prints labeled fields including the full pinned revision and the `https://huggingface.co/<model>/tree/<revision>` snapshot URL. Pass `--json` for machine-readable output.
374
-
375
- ## model
376
-
377
- Manage Model metadata in the selected project.
378
-
379
- ```sh
380
- toloka model list [--json]
381
- toloka model get <name-or-id> [--json]
382
- toloka model versions <name-or-id> [--json]
383
- toloka model create <name> --base <base-model-id> [--description <text>] [--json]
384
- toloka model archive <name-or-id> [--json]
385
- ```
386
-
387
- `model create` creates project-owned Model metadata linked to one catalog Base Model; it does not create a Model Version. Human-readable output is the default for every command in this group. Pass `--json` for machine-readable objects or arrays. Weight upload, validation, download, and Model Version creation are deferred.
388
-
389
- ## training
390
-
391
- Create a reusable Training draft, price it, and run it.
392
-
393
- ```sh
394
- toloka training list [--json]
395
- toloka training get <name-or-id> [--json]
396
- toloka training create <name> [--method sft|gisting] (--base-model <id> | --model-version <id>) (--dataset <name-or-id> | --slice <id>) [--split-column <name-or-id>] [--parts <names>] [--prompt-file <path>] [--lora-rank 8|16|32 | --gist-tokens 8|32|64|1/4|1/8|1/16|1/32] [--epochs 1..5] [--learning-rate <rate>] [--batch-size 8|16|32|64] [--max-sequence-length <tokens>] [--json]
397
- toloka training update <name-or-id> [--base-model <id> | --model-version <id>] [--dataset <name-or-id> | --slice <id>] [--split-column <name-or-id>] [--parts <names>] [--prompt-file <path>] [--lora-rank 8|16|32 | --gist-tokens 8|32|64|1/4|1/8|1/16|1/32] [--epochs 1..5] [--learning-rate <rate>] [--batch-size 8|16|32|64] [--max-sequence-length <tokens>] [--json]
398
- toloka training cost <name-or-id> [--idempotency-key <key>] [--json]
399
- toloka training run <name-or-id> [--estimate-file <path>] [--version-name <name>] [--idempotency-key <key>] [--json]
400
- toloka training runs <name-or-id> [--json]
401
- toloka training status <training-run-id> [--json]
402
- toloka training resume <training-run-id> [--json]
403
- toloka training cancel <training-run-id> [--json]
404
- toloka training logs <training-run-id>
405
- toloka training metrics <training-run-id> [--key <metric>] [--resolution <n>] [--json]
406
- ```
407
-
408
- Hyperparameters are optional flags on `training create` and `training update`: `--epochs 1..5` (default 3), `--learning-rate` (SFT 0.00001–0.001, default 0.00015; gisting 0.001–0.3, default 0.03), `--batch-size 8|16|32|64` (default 8; sequences per optimizer step across all GPUs) and `--max-sequence-length 64..16384` (default 12288 for SFT, 3072 for gisting) apply to both methods; `--lora-rank 8|16|32` (default 16) is SFT-only and `--gist-tokens` (default `1/8`) is gisting-only — passing one to the other method fails before any request. `--gist-tokens` takes an absolute count `8|32|64` or a fraction of the prompt being compressed (`1/4`, `1/8`, `1/16`, `1/32`), which the run resolves to `ceil(prompt tokens / N)` clamped to 8..256. `--regime` and `--eval-steps` no longer exist. `training update` has no `--method` flag: the method stays as created, and every flag you omit keeps its current value. `training cost` is blocked when the longest example exceeds `--max-sequence-length` or when the training selection leaves fewer rows than `--batch-size` after the 10% holdout. `training get` prints the resolved recipe, so omitted flags are visible as their defaults.
409
-
410
- A Training learns on a ready dataset slice that freezes a split column, and `training create` needs `--dataset` or `--slice`. `--dataset <name-or-id>` fills the empty cells of the dataset's split column (a new `split` column, 80/10/10, when it has none), freezes a slice named after the Training, and trains on it; it waits up to 10 minutes for each step and prints one line per step before `Created training`. A split column adopted from an ordinary column has no shares, so `--dataset` does not fill it; give it shares first with `toloka dataset split <dataset> --column <name> --parts <name>=<roles>:<percent>,...`. `--slice <id>` takes a slice frozen with `toloka dataset slice create`. With several split columns, `--split-column` picks the one to train with. The Training learns on the column's train parts, or the ones `--parts` names, and validates on its validate parts, including a part that both validates and tests; without validation rows, the run holds out 10% of the training rows. Rows without a part are never trained on. `training update` keeps the slice, split column and train parts. A new `--dataset` or `--slice` resets the split column and train parts unless you pass them too; `--dataset` splits again and freezes a new slice named after the Training. `training get` prints the slice, split column and train parts. `training cost` leaves out rows that any split column now puts in a test part, a validate + test part of the Training's own column apart, and, when there are any, prints how many as `Left out as test`. The test parts of the Training's own column are outside the train parts to begin with, so they are not counted there. A Training saved before split slices were required is refused by `training cost` until `training update` gives it one.
411
-
412
- ## batch-inference
413
-
414
- Answer a dataset's chat rows with a catalog Base Model or a Model Version of the project.
415
-
416
- ```sh
417
- toloka batch-inference run --dataset <id> [--filter field=value] [--slice <slice-id>] [--parts <names> [--split-column <name>]] (--base-model <id> | --model-version <mdv.id|Model@name>) (--output-field <name> | --output-dataset <name>) --max-output-tokens <n> [--temperature 0..2] [--top-p <p>] [--stop <text>]... [--seed <n>] [--samples-per-row <n>] [--idempotency-key <key>] [--yes] [--json]
418
- toloka batch-inference list [--json]
419
- toloka batch-inference status <batch-inference-run-id> [--wait] [--json]
420
- toloka batch-inference confirm <batch-inference-run-id> [--json]
421
- toloka batch-inference resume <batch-inference-run-id> [--json]
422
- toloka batch-inference cancel <batch-inference-run-id> [--json]
423
- ```
424
-
425
- Each selected row sends its `messages` (and `tools`, if any) as the prompt; a trailing assistant turn and the label column are ignored, so a training or holdout dataset works as-is. Rows with no user turn to answer, and prompts over about 16,384 tokens (estimated the way training estimates examples: each character counts by its script, about 5 Latin letters or 2.5 Cyrillic letters to a token and every digit one, plus the chat template's markup per turn and tool), are skipped and counted in the quote; when no row is left, the run fails with `no_requests` before anything is held. `--slice` answers only the rows of a ready slice, with the prompts it froze; `--parts test` answers only the rows in those parts of the dataset's split column, and `--split-column` picks the column when there are several. With both, a split column the slice froze keeps the parts it had when the slice was taken. `run` freezes the selection, waits for the quote and prints the number of rows and the maximum charge; nothing is held or spent until you confirm, either with `--yes` on `run` or later with `confirm` within 24 hours. `--output-field` writes each answer as a new value of a text column on the same dataset, creating the column if it does not exist. An existing column must allow strings, including a string column limited to an enum, a pattern or a length; a column whose schema allows no string (a number, a boolean, an object, or an enum, const, anyOf, oneOf or allOf with no string option) is refused with "does not accept text" before anything is quoted, and an answer that breaks a column's constraint fails that row. `--output-dataset` creates a new chat-sft dataset and adds a row for each answer as it arrives, keeping the prompt, the answer and the source row; `--samples-per-row` asks for several answers to each row (with a temperature above 0), one dataset row per answer with its `sample` number. A sample that fails adds no row. Answers appear in the dataset as they are generated, and while the run writes, the column shows "Updating · done/total", and the field's `operations` in the API list the write, so a slice, a split or another run that reads the column waits until it ends. Each answer is a new value of the column; rows the run left without one are found with the column filter for rows missing a value from the run, and `status` counts the failures by reason. The run is charged for the GPU time it used, at most the quoted maximum; a cancel keeps the answers already generated and charges the time used, and a platform failure charges nothing. `status --wait` follows a run until it finishes or needs you.
426
-
427
- Batch inference runs on qwen3-4b and qwen3-8b: a catalog Base Model, or a Model Version trained from one of them (LoRA, full weights or gisting). `run` refuses other models before anything is quoted. The charge is the GPU time used at the quoted price per GPU-hour: at least $0.50 per GPU once the job has used any GPU time, and never more than the quoted maximum. A cancel pays for the time used so far. A run that fails on the platform's side, times out, or whose results cannot be read at all charges nothing; when only some answers cannot be read, the run completes, charges the GPU time used and counts those rows as failed. A `blocked` run says why in `status`: `funds` when the balance cannot cover the hold (add funds, then `resume`); `payment` when the charge could not be collected (add funds and `resume` within seven days, after which the run fails with `payment_window_expired`; the answers already written stay); `billing_review` when support has to reconcile the charge. With a scoped API token, `list` and `status` need `inference:read`, and `run`, `confirm`, `resume` and `cancel` need `inference:deploy`: the `deploy` preset grants both, `read` and `write` grant only `inference:read`, and the labeling presets grant neither.
428
-
429
- ## dataset
430
-
431
- Catalog and row commands for datasets in the selected project. Name or id is accepted; duplicate names must be addressed by id.
432
-
433
- ```sh
434
- toloka dataset list
435
- toloka dataset create <name>
436
- toloka dataset fields <name>
437
- toloka dataset fields add <name> (<field>… | --all) [--no-wait] [--timeout <ms>] [--json]
438
- toloka dataset columns <name> [--json]
439
- toloka dataset load <name> --out <file> [--fields <fields>] [--limit <n>] [--timeout <ms>]
440
- toloka dataset upload <name> <file>
441
- toloka dataset split <name> [--column <name>] [--ratios 80/10/10 [--validate-on-test] | --parts <name[=roles][:percent],…>] [--balance-by <field>] [--seed <n>] [--filter field=value… | --slice <slice-id>] [--no-wait] [--timeout <ms>] [--json]
442
- toloka dataset slice create <name> [--name <name>] [--filter field=value]… [--freeze <columns>] [--no-wait] [--timeout <ms>] [--json]
443
- toloka dataset slice create <name> --from <slice-id> [--name <name>] [--freeze <columns>] [--no-wait] [--timeout <ms>] [--json]
444
- toloka dataset slice list <name>
445
- toloka dataset slice show <slice-id> [--json]
446
- ```
447
-
448
- `dataset list` prints live `name` and id. It does not page items.
449
-
450
- `dataset create` makes an empty dataset in the selected project. The first `dataset upload` stores each row whole in the `uploaded` field and infers the fields of the rows; `dataset fields add` adds them as dataset fields.
451
-
452
- `dataset fields` prints inferred `field()` TypeScript, or `Dataset <name> has no inferred fields yet.`
453
-
454
- `dataset fields add` adds a dataset field for each named top-level field of the uploaded rows, with the type inferred from them, so `--filter`, `--balance-by` and `dataset split --column` can use its values; `--all` takes every top-level field that is not a dataset field yet. A dataset field name takes lowercase letters, numbers and underscores, starts with a letter, ends with a letter or number and has at most 128 characters: a named field that breaks the rule is refused, and `--all` skips such fields and prints which. The values are copied from the uploaded rows in the background, and from every later upload. The command waits up to 60 seconds for the copy (`--timeout <ms>` sets the wait) and prints the fields with their types; `--no-wait` returns at once. A slice or a split that reads a field refuses to start while the field is still being copied, and `dataset slice create` and `dataset split` wait for it first unless `--no-wait` is passed; `training create --dataset` always waits.
455
-
456
- `dataset columns` prints each visible column with its id and, for a split column, its status and its parts with shares and roles, for example `ready · train 80% (train), validate 10% (validate), test 10% (test)`. `--json` prints every field with its `split` and `operations`, the background operations writing into it: `copy` while values are copied in from the field `sourceFieldId` names, and `split_fill` while a split column fills.
457
-
458
- `dataset load` starts a platform export, waits for it (default 60s; pass `--timeout`), downloads the JSON array, and writes JSONL to `--out`: one object per row with `index` and every visible field, or only the fields `--fields` names, for example `--fields uploaded,split`. `uploaded` holds each uploaded row whole, as one value. `--limit` slices after download; it still waits for the full export. On timeout the message names the export id. Failed downloads and invalid payloads leave `--out` untouched. A dataset without fields has no rows yet, and the command exits with 1.
459
-
460
- `dataset upload` accepts `.json` arrays, `.jsonl` files with one object per line, and `.csv` files with a header row. The CLI infers the format from the extension and uploads the original bytes without conversion. If the blob transfer or finalization fails, the CLI cancels the started upload before returning the error, so another upload can start immediately and may reuse the same filename. Field schemas are immutable after the first successful upload: you can add columns, never alter or remove one. When the dataset has no fields besides `uploaded` yet, the CLI prints the `dataset fields add` command that adds the uploaded fields as dataset fields; when it has fields copied from the uploaded rows, it waits until the new rows' values are copied too. See [datasets](./datasets.md).
461
-
462
- `dataset split` fills a split column: every row that has no value in it gets a part, sampled by share, and rows that already have a part keep it, so a test row stays a test row as the dataset grows. `--column` names the column (default `split`). A new name creates it; the name of a split column fills its empty cells with the shares, balancing column and seed of its last fill; the name of an ordinary column whose values name the parts makes it a split column without placing anything, and naming it again changes nothing; since nothing is placed, `--seed`, `--balance-by`, `--filter` and `--slice` are refused there unless `--parts` gives shares. A name that is a field of the uploaded rows but not a dataset field is refused with the `dataset fields add` command that adds it, so a Hugging Face `split` field becomes a split column with `toloka dataset fields add <name> split` and then `toloka dataset split <name> --column split`. `--ratios` takes whole percentages for `train`, `validate` and `test` that add up to 100 (default `80/10/10` for a new column); a 0% part is left out. `--parts` takes `name[=roles][:percent]` entries with roles `train`, `validate`, `test`, `validate+test` or `none`, for example `train:70,dev=validate:10,holdout=test:20`; a part named after a role takes it without `=roles`. To make an ordinary column a split column, `--parts` without percentages names the parts its values hold; without `--parts`, roles follow the values `train`, `validation`, `validate`, `val`, `dev` and `test`, and every value must be one of them. A part keeps its roles across fills, and the column keeps the shares of its last fill. On a split column that has shares, `--parts` without percentages is refused; omit `--parts` to repeat the last shares. `--validate-on-test` makes the test part the validation set too, the usual split when data is scarce; it needs a validate ratio of 0, for example `--ratios 80/0/20 --validate-on-test`, and the test score is then not fully held out. `--balance-by` shares out the rows of every label value on their own, so each part gets about the same mix of labels, though a label with only a few rows can still miss a part; a column with more than 1,000 distinct values fails the fill. `--seed` fixes the row order: rows are ranked by a hash of the seed and each row's position in the dataset, so the same seed puts the same rows, uploaded in the same order, in the same parts in any dataset. It is generated when omitted and kept by the column. Shares carry over: rows that already have a part count toward it, so the column keeps its proportions as rows are added. `--filter field=value` (repeatable) places only the rows that match when the fill starts, and `--slice` only the rows of a slice, waiting while it is still freezing. Rows uploaded during a fill wait for the next one. The command waits up to 60 seconds for the rows to be placed (`--timeout <ms>` sets the wait), prints the column's parts and the rows each holds, and exits with the error when the fill fails; when the wait runs out the fill keeps running. `--no-wait` returns at once, and `dataset columns` shows the progress. A fill is refused while the same column is still filling, or while a field it reads, such as the `--balance-by` field, is still being copied from the uploaded rows or filled by another split; without `--no-wait` the command first waits until no field is being copied and no split column is filling.
463
-
464
- A dataset can have several split columns. A row that any of them puts in a test part never reaches training, nor validation unless it sits in a validate + test part of the Training's own split column, so a column such as `--column holdout --parts holdout=test:10,rest=none:90` holds rows out of every Training. Name the column to train with through `training create --split-column`.
465
-
466
- `dataset slice create` freezes rows at a cutoff: the rows that match every `--filter field=value` (the top-level field equals the value; repeat the flag for more fields), or every row. The slice's id (`dsl.…`) always selects the same rows, and its frozen columns always read as they were just before the cutoff. `--name` tells slices apart (default `Slice 1`, `Slice 2` and so on). Rows uploaded later are never in it, and it is refused while an upload to the dataset is still running, a split column is still filling, or a field it freezes is still being copied from the uploaded rows; without `--no-wait` the command first waits until no field is being copied and no split column is filling. A dataset without rows has nothing to freeze, so the command refuses it. `--freeze` names the columns to freeze (default: every column); split columns are always frozen, so a slice records the parts as they were. The other columns read their latest values, and so do extra filters on a slice, such as field values or excluded parts. `--from <slice-id>` takes a ready slice again: its filters and, unless `--freeze` says otherwise, its frozen columns at a new cutoff, so rows added since join, rows that no longer match drop out, and frozen columns take their current values. `--from` refuses `--filter`. The command waits up to 60 seconds for the rows to be frozen (`--timeout <ms>` sets the wait; the slice keeps freezing when it runs out) and exits with the error when the slice fails, for example when no row matches; `--no-wait` returns at once, and `dataset slice show` reports the name, status, row count, filters and frozen columns. A slice that matches no row fails.
467
-
468
- `dataset slice list` prints the dataset's slices, newest first, with their names and the slice each one was taken from. Every slice stays readable by id.
469
-
470
- ## report
471
-
472
- Preview and submit one Markdown issue report through the CLI's existing PostHog telemetry client. The command is project-independent: it does not read `toloka.json`, walk up to find a project root, require credentials, or call the Toloka API.
473
-
474
- ```sh
475
- toloka report <markdownPath> [--authored-by human|agent] [--confirm]
476
- ```
477
-
478
- The report path must name a non-empty regular UTF-8 file no larger than 256 KiB. The CLI refuses symbolic-link files and paths that traverse a symbolic-link directory under the selected source root. It prints the complete report, declared authorship, and platform origin before submission. Control and bidirectional formatting characters are escaped in the preview but preserved in the submitted report text.
479
-
480
- In a terminal the command asks `Send this report to Toloka? [y/N]`; outside a terminal it refuses unless `--confirm` is passed. `--authored-by` defaults to `human`. Add `--confirm` only after reviewing the exact preview.
481
-
482
- One `sdk_cli_issue_report_submitted` event carries `report_id`, the complete `report_text`, its UTF-8 `report_length_bytes`, `authored_by`, and `platform`, plus the standard pseudonymous CLI telemetry context. The command never reads or sends an API key. It flushes PostHog before printing `Submitted issue report: <id>`; a delivery failure exits non-zero and prints no success ID. When CLI telemetry is disabled, issue reporting is unavailable rather than bypassing that preference.
483
-
484
- ## ui
485
-
486
- Inspect the Task UI components the launcher renders. The command opens the launcher in a headless Chromium (Playwright from the project's `node_modules`), so it needs the same local setup as `toloka check` and no credentials.
487
-
488
- ```sh
489
- toloka ui components [names...] [--json]
490
- ```
491
-
492
- Without names it prints one line per public component (`name: description When to use: …`). With names it prints each component's description, when to use it, capabilities, limitations, best practices, the `propsType` contract, the value shape, and the documented JSX example with its output. An unknown name fails with `Unknown Task UI components: <name>`. `--json` prints the same contracts keyed by component name. The output always reflects the currently deployed launcher, so run it instead of guessing component names or props from memory.
493
-
494
- ## skill
495
-
496
- Discover bundled agent skills and install them into the project. The Skill Catalog ships inside the SDK package, so these actions are local and deterministic: they need no credentials, make no network requests, and change with the package version only.
497
-
498
- ```sh
499
- toloka skill list [--json]
500
- toloka skill search <query> [--json]
501
- toloka skill install <skillId> [--force]
502
- ```
503
-
504
- `list` prints every skill in the catalog with its installation status: `not-installed` when `.agents/skills/<skillId>` is absent, `current` when the installed files match the catalog digest, and `stale` when they differ. Each skill line (`id`, status, name) is followed by one indented description line. `--json` prints the Skill Descriptors (`id`, `name`, `description`, `tags`, `version`, `digest`, `files`) plus `status` and never includes file contents.
505
-
506
- `search` matches `<query>` case-insensitively against each skill's id, name, description, and tags and prints the matches in the same format. When nothing matches it prints `No skills match "<query>" in the catalog bundled with @toloka-platform/sdk <version>. …` (or `[]` with `--json`), exits 0, and installs nothing.
507
-
508
- `install` copies the complete skill — its `SKILL.md` entry point and every reference — from the package into `.agents/skills/<skillId>/` under the project root and prints the destination. Every path is confined to that directory and the command refuses to write through symbolic links. An existing `.agents/skills/<skillId>` is refused unless `--force` is passed. With `--force` the new copy is written to a temporary sibling directory and verified against the catalog digest, the existing directory is renamed to a backup, the verified copy is moved into place, and the backup is removed; a failed swap restores the backup, so the directory never holds a mixed version. A malformed catalog, an unsafe path, or a digest mismatch fails before any existing file changes.
509
-
510
- After an SDK upgrade `list` reports installed skills whose catalog digest changed as `stale` until they are refreshed with `install --force`. Local edits to an installed skill also make it `stale`; `list` and `search` never modify local files.
511
-
512
- The catalog is bound to the installed CLI version, so a skill that a newer release ships is absent from an older CLI. `install` then exits 1, names the missing skill and installed version, and creates nothing. Run `toloka skill list` to see the available skills. To get the current supported catalog, rerun the CLI installer and retry.
513
-
514
- ## Exit codes
515
-
516
- `toloka pipeline run --wait` maps the run outcome to the process exit code.
517
-
518
- | Code | `pipeline run --wait` | `check` / apply local gate |
519
- | ---- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
520
- | 0 | Run succeeded, or was accepted without `--wait` | All required local checks passed |
521
- | 1 | Run failed, or the platform refused to start it | Source, types, tests, or required coverage failed |
522
- | 2 | Run remained active when the wait window closed, or lints were still running and no run was started | A required checker could not run |
523
-
524
- The output tells the two exit-`2` cases apart: `Did not start a run of <name>: its lints are still running` means no run exists yet, so run `pipeline run` again later instead of polling `pipeline status`.
525
-
526
- Every other failure exits non-zero with a message on stderr: missing project identity, a rejected login, an unauthenticated `auth-status`, or a failed `secret set`.
527
-
528
- An unknown command exits 1 before anything else runs, even when `--help` is present: `toloka training --help` on a build without `training` prints `error: unknown command 'training'` followed by `toloka <version> does not have it. Run toloka --help to list its commands; a runbook that uses it may need a newer release.` on stderr, and does not print the root help. Only a command the installed version defines exits 0 with `--help`.
529
-
530
- ## The reconcile loop
531
-
532
- Treat the TypeScript source as authoritative. The canonical sequence is: run the complete local gate, validate against the platform, plan, apply, validate again once the platform lints finish, then plan again to confirm convergence.
533
-
534
- ```sh
535
- # 1. Run source, type, and typed test checks
536
- toloka check
537
-
538
- # 2. Validate each bound pipeline against the platform
539
- toloka validate
540
-
541
- # 3. Preview what apply would change
542
- toloka plan
543
-
544
- # 4. Apply only when the plan matches the intent
545
- toloka apply
546
-
547
- # 5. Wait for the platform lints that start after apply
548
- toloka validate --wait
549
-
550
- # 6. Confirm the platform matches source
551
- toloka plan # expect: No changes.
552
- ```
553
-
554
- `toloka apply` reruns the complete local gate before resolving credentials. `toloka validate` posts each authored graph to `POST /pipelines/:pipelineId/graph/validate`; it reports platform spec validation and the latest matching check runs without writing the graph. Resolve every unexpected plan change, missing secret, and immutable-field conflict before applying.
555
-
556
- ## Further reading
557
-
558
- - [Getting started](./getting-started.md)
559
- - [Authoring pipelines](./authoring.md)
560
- - [Datasets](./datasets.md)
561
- - [Troubleshooting](./troubleshooting.md)