CliInvoke Documentation

The CliInvoke library offers three patterns for invoking external processes from .NET, each tuned to a different audience and trade-off space. This page is the central hub of the Developer Portal — it routes you to the right specialized documentation based on who you are and what you're trying to do.

I am a …

Pick the description that fits you best. Each path is designed to land you on a working example or the right reference in 1–3 clicks.

Beginner — "I just need to run a command"

You want to launch a process, capture its output, and move on. No DI container, no builders, no ceremony.

Start here — copy, paste, run:

using CliInvoke;
using CliInvoke.Core;

// Execute a command and wait for it to finish.
ProcessResult result = await CliRun.RunAsync("dotnet", "--version");
Console.WriteLine($"Exit Code: {result.ExitCode}");

That's a complete working program using the beginner-friendly CliRun façade — one click from this page to a runnable example.

When you're ready for more:

Professional Developer — "I'm building a testable app with DI"

You work in a codebase that uses dependency injection, you need to unit-test code that calls out to processes, and you want clean separation between configuration and execution.

Start here:

  1. Choosing your Invocation Pattern — follow the decision tree to IProcessInvoker.
  2. Getting Started → Setting up CliInvoke — register IProcessInvoker with your DI container.
  3. Configuration — the ProcessConfiguration model, the builder lifecycle, and the default-value reference appendix.

Power User — "I need full lifecycle control"

You need to interact with the process while it runs (pipe input after Start, monitor progress, send signals), or replace components for advanced scenarios.

Start here:

  1. Choosing your Invocation Pattern → IExternalProcess — when and how to use the factory + lifecycle API.
  2. Architecture — the internal data-flow so you can reason about where a customisation belongs.
  3. Configuration — every knob on ProcessConfiguration and ProcessExitConfiguration.

I want to …

If you know what you need to accomplish but not which page it's on, jump straight to the relevant guide.

I want to … Go to
Debug a leak, hang, or wrong exit code Troubleshooting
Tune how a process starts or exits Configuration
Understand the internal data-flow Architecture
Pick between CliRun, IProcessInvoker, and IExternalProcess Choosing your Invocation Pattern
Dispose the Resource-Owning Types correctly Resource Disposal
Install and set up the library Getting Started · Quickstart
Migrate from v1 to v2, or v2 to v3 Migration Guides
Look up a specific API API Reference

All documentation

A flat index of every page in this Developer Portal.

Getting started

  • Quickstart — install and run your first CliRun command in under five minutes.
  • Getting Started — full installation, DI setup, and worked examples.

Guides

  • Choosing your Invocation Pattern — decision tree and trade-offs for CliRun, IProcessInvoker, and IExternalProcess.
  • Architecture — the four-stage data-flow from configuration to result.
  • Configuration — ProcessConfiguration, builders, defaults, and the reference appendix.
  • Resource Disposal — the three Resource-Owning Types and the disposal patterns they require.
  • Troubleshooting — category-based failure diagnosis with detection methods.

Other

Beyond the portal