Table of Contents

Class SshTools

Namespace
JD.AI.Core.Tools
Assembly
JD.AI.Core.dll

SSH remote execution tools for the AI agent. Allows connecting to remote machines and executing commands.

public sealed class SshTools : IDisposable
Inheritance
SshTools
Implements
Inherited Members

Properties

CurrentHost

Gets the current connected host, or null if not connected.

public string? CurrentHost { get; }

Property Value

string

CurrentUsername

Gets the current username, or null if not connected.

public string? CurrentUsername { get; }

Property Value

string

IsConnected

Gets whether there is an active SSH connection.

public bool IsConnected { get; }

Property Value

bool

Methods

ConnectSshAsync(string, string, string?, string?, int, int)

[KernelFunction("connect_ssh")]
public Task<string> ConnectSshAsync(string host, string username, string? password = null, string? privateKeyPath = null, int port = 22, int timeoutSeconds = 30)

Parameters

host string
username string
password string
privateKeyPath string
port int
timeoutSeconds int

Returns

Task<string>

DisconnectSshAsync()

[KernelFunction("disconnect_ssh")]
public Task<string> DisconnectSshAsync()

Returns

Task<string>

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetRemoteInfoAsync()

[KernelFunction("get_remote_info")]
public Task<string> GetRemoteInfoAsync()

Returns

Task<string>

RunRemoteCommandAsync(string, int)

[KernelFunction("run_remote_command")]
public Task<string> RunRemoteCommandAsync(string command, int timeoutSeconds = 60)

Parameters

command string
timeoutSeconds int

Returns

Task<string>