In macOS you have the pbcopy command to copy stdin to clipboard. On Windows and WSL you can use: echo hi | clip.exe via: https://www.raymondcamden.com/2017/10/19/copying-to-clipboard-with-windows-subsystem-for-linux (opens new window)