No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Louis Seubert 50a92291dc
All checks were successful
default / dotnet-default-workflow (pull_request) Successful in 1m21s
default / dotnet-default-workflow (push) Successful in 1m12s
feat: add diagnostic source for process lifecycle
The library publishes process lifecycle events through a `DiagnosticListener` named
`Geekeey.Process`. Subscribe through `DiagnosticListener.AllListeners` and handle the
`starting`, `started`, and `finished` events. Each event value is a mutable `Hashtable`
that is shared by the lifecycle, so values added by a listener remain available to later
stages.
2026-08-25 22:30:37 +02:00
.forgejo/workflows build: initial project release 2026-05-10 10:49:39 +02:00
src feat: add diagnostic source for process lifecycle 2026-08-25 22:30:37 +02:00
.editorconfig chore: update editorconfig to be in sync with other projects 2026-05-21 22:05:33 +02:00
.gitignore build: initial project release 2026-05-10 10:49:39 +02:00
CHANGELOG.md build: initial project release 2026-05-10 10:49:39 +02:00
Directory.Build.props build: initial project release 2026-05-10 10:49:39 +02:00
Directory.Build.targets build: initial project release 2026-05-10 10:49:39 +02:00
Directory.Packages.props feat: remove spectre.console 2026-05-10 15:08:55 +02:00
global.json build: initial project release 2026-05-10 10:49:39 +02:00
LICENSE.md build: initial project release 2026-05-10 10:49:39 +02:00
nuget.config build: initial project release 2026-05-10 10:49:39 +02:00
process.slnx build: initial project release 2026-05-10 10:49:39 +02:00
README.md build: initial project release 2026-05-10 10:49:39 +02:00

Geekeey.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.Process

You may need to add our NuGet feed to your nuget.config this can be done by running the following command:

dotnet nuget add source -n geekeey https://code.geekeey.de/api/packages/geekeey/nuget/index.json

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 stdout = new StringBuilder();
  var cmd = new Command("cat").WithArguments(["file.txt"]) | new Command("wc") | stdout;
  await cmd.ExecuteAsync();
  Console.WriteLine(stdout.ToString());
  return 0;
}