package SSH::RPC::Shell;
$SSH::RPC::Shell::VERSION = '1.204';
use strict;
use JSON;
=head1 NAME
SSH::RPC::Shell - The shell, or server side, of an RPC call over SSH.
=head1 VERSION
version 1.204
=cut
sub run {
my $class = shift;
my $json = JSON->new->utf8;
my $request;
while (my $line = <STDIN>) {
$request = eval {$json->incr_parse($line)};
if ($@) {
quest($request);
$result->{version} = $SSH::RPC::Shell::VERSION;
my $encodedResult = eval{JSON->new->pretty->utf8->encode($result)};
if ($@) {
print { "error" => "Malformed respons
strict;
use Class::InsideOut qw(readonly private id register);
use Scalar::Util qw(blessed);
use JSON;
use Net::OpenSSH;
use SSH::RPC::Result;
=head1 NAME
SSH::RPC::Client - The requestor, or clien
assing and receiving complex data structures. The arguments and return values are serialized into JSON allowing shells to be written in languages other than Perl.
=head1 METHODS
The following method
reference, or array reference.
=cut
sub run {
my ($self, $command, $args) = @_;
my $json = JSON->new->utf8->pretty->encode({
command => $command,
args => $args,
}