Geekeey.Process (1.0.0)
Installation
dotnet nuget add source --name geekeey --username your_username --password your_token dotnet add package --source geekeey --version 1.0.0 Geekeey.ProcessAbout this package
Package Description
Process is a library for interacting with external command-line interfaces. It provides a convenient model for launching processes, redirecting input and output streams, awaiting completion, handling cancellation, and more.
Usage
Execute a command and capturing its output:
public static async Task<int> Main()
{
var stdout = new StringBuilder();
var cmd = new Command("git").WithArguments(["config", "--get", "user.name"]) | stdout;
await cmd.ExecuteAsync();
Console.WriteLine(stdout.ToString());
return 0;
}
Execute a command and redirect its output to another command:
public static Task<int> Main()
{
var cmd = new Command("cat").WithArguments(["file.txt"]) | new Command("wc");
await cmd.ExecuteAsync();
Console.WriteLine(stdout.ToString());
}
Execute a command with cancellation support:
public static async Task<int> Main()
{
using var cts = new CancellationTokenSource();
Console.CancelKeyPress += (s, e) =>
{
e.Cancel = true;
cts.Cancel();
};
var cmd = new Command("long-running-command");
// kills the process if Ctrl+C is pressed
var app = cmd.ExecuteAsync(cts.Token);
// manually interrupt after 5 seconds
await Task.Delay(5000);
app.Interrupt();
// wait for process to exit
var result = await app;
return 0;
}
Details
2026-01-22 18:11:52 +00:00
Assets (4)
Versions (1)
View all
NuGet
1
The Geekeey Team
92 KiB
geekeey.process.1.0.0.nupkg
53 KiB
geekeey.process.nuspec
863 B
geekeey.process.1.0.0.snupkg
15 KiB
geekeey.process.pdb
24 KiB
1.0.0
2026-01-22