feat: add agent project import/export commands#209
Open
AutomateIP wants to merge 3 commits into
Open
Conversation
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>
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
get agent-projects,describe agent-project,import agent-project, andexport agent-projectCLI commands for managing FlowAI agent projects via theagent-project-serviceREST APIDetails
The implementation targets the FlowAI
agent-project-serviceendpoints:GET /agent-project-service/projects— list all agent projects (paginated)GET /agent-project-service/projects/{id}— get project by IDGET /agent-project-service/project-bundles/{id}/export— export bundlePOST /agent-project-service/project-bundles/import— import bundleImport and export support the same
--path,--repository,--reference,--private-key-file, and--messageflags as other asset commands.Test plan
go build ./...passes with no errorsgo test ./...passes — all 22 packages greenpkg/services/agent_projects_test.go) covering GetAll, Get, GetByName, Export, Import — happy path, error cases, and edge cases (empty ID, not found)pkg/services/testdata/2023.2/agent-project-service/ipctl get --helpshowsagent-projectsunder Flow Agent Commands:ipctl import --helpshowsagent-projectunder Flow Agent Commands:ipctl export --helpshowsagent-projectunder Flow Agent Commands:🤖 Generated with Claude Code