If there is no respective RPC for a Junos OS CLI command, then the command can be executed from script using <command> RPC:
1 var $cmd = <command> "show version";
2 var $res = jcs:invoke($cmd);
Piped commands should not be used with <command> RPC. They are not supported. The following is an invalid command:
1 var $cmd = <command> "show version | display detail";