Skip to content

feat: add agent export/import CLI commands#1024

Merged
chubes4 merged 1 commit intomainfrom
feature/agent-export-import
Apr 7, 2026
Merged

feat: add agent export/import CLI commands#1024
chubes4 merged 1 commit intomainfrom
feature/agent-export-import

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 7, 2026

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, and dir output 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-run validation. Flows are imported paused/manual to prevent immediate execution.
  • New AgentBundler class in inc/Core/Agents/ handles all serialization/deserialization logic — CLI methods stay thin.

Context

Enables Chris to export mattic-agent-kit from his personal laptop and import it on his Automattic machine. The bundle format is versioned (v1) for forward compatibility.

What's excluded by design

  • Access grants (security-sensitive)
  • Daily memory files (runtime state)
  • Chat history (not portable)
  • Agent tokens (security-sensitive)

Testing

All three export formats (zip, json, dir) and all three import sources tested end-to-end on the live site:

  • Export → Import round-trip with agent files, pipelines, and flows
  • Slug collision detection
  • Dry-run validation with abilities manifest checking
  • Pipeline step ID remapping in flow configs

Closes #1022

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
@homeboy-ci
Copy link
Copy Markdown
Contributor

homeboy-ci bot commented Apr 7, 2026

Homeboy Results — data-machine

Homeboy

Failure Digest

Lint Failure Digest

Test Failure Digest

Audit Failure Digest

Autofixability classification

  • Overall: auto_fixable
  • Autofix enabled: yes
  • Autofix attempted this run: no
  • Auto-fixable failed commands:
    • lint
  • Failed commands with available automated fixes:
    • lint

Machine-readable artifacts

  • {command}.json — structured output per command (from homeboy --output)

⚡ Scope: changed files only

audit (changed files only)

  • Alignment score: 0.763
  • Outliers in current run: 52
  • Drift increased: no
  • Severity counts: info: 10, unknown: 52, warning: 2
  • Top actionable findings:
    1. inc/Cli/Commands/AgentsCommand.php — god_file — File has 1170 lines (threshold: 1000)
    2. inc/Cli/Commands/AgentsCommand.php — unused_parameter — Unused parameter 'args' in function 'list_agents' (no callers found)
    3. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'access' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    4. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'config' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    5. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'create' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    6. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'delete' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    7. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'export' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    8. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'import_agent' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    9. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'list_agents' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
    10. inc/Cli/Commands/AgentsCommand.php — missing_test_method — Method 'rename' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
Audit findings (10 shown)
1. **inc/Cli/Commands/AgentsCommand.php** — god_file — File has 1170 lines (threshold: 1000)
2. **inc/Cli/Commands/AgentsCommand.php** — unused_parameter — Unused parameter 'args' in function 'list_agents' (no callers found)
3. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'access' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
4. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'config' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
5. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'create' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
6. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'delete' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
7. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'export' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
8. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'import_agent' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
9. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'list_agents' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'
10. **inc/Cli/Commands/AgentsCommand.php** — missing_test_method — Method 'rename' has no corresponding test in 'tests/Unit/Cli/Commands/AgentsCommandTest.php'

lint (changed files only)

test (changed files only)

  • Failed tests: 0
Tooling versions
  • Homeboy CLI: homeboy 0.88.6+338ab303
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v2

Homeboy Action v1

@chubes4 chubes4 merged commit 6f7b84c into main Apr 7, 2026
1 check failed
@chubes4 chubes4 deleted the feature/agent-export-import branch April 7, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent export/import CLI commands

1 participant