feat: add agent export/import CLI commands#1024
Merged
Conversation
Agent export (wp datamachine agents export <slug>) serializes an agent's full identity into a portable bundle: identity files (SOUL.md, MEMORY.md), USER.md template, agent config, pipelines, flows, and associated memory files. Supports --format=zip (default), json, and dir output formats. Agent import (wp datamachine agents import <path>) recreates an agent from a bundle with ID remapping, slug collision detection, and --dry-run validation. Flows are imported paused to prevent immediate execution. Closes #1022
Contributor
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wp datamachine agents export <slug>— Serializes an agent's full identity (SOUL.md, MEMORY.md, config, pipelines, flows, memory files) into a portable bundle. Supports--format=zip(default),json, anddiroutput formats with--output=<path>targeting.wp datamachine agents import <path>— Recreates an agent from a bundle with automatic ID remapping, slug collision detection,--slug=<new-slug>rename,--owner=<user>assignment, and--dry-runvalidation. Flows are imported paused/manual to prevent immediate execution.AgentBundlerclass ininc/Core/Agents/handles all serialization/deserialization logic — CLI methods stay thin.Context
Enables Chris to export
mattic-agent-kitfrom his personal laptop and import it on his Automattic machine. The bundle format is versioned (v1) for forward compatibility.What's excluded by design
Testing
All three export formats (zip, json, dir) and all three import sources tested end-to-end on the live site:
Closes #1022