@getmagical/cli 0.2.4 → 0.2.6

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,129 @@ 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
+ ## Edit a Skill
112
+
113
+ The Skills working-copy commands currently support root-level skills at
114
+ `skills/<skill-name>`:
115
+
116
+ ```bash
117
+ mgcl skills pull review
118
+ # Edit ./skills/review in your editor.
119
+ mgcl skills diff review
120
+ mgcl skills push review --message "Improve review guidance"
121
+ ```
122
+
123
+ `pull` downloads the complete skill directory from the repository's default
124
+ branch and remembers the pulled contents. Tags, commit SHAs, and non-default
125
+ branches remain available through the low-level read/history commands, but are
126
+ not supported by the writable working-copy workflow.
127
+ It refuses to overwrite existing files or local edits unless you pass `--force`.
128
+ `diff` compares your files with the pulled contents. `push` sends all
129
+ additions, edits, and deletions as one commit against the current repository
130
+ head. After a successful push, the working copy and its remembered baseline
131
+ are replaced with the committed bundle read back at the new commit, so they
132
+ include any concurrent change to another file in the same skill. If that
133
+ refresh fails, the push still succeeded; re-run
134
+ `mgcl skills pull <skill> --force` to sync.
135
+
136
+ These commands do not protect concurrent edits to the same skill. If the skill
137
+ changed remotely and your local patch no longer applies, `push` fails and asks
138
+ you to pull the latest version and reapply your changes. Binary file changes
139
+ cannot be pushed.
140
+
141
+ These commands use temporary Git repositories only; they do not initialize or
142
+ modify Git state in the directory where you run `mgcl`.
143
+
144
+ For low-level automation, `mgcl skills apply-patch` applies one raw Git patch
145
+ as a single commit.
146
+
24
147
  ## Local Development
25
148
 
26
149
  Run the CLI from source without building: