module

RNS::Rnx

Constants

APP_NAME = "rnx"
REMOTE_EXEC_GRACE = 2.0
SPINNER_SYMS = "⢄⢂⢁⡁⡈⡐⡠"

Spinner characters matching Python's braille spinner.

Class methods

execute(configdir : String | Nil, identitypath : String | Nil, verbosity : Int32, quietness : Int32, detailed : Bool, mirror : Bool, noid : Bool, destination : String, command : String, stdin_data : String | Nil, stdout_limit : Int32 | Nil, stderr_limit : Int32 | Nil, timeout : Float64, result_timeout : Float64 | Nil, interactive : Bool) : Int32 | Nil

Execute a command on a remote rnx listener.

Source
execute_received_command(data : Bytes, remote_identity : Identity | Nil) : Bytes | Nil

Execute a command received from a remote client. Data is a msgpack array: [command_bytes, timeout, o_limit, e_limit, stdin_bytes] Returns a result array: [executed, retval, stdout, stderr, outlen, errlen, started, concluded]

Source
format_request_data(command : String, timeout : Float64 | Nil, stdout_limit : Int32 | Nil, stderr_limit : Int32 | Nil, stdin_data : String | Nil) : Array(Bytes | Float64 | Nil | Int32 | Nil | Nil)

Format a command execution request data array. Returns an array matching the Python protocol: [command_bytes, timeout, stdout_limit, stderr_limit, stdin_bytes]

Source
format_result(result : Array(MessagePack::Type), detailed : Bool, mirror : Bool, stdout_limit : Int32 | Nil, stderr_limit : Int32 | Nil) : Tuple(String, Int32 | Nil)

Format execution result for display. Result array from remote: [executed, retval, stdout, stderr, outlen, errlen, started, concluded]

Source
listen(configdir : String | Nil, identitypath : String | Nil, verbosity : Int32, quietness : Int32, allowed : Array(String), print_identity : Bool, disable_auth : Bool, disable_announce : Bool)

Listen mode — receive and execute commands from authenticated clients.

Source
main(argv : Array(String) = ARGV.to_a)

Main entry point for the rnx binary.

Source
parse_args(argv : Array(String)) : Args

Parse command-line arguments matching Python argparse behavior.

Source
parse_destination_hash(hex : String) : Bytes

Validate a hex destination hash string, returning the bytes.

Source
prepare_identity(identity_path : String | Nil) : Identity

Prepare or load identity for rnx.

Source
pretty_time(time_val : Float64, verbose : Bool = false) : String

Pretty time formatting matching Python's pretty_time exactly.

Source
size_str(num : Float64 | Int32 | Int64 | UInt64, suffix : String = "B") : String

Size formatting matching Python's size_str exactly.

Source
spin(msg : String, timeout : Float64 | Nil = nil, &until_block : -> Bool) : Bool

Spin with message until condition met or timeout. Returns false on timeout.

Source
usage_string

Usage message matching Python argparse output.

Source
version_string

Version string matching Python's "rnx {version}" format.

Source

Nested types