PipeOps.Rexec 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package PipeOps.Rexec --version 1.0.1
                    
NuGet\Install-Package PipeOps.Rexec -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PipeOps.Rexec" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PipeOps.Rexec" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="PipeOps.Rexec" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PipeOps.Rexec --version 1.0.1
                    
#r "nuget: PipeOps.Rexec, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PipeOps.Rexec@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PipeOps.Rexec&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=PipeOps.Rexec&version=1.0.1
                    
Install as a Cake Tool

Rexec .NET SDK

Official .NET SDK for Rexec - Terminal as a Service.

Requirements

  • .NET 8.0 or later

Installation

NuGet

dotnet add package PipeOps.Rexec

Package Manager

Install-Package PipeOps.Rexec

Quick Start

using Rexec;

// Create client
var client = new RexecClient("https://your-instance.com", "your-api-token");

// Create a container
var container = await client.Containers.CreateAsync("ubuntu:24.04");
Console.WriteLine($"Created: {container.Id}");

// Start it
await client.Containers.StartAsync(container.Id);

// Execute a command
var result = await client.Containers.ExecAsync(container.Id, "echo 'Hello from .NET!'");
Console.WriteLine(result.Stdout);

// Clean up
await client.Containers.DeleteAsync(container.Id);

Features

Container Management

// List all containers
var containers = await client.Containers.ListAsync();

// Create with options
var container = await client.Containers.CreateAsync(
    new CreateContainerRequest("python:3.12")
        .WithEnv("PYTHONPATH", "/app")
        .WithLabel("project", "demo")
);

// Lifecycle
await client.Containers.StartAsync(containerId);
await client.Containers.StopAsync(containerId);
await client.Containers.DeleteAsync(containerId);

// Execute commands
var result = await client.Containers.ExecAsync(containerId, "python --version");
if (result.IsSuccess)
{
    Console.WriteLine(result.Stdout);
}

File Operations

// List directory
var files = await client.Files.ListAsync(containerId, "/app");
foreach (var file in files)
{
    Console.WriteLine($"{file.Name} - {(file.IsDir ? "DIR" : $"{file.Size} bytes")}");
}

// Read file
var content = await client.Files.ReadStringAsync(containerId, "/etc/hostname");

// Write file
await client.Files.WriteAsync(containerId, "/app/script.py", "print('Hello!')");

// Delete file
await client.Files.DeleteAsync(containerId, "/tmp/scratch.txt");

Interactive Terminal

await using var terminal = await client.Terminal.ConnectAsync(containerId);

// Set up handlers
terminal.OnData += data => Console.Write(data);
terminal.OnClose += () => Console.WriteLine("Disconnected");
terminal.OnError += ex => Console.WriteLine($"Error: {ex.Message}");

// Send commands
await terminal.WriteAsync("ls -la\n");
await terminal.WriteAsync("cd /app && python main.py\n");

// Resize terminal
await terminal.ResizeAsync(120, 40);

// The using statement handles cleanup automatically

Error Handling

try
{
    var container = await client.Containers.GetAsync("invalid-id");
}
catch (RexecException ex) when (ex.IsApiError)
{
    Console.WriteLine($"API error {ex.StatusCode}: {ex.Message}");
}
catch (RexecException ex)
{
    Console.WriteLine($"Network error: {ex.Message}");
}

Async/Await and Cancellation

All methods support cancellation tokens:

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));

try
{
    var containers = await client.Containers.ListAsync(cts.Token);
}
catch (OperationCanceledException)
{
    Console.WriteLine("Operation timed out");
}

Building from Source

cd sdk/dotnet
dotnet build
dotnet pack

License

MIT License - see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 0 8/3/2026
1.0.1 37 8/1/2026
1.0.0 38 8/1/2026