Skip to content

feat: add agent project import/export commands#209

Open
AutomateIP wants to merge 3 commits into
itential:mainfrom
AutomateIP:feature/add-agent-project-import-export
Open

feat: add agent project import/export commands#209
AutomateIP wants to merge 3 commits into
itential:mainfrom
AutomateIP:feature/add-agent-project-import-export

Conversation

@AutomateIP

@AutomateIP AutomateIP commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds get agent-projects, describe agent-project, import agent-project, and export agent-project CLI commands for managing FlowAI agent projects via the agent-project-service REST API
  • Commands are grouped under a new Flow Agent Commands: section in the CLI help output
  • Follows the existing ipctl layered architecture: service → resource → runner → handler → descriptor

Details

The implementation targets the FlowAI agent-project-service endpoints:

  • GET /agent-project-service/projects — list all agent projects (paginated)
  • GET /agent-project-service/projects/{id} — get project by ID
  • GET /agent-project-service/project-bundles/{id}/export — export bundle
  • POST /agent-project-service/project-bundles/import — import bundle

Import and export support the same --path, --repository, --reference, --private-key-file, and --message flags as other asset commands.

Test plan

  • go build ./... passes with no errors
  • go test ./... passes — all 22 packages green
  • 13 service-level unit tests added (pkg/services/agent_projects_test.go) covering GetAll, Get, GetByName, Export, Import — happy path, error cases, and edge cases (empty ID, not found)
  • Fixture files added under pkg/services/testdata/2023.2/agent-project-service/
  • ipctl get --help shows agent-projects under Flow Agent Commands:
  • ipctl import --help shows agent-project under Flow Agent Commands:
  • ipctl export --help shows agent-project under Flow Agent Commands:

🤖 Generated with Claude Code

AutomateIP and others added 3 commits June 30, 2026 08:04
Adds get, describe, import, and export CLI commands for FlowAI
agent projects (agent-project-service). Commands are grouped under
a new 'Flow Agent Commands:' section in the CLI help output.

New files:
- pkg/services/agent_projects.go (service layer, REST API calls)
- pkg/resources/agent_projects.go (resource layer, business logic)
- internal/runners/agent_projects.go (runner, CLI orchestration)
- internal/handlers/agent_projects.go (handler registration)
- internal/handlers/descriptors/agent_projects.yaml (help text)
- internal/flags/agent_projects.go (import/export flag structs)
- internal/flags/agent_projects_test.go (flag tests)

Modified files:
- pkg/services/interfaces.go (AgentProjectServicer interface)
- pkg/resources/interfaces.go (AgentProjectResourcer interface)
- internal/handlers/descriptors.go (agentProjectsDescriptor constant)
- internal/handlers/handlers.go (register NewAgentProjectHandler)
- internal/cli/commands.go (add flow-agent command group)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds 13 unit tests covering GetAll, Get, GetByName, Export, and Import
on AgentProjectService, with mock HTTP fixtures under testdata/2023.2/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds --member and --conflict-mode flags to `import agent-project`,
mirroring the existing studio-project member pattern, plus a Delete
method so a partially-imported project rolls back if member updates
fail. Also sends the now-required conflictMode/providerResolutions
fields on import, dedupes members by (type, reference) before PATCHing
to avoid duplicate-principal rejections, and fixes AccountService/
GroupService GetByName to prefer active accounts/groups when multiple
records share the same username or name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant