The starting point for a lot of my automation is the shell, where I test things out.
At some point, I start gathering my results in a file, to keep track of the commands that were successful and are ready to be used in a script.
At the moment, I do Ctrl–U, wl-copy ' + Ctrl–Y +'+ Enter – am I missing a better way?