When you open the Terminal application, you are presented with the shell to which you can type commands. Your commands are read then executed by the shell, usually by launching a program corresponding to the command’s name.
When you select a default application for a file type or the application to use for a rule, you can also choose to use a shell command by selecting the Shell Command menu item. You will be presented the command editor where you can write the command that will be issued when opening a file.