MCPcopy Create free account
hub / github.com/compozy/agh / runSpawnCommand

Function runSpawnCommand

internal/cli/spawn.go:87–107  ·  view source on GitHub ↗
(deps commandDeps, flags *spawnCommandFlags)

Source from the content-addressed store, hash-verified

85}
86
87func runSpawnCommand(deps commandDeps, flags *spawnCommandFlags) func(*cobra.Command, []string) error {
88 return func(cmd *cobra.Command, _ []string) error {
89 request, err := flags.request()
90 if err != nil {
91 return err
92 }
93 client, err := clientFromDeps(deps)
94 if err != nil {
95 return err
96 }
97 credentials, err := requireAgentCommandIdentity(cmd.Context(), deps, client, agentActionCLI("spawn"))
98 if err != nil {
99 return err
100 }
101 record, err := client.AgentSpawn(cmd.Context(), request, credentials)
102 if err != nil {
103 return err
104 }
105 return writeCommandOutput(cmd, agentSpawnBundle(&record))
106 }
107}
108
109func (flags *spawnCommandFlags) request() (AgentSpawnRequest, error) {
110 if strings.TrimSpace(flags.agentName) == "" {

Callers 1

newSpawnCommandFunction · 0.85

Calls 7

clientFromDepsFunction · 0.85
agentActionCLIFunction · 0.85
writeCommandOutputFunction · 0.85
agentSpawnBundleFunction · 0.85
AgentSpawnMethod · 0.65
requestMethod · 0.45

Tested by

no test coverage detected