Not sure if it fits your need, but you can use Remote Buddy to record and send IR codes via Flirc USB. There are three ways to use this:
- via Remote Buddy UI/action: https://www.iospirit.com/support/faqs/remotebuddy/sending-infrared-commands/creating-an-infrared-command-action
- via AppleScript: https://www.iospirit.com/support/faqs/remotebuddy/sending-infrared-commands/sending-infrared-commands-via-applescript
- via CLI: https://www.iospirit.com/support/faqs/remotebuddy/sending-infrared-commands/sending-infrared-commands-from-the-commandline