Class SshTools
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
CurrentUsername
Gets the current username, or null if not connected.
public string? CurrentUsername { get; }
Property Value
IsConnected
Gets whether there is an active SSH connection.
public bool IsConnected { get; }
Property Value
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
Returns
DisconnectSshAsync()
[KernelFunction("disconnect_ssh")]
public Task<string> DisconnectSshAsync()
Returns
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
RunRemoteCommandAsync(string, int)
[KernelFunction("run_remote_command")]
public Task<string> RunRemoteCommandAsync(string command, int timeoutSeconds = 60)