No description
Find a file
Louis Seubert 8f91cee8a3
Some checks failed
default / dotnet default workflow (push) Failing after 30s
build: initial project release
2026-01-20 22:41:16 +01:00
.forgejo/workflows build: initial project release 2026-01-20 22:41:16 +01:00
src build: initial project release 2026-01-20 22:41:16 +01:00
.editorconfig build: initial project release 2026-01-20 22:41:16 +01:00
.gitignore build: initial project release 2026-01-20 22:41:16 +01:00
Directory.Build.props build: initial project release 2026-01-20 22:41:16 +01:00
Directory.Build.targets build: initial project release 2026-01-20 22:41:16 +01:00
Directory.Packages.props build: initial project release 2026-01-20 22:41:16 +01:00
global.json build: initial project release 2026-01-20 22:41:16 +01:00
LICENSE.md build: initial project release 2026-01-20 22:41:16 +01:00
nuget.config build: initial project release 2026-01-20 22:41:16 +01:00
process.slnx build: initial project release 2026-01-20 22:41:16 +01:00
README.md build: initial project release 2026-01-20 22:41:16 +01:00

Geekeey.Extensions.Process

Process is a .NET 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.

Features

  • Input and Output redirection: flexible piping model, that allows to redirect the process's streams.
  • Immutability: The Command object is immutable, ensuring thread safely and allowing sharing of a base configuration.

Getting Started

Install the NuGet package:

dotnet add package Geekeey.Extensions.Process

You may need to add our NuGet Feed to your nuget.config this can be done by adding the following lines


<packageSources>
  <add key="geekeey" value="https://git.geekeey.de/api/packages/geekeey/nuget/index.json" />
</packageSources>

Usage

public static 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;
}
public static Task<int> Main()
{
	var cmd = new Command("cat").WithArguments(["file.txt"]) | new Command("wc");
	await cmd.ExecuteAsync();
	Console.WriteLine(stdout.ToString());
}