CLI to copy to clipboard but still output to term ?
The tool of choice is called tee. Full description is available via man tee but you canprobably just use

echo test | tee &gt;(pbcopy)


to get the result you are looking for.