@getmagical/cli 0.9.2 → 0.10.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/README.md +53 -0
- package/dist/index.js +6453 -5478
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -543,6 +543,59 @@ These GraphQL operations come from the same shared registry used by the Apollo
|
|
|
543
543
|
MCP server. MCP callers must provide `idempotencyKey` and
|
|
544
544
|
`expectedTrialCount` directly when starting a run.
|
|
545
545
|
|
|
546
|
+
## Agent export and import
|
|
547
|
+
|
|
548
|
+
Use user login for agent transfers. Export selected agents from a library asset
|
|
549
|
+
or a saved automation version, then import the file into a draft in the same
|
|
550
|
+
workspace:
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
mgcl agents export --library-entity-id <library-id> --ids <agent-id> --org <org-id> --json > agents.json
|
|
554
|
+
mgcl agents import --automation-id <destination-id> --base-version-id <current-draft-version-id> --file agents.json --org <org-id> --json
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
For an automation source, replace `--library-entity-id` with
|
|
558
|
+
`--automation-version-id`. Export uses the existing selected-agent JSON format,
|
|
559
|
+
including its selection filtering. Import returns `importedAgentIds` and the new
|
|
560
|
+
`draftVersionId`.
|
|
561
|
+
|
|
562
|
+
Import converts the JSON into the existing automation update operation. It
|
|
563
|
+
allocates new IDs, remaps internal references, and preserves API request config.
|
|
564
|
+
Instructions are converted to the update API's command format; command/comment
|
|
565
|
+
identities are recreated and canvas positions are not imported. Existing update
|
|
566
|
+
validation, trigger rules, normalization, audit logging, and stale-version checks
|
|
567
|
+
apply. Destination settings are not imported. Cross-workspace transfers,
|
|
568
|
+
shared-input migration, and branch imports are not supported.
|
|
569
|
+
|
|
570
|
+
JSON imports reject literal credentials and platform resource references using
|
|
571
|
+
the same scanner as portal JSON imports, even when the source workspace matches.
|
|
572
|
+
Remove those values from the exported file and configure them in the destination.
|
|
573
|
+
Fully templated credentials remain importable.
|
|
574
|
+
|
|
575
|
+
Deploy the backend transfer fields before releasing CLI 0.9.3.
|
|
576
|
+
|
|
577
|
+
## Library assets
|
|
578
|
+
|
|
579
|
+
Library assets are reusable agent subtrees shared by automations in one
|
|
580
|
+
workspace. Like agent transfers, these commands require user login.
|
|
581
|
+
|
|
582
|
+
```bash
|
|
583
|
+
mgcl library search --query login --org <org-id> --json
|
|
584
|
+
mgcl library get --library-entity-id <library-id> --org <org-id> --json
|
|
585
|
+
mgcl library create --name "Shared Login" --org <org-id> --json
|
|
586
|
+
mgcl library convert --draft-automation-id <automation-id> --root-agent-id <agent-id> --base-version-id <current-draft-version-id> --name "Shared Login" --org <org-id> --json
|
|
587
|
+
mgcl library import --draft-automation-id <automation-id> --library-entity-id <library-id> --base-version-id <current-draft-version-id> --parent-agent-id <agent-id> --org <org-id> --json
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
An asset is named after its root agent. `--name` on `create` names the new
|
|
591
|
+
root agent (default `New Asset`); on `convert` it renames the converted root
|
|
592
|
+
agent, which otherwise keeps its name. `convert` and `import` save the draft
|
|
593
|
+
and return the new `draftVersionId`. Omit `--parent-agent-id` to import the
|
|
594
|
+
asset at the top level.
|
|
595
|
+
|
|
596
|
+
Deploy the backend `convertAutomationSubtreeToLibraryAsset(assetName:)`
|
|
597
|
+
argument before releasing CLI 0.10.0.
|
|
598
|
+
|
|
546
599
|
## Automation branches
|
|
547
600
|
|
|
548
601
|
`--branch-id` is a global, per-command authoring target. The CLI never stores a
|