MCPcopy Index your code
hub / github.com/docker/docker-agent / newA2ACmd

Function newA2ACmd

cmd/root/a2a.go:22–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func newA2ACmd() *cobra.Command {
23 var flags a2aFlags
24
25 cmd := &cobra.Command{
26 Use: "a2a <agent-file>|<registry-ref>",
27 Short: "Start an agent as an A2A (Agent-to-Agent) server",
28 Long: "Start an A2A server that exposes the agent via the Agent-to-Agent protocol",
29 Example: ` docker-agent serve a2a ./agent.yaml
30 docker-agent serve a2a agentcatalog/pirate --listen 127.0.0.1:9090`,
31 Args: cobra.ExactArgs(1),
32 RunE: flags.runA2ACommand,
33 }
34
35 cmd.PersistentFlags().StringVarP(&flags.agentName, "agent", "a", "", "Name of the agent to run (defaults to the team's first agent)")
36 cmd.PersistentFlags().StringVarP(&flags.listenAddr, "listen", "l", "127.0.0.1:8082", "Address to listen on")
37 cmd.PersistentFlags().StringVarP(&flags.sessionDB, "session-db", "s", filepath.Join(paths.GetHomeDir(), ".cagent", "session.db"), "Path to the session database")
38 addRuntimeConfigFlags(cmd, &flags.runConfig)
39
40 return cmd
41}
42
43func (f *a2aFlags) runA2ACommand(cmd *cobra.Command, args []string) (commandErr error) {
44 ctx := cmd.Context()

Callers 1

newServeCmdFunction · 0.85

Calls 2

GetHomeDirFunction · 0.92
addRuntimeConfigFlagsFunction · 0.85

Tested by

no test coverage detected