Jig.Shell 0.3.0

dotnet add package Jig.Shell --version 0.3.0
                    
NuGet\Install-Package Jig.Shell -Version 0.3.0
                    
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="Jig.Shell" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jig.Shell" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Jig.Shell" />
                    
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 Jig.Shell --version 0.3.0
                    
#r "nuget: Jig.Shell, 0.3.0"
                    
#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 Jig.Shell@0.3.0
                    
#: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=Jig.Shell&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Jig.Shell&version=0.3.0
                    
Install as a Cake Tool

Jig Shell

Overview

Provides a utility to directly invoke shell commands using and bash-like syntax, and ITarget extensions to add these as invocations.

Usage

Configuring

Call .AddShell() when constructing the build to make shell execution available to the build.

Basic Usage

Call .Executes() on a target with the command string:

ITarget Target => field ??= new Target()
    .Executes(
        $"ENV_VAR1=val1 dotnet build Solution.sln --verbosity {Verbosity.Value}", 
        ShellLoggingOptions.StandardError
    );

This will add an execution to the target to invoke the specified process from the application working directory using the environment variables and arguments supplied in the string. The command executed, standard output, and standard error will be logged to the available ITargetLogger depending on the ShellLoggingOptions provided. By default all logging options are enabled.

Shell Execution

Commands can be executed in shells instead of process invocation:

  • ExectutesBash: Runs the command using bash
  • ExectutesZsh: Runs the command using zsh
  • ExectutesDash: Runs the command using dash/sh
  • ExectutesAsh: Runs the command using BusyBox ash
  • ExectutesPowerShell: Runs the command using powershell/pwsh
  • ExectutesNativeShell: Runs the command using the default shell depending on the OS and environment

DotNet Tool Execution

Call ExecutesDotNetTool() on a target specifying the dotnet tool to call and arguments to supply to it:

ITarget Target => field ??= new Target()
    .ExecutesDotNetTool($"jetbrains.resharper.globaltools cleanupcode Solution.sln"));

// > dotnet tool exec -y --allow-roll-forward --ignore-failed-sources jetbrains.resharper.globaltools -- cleanupcode Solution.sln"

This command definition will be transformed into a dotnet tool exec command running the tool with the targets supplied, running the tool with the specified arguments.

Manual Invocation

A Shell singleton instance is injected into the build on configuration. This can be resolved using normal execution and used for more complex calls:

ITarget Target => field ??= new Target()
    .Executes((Shell shell) => 
    {
        var output = await shell
            .Command($"ENV_VAR1=val1 dotnet build Solution.sln --verbosity {Verbosity.Value}")
            .ExecuteAndCaptureOutputAsync(buildContext.StoppingToken)
            .ToArrayAsync()
        
        // Process output
    });

Argument Redaction

Arguments can be redacted in logs by specifying :redacted in the argument format.

ITarget Target => field ??= new Target()
    .Executes($"dotnet nuget push --api-key {ApiKey:redacted}");

// > dotnet nuget push --api_key [REDACTED]

Sensitive BuildOptions are always redacted.

BuildOption<string> ApiKey { get; } = new("--api-key", sensitive: true)


ITarget Target => field ??= new Target()
    .Executes($"dotnet nuget push --api-key {ApiKey}");

// > dotnet nuget push --api_key [REDACTED]

Acknowledgements

Made trivial by:

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Jig.Shell:

Package Downloads
Jig.Apt

Jig extension adding apt package utilities for targets

Jig.DesktopNotifications

Jig extension adding desktop build notification hooks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 25 2/16/2026
0.2.1 97 2/4/2026
0.2.0 97 2/3/2026