ShadowDusk.Cli 0.18.0

dotnet tool install --global ShadowDusk.Cli --version 0.18.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ShadowDusk.Cli --version 0.18.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ShadowDusk.Cli&version=0.18.0
                    
nuke :add-package ShadowDusk.Cli --version 0.18.0
                    

ShadowDusk.Cli (ShadowDuskCLI)

Cross-platform drop-in replacement for MonoGame's mgfxc shader compiler, as a dotnet tool: compiles .fx to MonoGame/KNI .mgfx and FNA D3D9 fx_2_0 .fxb on Linux, macOS, and Windows — no fxc.exe, no Wine, no Windows SDK. Same flags, same output format, same exit codes, and MGCB-parseable stderr diagnostics, so a build step that invokes mgfxc can call ShadowDuskCLI instead with nothing downstream changing.

Install

dotnet tool install --global ShadowDusk.Cli

Use

ShadowDuskCLI <input.fx> <output.mgfx> /Profile:OpenGL
ShadowDuskCLI <input.fx> <output.mgfx> /Profile:DirectX_11
ShadowDuskCLI <input.fx> <output.mgfx> /Profile:DirectX_12
ShadowDuskCLI <input.fx> <output.mgfx> /Profile:Vulkan
ShadowDuskCLI <input.fx> <output.fxb>  /Profile:FNA

Flags mirror mgfxc (/Profile, /Debug, /I, /Defines, /DxbcBackend, --mgfx-version), plus --target-runtime to pick the backend + format together by name. Run ShadowDuskCLI --help for the full list.

/Profile:DirectX_12 should be compiled on Windows: DXIL signing runs through the Windows-only dxil.dll, so a non-Windows DX12 compile emits unsigned DXIL that retail D3D12 rejects (warned as SD0214). Other targets are host-independent.

ShaderToy / GLSL input

In addition to .fx, the CLI accepts a single-pass ShaderToy / GLSL image shader (.glsl, .frag, .fs) and converts it to a self-contained .fx before compiling — so a ShaderToy mainImage (or a plain void main() fragment shader) compiles straight to a loadable .mgfx/.fxb for any target:

ShadowDuskCLI shader.glsl shader.mgfx /Profile:OpenGL

Detection is automatic (by extension, with a content sniff for off-convention files); .fx is never sniffed and behaves exactly as before, and no flag is ever required for correct output. The non-required escape hatch --input-format auto|fx|glsl forces a route for an oddly-named or genuinely-ambiguous file. Unsupported GLSL constructs fail loudly with an MGCB-parseable file(line,col): error SDxxxx: message diagnostic pointing at the original .glsl. --print-uniforms lists the drivable effect parameters (e.g. iResolution, iTime, custom uniforms) you must set each frame at runtime. The converted shader needs a small per-frame harness (set the uniforms, draw a fullscreen triangle) — see the ShaderToyViewer sample.

The output container defaults to MGFX v10, which loads on every MonoGame 3.8.1.263+ and KNI runtime — you never need a flag for correct output. For newer runtimes, --mgfx-version 11 opts into a faithful MonoGame MGFX v11 container (MonoGame 3.8.5+, opt-in/experimental). To pick a whole target in one flag, --target-runtime <name> (monogame-gl, monogame-dx, monogame-gl-v11, kni-knifx, fna) selects the backend and container together — e.g. --target-runtime kni-knifx emits KNI's KNIFX v11 container.

Using it with the MonoGame content pipeline

Invoke ShadowDuskCLI directly from your build script / Makefile / CI step and /copy: the resulting .mgfx into your content, or compile at runtime with ShadowDusk.Compiler and hand the bytes to Effect. Both work on Linux/macOS build agents where mgfxc cannot run.

Aliasing this tool to mgfxc on PATH does not make MGCB use it. Measured against dotnet mgcb 3.8.2.1105, 3.8.4.1, and 3.8.5: MGCB compiles .fx in-process and never launches an external effect compiler, so there is no process for the alias to intercept. The PATH override still works for a build step that genuinely launches a process named mgfxc.

Self-contained single-file binaries (no .NET install needed) for win-x64, linux-x64, osx-x64, and osx-arm64 are attached to each GitHub Release.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.

This package has no dependencies.

Version Downloads Last Updated
0.18.0 122 8/3/2026
0.17.0 118 8/1/2026
0.16.0 119 7/31/2026
0.15.1 125 7/28/2026
0.15.0 100 7/28/2026
0.14.2 155 7/25/2026
0.14.1 112 7/25/2026
0.14.0 114 7/24/2026
0.13.0 119 7/23/2026
0.12.1 109 7/22/2026
0.12.0 150 7/19/2026
0.11.0 137 6/29/2026
0.10.0 118 6/28/2026
0.9.0 132 6/22/2026
0.8.0 137 6/18/2026
0.7.0 122 6/15/2026
0.6.0 122 6/14/2026
0.5.1 118 6/13/2026
0.5.0 113 6/13/2026
0.4.0 110 6/11/2026
Loading failed