@getmagical/cli 0.2.6 → 0.2.8

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
@@ -108,6 +108,58 @@ These GraphQL operations come from the same shared registry used by the Apollo
108
108
  MCP server. MCP callers must provide `idempotencyKey` and
109
109
  `expectedTrialCount` directly when starting a run.
110
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
+
111
163
  ## Edit a Skill
112
164
 
113
165
  The Skills working-copy commands currently support root-level skills at