ShadowDusk.Cli 0.26.0

dotnet tool install --global ShadowDusk.Cli --version 0.26.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.26.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ShadowDusk.Cli&version=0.26.0
                    
nuke :add-package ShadowDusk.Cli --version 0.26.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 output is signed on every host: dxil.dll signs on Windows, and the CLI writes the identical container hash itself elsewhere (the old SD0214 unsigned-DXIL warning is retired).

Direct .xnb output

Name an .xnb output path and the CLI writes the content-pipeline container itself, so Content.Load<Effect>("MyShader") keeps working with MGCB out of the picture and no consumer code change; the platform byte is derived from the profile and the payload inside is byte-for-byte the .mgfx (or FNA .fxb) the same invocation would write, except that on DirectX 12 and Vulkan (MGFX v11) the per-shader source-file string is <unknown>, as in a stock MGCB build, instead of the path you passed. Render-proven with a real ContentManager on MonoGame (WindowsDX + DesktopGL), KNI (4.2.9001 + 4.3.9001) and FNA. Name the profile: with no /Profile: the default is DirectX_11, which a DesktopGL game rejects (the CLI warns with SD0029).

ShadowDuskCLI <input.fx> Content/<output>.xnb /Profile:OpenGL

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|slang 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.

Slang input

A .slang file (detected by extension, or forced with --input-format slang) goes through ShadowDusk.Compiler's built-in Slang frontend: the HLSL-compatible subset of Slang, with entry points marked by [shader("vertex")] / [shader("fragment")] and the technique synthesized from the file name. It is a pure text transform ahead of the same pipeline every .fx takes, so nothing extra is installed and no slangc runs. Slang-only features (import, generics, interface conformances) are rejected by name with a diagnostic pointing at the .slang line; genuine full Slang needs the separate, opt-in ShadowDusk.Slang library package, which the CLI does not use.

ShadowDuskCLI shader.slang shader.mgfx /Profile:OpenGL

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, kni-knifx-v12, 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.26.0 125 11/15/2026
0.25.1 137 11/9/2026
0.25.0 116 11/5/2026
0.24.0 1,072 11/1/2026
0.23.0 146 10/30/2026
0.22.1 125 10/29/2026
0.22.0 123 10/28/2026
0.21.0 179 10/6/2026
0.20.0 289 9/10/2026
0.19.0 176 9/10/2026
0.18.0 3,484 8/3/2026
0.17.0 168 8/1/2026
0.16.0 183 7/31/2026
0.15.1 176 7/28/2026
0.15.0 148 7/28/2026
0.14.2 363 7/25/2026
0.14.1 162 7/25/2026
0.14.0 163 7/24/2026
0.13.0 171 7/23/2026
0.12.1 166 7/22/2026
Loading failed