Writing action commands in Tempo

How to template Tempo's action buttons with ${...} placeholders: event fields and metadata, shell quoting for terminal commands, running scripts on a remote host, and opening links in a specific browser.