@getmagical/cli 0.2.5 → 0.2.7

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
@@ -21,6 +21,145 @@ mgcl automation-runs list --automation-id ...
21
21
  mgcl automations run-draft --draft-automation-id ... --agent-id ... --idempotency-key ... --config-json '{"startInTakeOverMode":true,"captureActions":true,"approvalMode":"HUMAN_APPROVAL","consistencyCheckCount":3}'
22
22
  ```
23
23
 
24
+ ## Registered Evals
25
+
26
+ Registered evals and their persisted runs are global resources, so these
27
+ commands authenticate normally but do not accept `--org`:
28
+
29
+ ```bash
30
+ mgcl evals list --json
31
+ mgcl evals get --slug <eval-slug> --json
32
+
33
+ # A test run takes one concrete input and is never retried automatically.
34
+ mgcl evals test-run \
35
+ --slug <eval-slug> \
36
+ --input-json '{"model":"gpt-5"}' \
37
+ --json
38
+
39
+ # A persisted run takes arrays of choices and plans their Cartesian product.
40
+ mgcl evals plan-run \
41
+ --slug <eval-slug> \
42
+ --input-file ./eval-inputs.json \
43
+ --repeat-count 2 \
44
+ --json
45
+
46
+ mgcl evals run \
47
+ --slug <eval-slug> \
48
+ --input-file ./eval-inputs.json \
49
+ --repeat-count 2 \
50
+ --confirm-trials 20 \
51
+ --wait \
52
+ --json
53
+ ```
54
+
55
+ Pass exactly one of `--input-file` or `--input-json`. `evals run` always plans
56
+ first. In an interactive terminal it prompts with the exact trial count; JSON
57
+ and other non-interactive invocations must acknowledge that count with
58
+ `--confirm-trials <count>`. The CLI generates an idempotency key when one is
59
+ not supplied and reports it with safe retry guidance if the start request
60
+ fails ambiguously.
61
+
62
+ Runs start asynchronously unless `--wait` is present. The same bounded wait is
63
+ available independently, with duration units `ms`, `s`, `m`, and `h`:
64
+
65
+ ```bash
66
+ mgcl evals runs list --slug <eval-slug> --status RUNNING --json
67
+ mgcl evals runs get --id <eval-run-id> --json
68
+ mgcl evals runs await --id <eval-run-id> --timeout 10m --json
69
+ mgcl evals runs trials --id <eval-run-id> --limit 100 --cursor <cursor> --json
70
+ mgcl evals runs cancel --id <eval-run-id> --json
71
+ ```
72
+
73
+ Await prints the final structured result before exiting nonzero for `FAILED`,
74
+ `CANCELLED`, or a client timeout. A completed run is operationally successful
75
+ regardless of its scores.
76
+
77
+ The stable `--json` bodies use the GraphQL field names. Representative shapes
78
+ for the execution lifecycle are:
79
+
80
+ ```json
81
+ {"combinationCount":10,"repeatCount":2,"trialCount":20}
82
+ {"idempotencyKey":"mgcl-eval-...","evalRunId":"...","workflowId":"...","workflowRunId":"..."}
83
+ {"reachedTerminal":true,"pollCount":1,"elapsedMs":42,"evalRun":{"id":"...","status":"COMPLETE","trialStatusCounts":{"queued":0,"running":0,"complete":20,"failed":0,"cancelled":0}}}
84
+ {"trials":[{"id":"...","status":"COMPLETE","input":{},"output":{},"scores":{}}],"nextCursor":"..."}
85
+ ```
86
+
87
+ Definition results include `slug`, `name`, `description`, `tags`, `version`,
88
+ and `inputSchema`. Test results include `status`, `input`, `output`, `scores`,
89
+ and a nullable `{ "type", "message" }` error. Run detail also includes its
90
+ persisted configuration, definition snapshot, progress, timing, initiating
91
+ user, dashboard URL, idempotency key, and Temporal identifiers.
92
+
93
+ Raw-result exports are asynchronous. `--wait` polls and downloads the completed
94
+ file. Existing files are never overwritten unless `--force` is explicit:
95
+
96
+ ```bash
97
+ mgcl evals runs export \
98
+ --id <eval-run-id> \
99
+ --output ./eval-results.json \
100
+ --wait
101
+ ```
102
+
103
+ Without `--wait`, export JSON reports `exportId`, `evalRunId`, `status`, and
104
+ workflow identifiers. A completed export additionally reports `fileName`,
105
+ `trialCount`, `downloadUrl`, and, after CLI download, the resolved `outputPath`.
106
+
107
+ These GraphQL operations come from the same shared registry used by the Apollo
108
+ MCP server. MCP callers must provide `idempotencyKey` and
109
+ `expectedTrialCount` directly when starting a run.
110
+
111
+ ## Automation branches
112
+
113
+ `--branch-id` is a global, per-command authoring target. The CLI never stores a
114
+ current branch. Omit it to target main; branch-aware responses include
115
+ `branchId: null` and the selected main `headVersionId`.
116
+
117
+ This release adds exactly five commands: branch list, create, get, and merge,
118
+ plus workbench patch readiness.
119
+
120
+ ```bash
121
+ mgcl automations branches list --automation-id <automation-id> --json
122
+ mgcl automations branches create --automation-id <automation-id> --name experiment --json
123
+ mgcl --branch-id <branch-id> automations branches get --automation-id <automation-id> --json
124
+ mgcl --branch-id <branch-id> automations update --id <automation-id> --input-json '{"baseVersionId":"<head-version-id>","name":"Experiment"}' --json
125
+ mgcl --branch-id <branch-id> automations branches merge --automation-id <automation-id> --json
126
+ mgcl --branch-id <branch-id> workbench patch readiness --target-draft-automation-id <automation-id> --operations-json '[{"setAutomationName":{"name":"Experiment readiness preview"}}]' --json
127
+ ```
128
+
129
+ Branch creation defaults to main. Use `--source-branch-id` and optionally
130
+ `--source-version-id` to fork from another branch or an older version in that
131
+ branch's history. Names must use lowercase letters or numbers separated by
132
+ single dashes, such as `release-2`. Spaces, underscores, slashes, backslashes,
133
+ punctuation, uppercase letters, leading or trailing dashes, and repeated dashes
134
+ are rejected before an API request. Branch IDs, not names, identify targets.
135
+ Merge previews the same change set as the web UI. A conflict returns
136
+ `status: "conflict"` and does not change main or delete the branch. A
137
+ conflict-free merge returns `status: "merged"`, the saved-main result, and
138
+ deletes the source branch. Rename, delete, compare, and publish are
139
+ intentionally deferred.
140
+
141
+ The global branch target is accepted by `automations update`, `automations
142
+ run-draft`, `workbench diagnostics`, `workbench schema-suggestions`, and
143
+ `workbench patch preview`, `readiness`, and `apply`. It is required by
144
+ `automations branches get` and `merge`. Other commands reject `--branch-id`
145
+ before making an API request. Branch-aware responses identify the selected
146
+ target with `branchId` and `headVersionId`. Merge returns `branchId`, its exact
147
+ preview and conflicts, plus the new main head as `applyResult.draftVersionId`
148
+ when successful. Branch inspection excludes workspace authentication records
149
+ and secret values from its hydrated automation response.
150
+
151
+ For a complete local setup and conflict-free create-to-merge exercise, run the
152
+ commands in [branching-local-test-commands.txt](branching-local-test-commands.txt).
153
+ For a presenter-friendly version that prints every CLI command and pauses for
154
+ approval before merge, run
155
+ [branching-local-demo-commands.txt](branching-local-demo-commands.txt).
156
+ Both scripts derive their service URLs and CLI binary from the current
157
+ worktree, start the tracked portal/main/worker stack, and keep authentication
158
+ in a worktree-local ignored directory. The first run prompts for `mgcl auth
159
+ login`. Set `MGCL_BRANCHING_ORG_ID` to use an organization other than Magical;
160
+ the script headers list the optional namespace, URL, and config-directory
161
+ overrides.
162
+
24
163
  ## Edit a Skill
25
164
 
26
165
  The Skills working-copy commands currently support root-level skills at