@kortyx/cli 0.11.4 → 0.12.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.12.0](https://github.com/kortyx-io/kortyx/compare/cli-v0.11.4...cli-v0.12.0) (2026-10-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * **evals:** run conversation suites from Studio and CLI ([#251](https://github.com/kortyx-io/kortyx/issues/251)) ([e653c91](https://github.com/kortyx-io/kortyx/commit/e653c9188d2fad4da0c75e79d090a8dedb639b92))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @kortyx/agent bumped to 0.29.0
16
+ * @kortyx/telemetry-contracts bumped to 0.13.0
17
+
3
18
  ## [0.11.4](https://github.com/kortyx-io/kortyx/compare/cli-v0.11.3...cli-v0.11.4) (2026-09-30)
4
19
 
5
20
 
package/README.md CHANGED
@@ -248,6 +248,124 @@ profile referencing that project's read key—even if the deployment URL is the
248
248
  same. Account login and remote project/key administration are not implemented.
249
249
  VPN/private-network requirements remain in effect.
250
250
 
251
+ ## Eval suites and CI
252
+
253
+ ## Run locally without Studio
254
+
255
+ Export the existing `createEvals` instance as `evals` (or the default export) from
256
+ an application module such as `src/evals/index.ts`. Use a dedicated eval module
257
+ that initializes the agent and suites without starting your HTTP server.
258
+ TypeScript and JavaScript entries use the CLI's existing module loader and nearest
259
+ `tsconfig.json` path aliases. The loader stays active for lazy workflow imports
260
+ until execution finishes. Keep initialization synchronous; do asynchronous
261
+ identity setup inside `createEvals.setup`.
262
+
263
+ Add a script to your application's `package.json`:
264
+
265
+ ```json
266
+ {
267
+ "scripts": {
268
+ "eval": "kortyx evals run --entry ./src/evals/index.ts"
269
+ }
270
+ }
271
+ ```
272
+
273
+ ```sh
274
+ pnpm eval
275
+ pnpm eval --suite product-ambiguity --case choose-blue --repetitions 3
276
+ pnpm exec kortyx evals list --entry ./src/evals/index.ts
277
+ pnpm eval --suite product-ambiguity --concurrency 2 --json > eval-results.json
278
+ ```
279
+
280
+ The command calls the exported instance's `run()` directly. Your existing setup,
281
+ permission binding, custom executor, interrupt responders, cleanup and code judge
282
+ all run in the application process. No Studio, consumer HTTP endpoint, target
283
+ configuration or Studio key is required. Semantic criteria require a code judge;
284
+ interaction and structured-output checks alone require no judge. Workflow models,
285
+ tools and authentication still need their usual application configuration.
286
+
287
+ The CLI loads `.env` then overlays `.env.local` before importing the entry.
288
+ In a monorepo it loads defaults from the Git or pnpm workspace root down to the
289
+ app directory, with nearer files taking precedence. Existing shell variables
290
+ always win.
291
+ To select other files, repeat `--env`; later files override earlier ones:
292
+
293
+ ```sh
294
+ pnpm eval --env /private/development.env --env /private/eval.env
295
+ ```
296
+
297
+ For a one-line package script without repeated flags, remember paths in a
298
+ **gitignored** `.env.evals.json` in the app or workspace root:
299
+
300
+ ```json
301
+ {
302
+ "envFiles": ["/private/development.env", "/private/eval.env"]
303
+ }
304
+ ```
305
+
306
+ Keep the profile and referenced files owner-only (`chmod 600`). Relative paths
307
+ in the profile resolve from its directory. The nearest profile replaces default
308
+ env loading; discovery stops at a Git or pnpm workspace boundary. Explicit
309
+ `--env` flags replace both the profile and defaults, and resolve from the
310
+ invocation directory. Missing configured files fail before loading the app;
311
+ credentials are never printed. The CLI handles loading directly, so no launcher
312
+ script or shell exports are required. Package scripts in monorepos can forward
313
+ with `pnpm --filter my-agent eval`.
314
+
315
+ Model credentials remain application-owned, for example `OPENROUTER_API_KEY`
316
+ for an OpenRouter app judge. Studio's judge settings are not used by this command.
317
+
318
+ Omitting `--suite` runs all configured suites in definition order. `--case` accepts
319
+ space-separated case IDs and requires `--suite`. `--repetitions` and `--concurrency`
320
+ override the SDK's run settings; omitted flags preserve them. `--export NAME`
321
+ selects another named instance instead of `evals`/default.
322
+
323
+ Interactive terminals show an animated suite progress bar, one live row per active
324
+ attempt, elapsed time, and the actual setup, workflow, interrupt-response, judging
325
+ and cleanup phases. Every completed step and case gets its own result, followed
326
+ by a colored suite verdict and counts. Long calls keep animating; concurrent
327
+ attempts remain distinct. The bar measures completed attempts, not estimated model
328
+ completion. Application logs/warnings are preserved above the live display.
329
+ Piped output is plain text with per-case start and step results; `--no-color` or
330
+ `NO_COLOR` disables color/live progress. Explicit `--color` forces the interactive
331
+ report, including when `NO_COLOR` is set. `--json` always disables the terminal UI.
332
+ `--json` replaces the report with one JSON object containing `schemaVersion: 1`, `status`, aggregated
333
+ `counts`, and full SDK `runs` (including observations). Keep application logs off
334
+ stdout when consuming JSON. Configuration/import failures use stderr.
335
+
336
+ Exit status is `0` when all selected suites pass, `1` for failed/errored runs or
337
+ configuration errors, and `130` for cancellation. Ctrl+C forwards an abort signal,
338
+ allows SDK cleanup and stops later suites. Cancellation remains cooperative: app
339
+ code must honor its signal. Results are returned in the terminal/JSON; this local
340
+ command does not save eval records to Studio. Agent telemetry, if configured by
341
+ the application, continues to follow its existing settings.
342
+
343
+
344
+ ```bash
345
+ kortyx studio evals suites list --connection staging --json
346
+ kortyx studio evals suites get product-ambiguity --target catalog --connection staging --include-content --json
347
+ kortyx studio evals runs start product-ambiguity --target catalog --connection staging --json
348
+ kortyx studio evals runs list --connection staging --json
349
+ kortyx studio evals runs get <eval-run-uuid-or-studio-url> --connection staging --json
350
+ kortyx studio evals runs cancel <eval-run-uuid-or-studio-url> --connection staging --json
351
+ ```
352
+
353
+ Eval commands reuse project connections and the Studio API. Discovery and reads
354
+ need `studio:read`; start/cancel also require `eval:run`. The application's eval
355
+ service key remains on the API server. Starting discovers the current revision,
356
+ enqueues once and returns the run ID immediately, without waiting for a grade.
357
+ Use `--case` repeatedly, `--repetitions` (1–20), `--concurrency` (1–4), and
358
+ `--environment` to select execution; total attempts are capped at 100.
359
+
360
+ Default detail exposes statuses, counts and criterion verdicts. Full definitions,
361
+ observations and reasons require `--include-content`; credentials remain redacted.
362
+ History is the latest 100 project records. Cancellation is cooperative. The CLI
363
+ does not retry a POST automatically or treat an accepted request as a passing eval.
364
+
365
+ See [CLI and post-deployment CI](https://github.com/kortyx-io/kortyx/blob/main/docs/evals/cli-and-ci.md)
366
+ for a `continue-on-error` CI step that enqueues a suite after deployment and
367
+ returns immediately, plus target configuration, permissions and output contracts.
368
+
251
369
  ## Push workflow topology to Studio
252
370
 
253
371
  Kortyx Studio should receive workflow topology as a build/deploy artifact, not only as best-effort runtime telemetry. Use `topology push` in local dev, release CI, or deployment pipelines: