diff --git a/cmd/livekit-cli/room.go b/cmd/livekit-cli/room.go index de76c455..d3d4e249 100644 --- a/cmd/livekit-cli/room.go +++ b/cmd/livekit-cli/room.go @@ -54,6 +54,10 @@ var ( Name: "track-egress-file", Usage: "AutoTrackEgress json file (see examples/auto-track-egress.json)", }, + &cli.StringFlag{ + Name: "agents-file", + Usage: "Agents configuration json file", + }, &cli.StringFlag{ Name: "room-configuration", Usage: "Name of the room configuration to associate with the created room", @@ -285,6 +289,18 @@ func createRoom(c *cli.Context) error { req.Egress.Tracks = trackEgress } + if agentsFile := c.String("agents-file"); agentsFile != "" { + agent := &livekit.RoomAgent{} + b, err := os.ReadFile(agentsFile) + if err != nil { + return err + } + if err = protojson.Unmarshal(b, agent); err != nil { + return err + } + req.Agent = agent + } + if roomConfig := c.String("room-configuration"); roomConfig != "" { req.ConfigName = roomConfig }