Interface IExecClient
- Namespace
- OpenShell
- Assembly
- OpenShell.Sdk.dll
Command execution inside sandboxes.
public interface IExecClient
- Extension Methods
Methods
InteractiveAsync(string, IReadOnlyList<string>, uint, uint, ExecOptions?, bool, CancellationToken)
Starts a command with a TTY and a duplex channel: write stdin, resize the terminal, read output events. Dispose the session to cancel the command.
ValueTask<ExecInteractiveSession> InteractiveAsync(string sandbox, IReadOnlyList<string> command, uint columns, uint rows, ExecOptions? options = null, bool allocateTty = true, CancellationToken cancellationToken = default)
Parameters
sandboxstringcommandIReadOnlyList<string>columnsuintrowsuintoptionsExecOptionsallocateTtyboolcancellationTokenCancellationToken
Returns
RunAsync(string, IReadOnlyList<string>, ExecOptions?, CancellationToken)
Runs a command and buffers its output.
ValueTask<ExecResult> RunAsync(string sandbox, IReadOnlyList<string> command, ExecOptions? options = null, CancellationToken cancellationToken = default)
Parameters
sandboxstringcommandIReadOnlyList<string>optionsExecOptionscancellationTokenCancellationToken
Returns
StreamAsync(string, IReadOnlyList<string>, ExecOptions?, CancellationToken)
Streams output as it arrives. The final event is always an ExecExit; if the gateway closes the stream without one, the enumeration throws, so a failing command cannot be missed.
IAsyncEnumerable<ExecEvent> StreamAsync(string sandbox, IReadOnlyList<string> command, ExecOptions? options = null, CancellationToken cancellationToken = default)
Parameters
sandboxstringcommandIReadOnlyList<string>optionsExecOptionscancellationTokenCancellationToken