add cancel action to pipeline to stop without transcribing

This commit is contained in:
LeonardoTrapani
2025-10-10 20:08:41 +02:00
parent b437f575e6
commit e8b9c1eff0
5 changed files with 46 additions and 6 deletions
+16
View File
@@ -28,6 +28,7 @@ func init() {
rootCmd.AddCommand(
serveCmd(),
toggleCmd(),
cancelCmd(),
statusCmd(),
versionCmd(),
stopCmd(),
@@ -109,6 +110,21 @@ func stopCmd() *cobra.Command {
}
}
func cancelCmd() *cobra.Command {
return &cobra.Command{
Use: "cancel",
Short: "Cancel current operation",
RunE: func(cmd *cobra.Command, args []string) error {
resp, err := bus.SendCommand('c')
if err != nil {
return fmt.Errorf("failed to cancel operation: %w", err)
}
fmt.Print(resp)
return nil
},
}
}
func configureCmd() *cobra.Command {
return &cobra.Command{
Use: "configure",