The Shortcut is simple and easy to use (1). If I wanted to do the same thing on Android, I'd use Termux (2).
---
My 'Universal Clipboard' is a text file on a VPS. My devices set or get the contents via SSH. E.g. Android[Termux SSH] > VPS < iOS[Shortcuts 'Run Script over SSH']. Comes in handy!
1: https://www.icloud.com/shortcuts/2190aca622b948258a9024d8dda... 2: https://termux.com/