Table of Contents

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

sandbox string
command IReadOnlyList<string>
columns uint
rows uint
options ExecOptions
allocateTty bool
cancellationToken CancellationToken

Returns

ValueTask<ExecInteractiveSession>

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

sandbox string
command IReadOnlyList<string>
options ExecOptions
cancellationToken CancellationToken

Returns

ValueTask<ExecResult>

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

sandbox string
command IReadOnlyList<string>
options ExecOptions
cancellationToken CancellationToken

Returns

IAsyncEnumerable<ExecEvent>