File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,25 @@ const (
1515
1616// streamCmd represents the new command for streaming functionality
1717var streamCmd = & cobra.Command {
18- Use : "stream [ file]" ,
19- Short : "Stream data to your agent" ,
20- Long : `The stream command allows you to initiate a data stream to your agent.` ,
18+ Use : "stream -- file [filename ]" ,
19+ Short : "Parse stream data from agent" ,
20+ Long : `Allows you to parse a data stream to your agent response .` ,
2121 Run : agentStream ,
2222}
2323
2424func init () {
2525 streamCmd .PersistentFlags ().String (streamCmdFileFlag , "" , "Parse agent responses from a file" )
26+ rootCmd .AddCommand (streamCmd )
2627}
2728
2829func agentStream (cmd * cobra.Command , args []string ) {
2930 fmt .Println ("stream command executed successfully" )
3031
31- file := args [0 ]
32+ file , _ := cmd .Flags ().GetString (streamCmdFileFlag )
33+ if file == "" {
34+ fmt .Fprintln (os .Stderr , "Error: --file [file] is required" )
35+ os .Exit (1 )
36+ }
3237
3338 result , err := stream .ParseFile (file )
3439 if err != nil {
You can’t perform that action at this time.
0 commit comments