Cake.Download.Module 0.1.0-preview.1

This is a prerelease version of Cake.Download.Module.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Cake.Download.Module --version 0.1.0-preview.1
                    
NuGet\Install-Package Cake.Download.Module -Version 0.1.0-preview.1
                    
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="Cake.Download.Module" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cake.Download.Module" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Cake.Download.Module" />
                    
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 Cake.Download.Module --version 0.1.0-preview.1
                    
#r "nuget: Cake.Download.Module, 0.1.0-preview.1"
                    
#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 Cake.Download.Module@0.1.0-preview.1
                    
#: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.
#module nuget:?package=Cake.Download.Module&version=0.1.0-preview.1&prerelease
                    

Cake.Download.Module

A Cake module that installs command-line tools that are not on NuGet, such as GitHub release assets or any file on an HTTPS server, with the download: scheme. It downloads the file for the current platform, verifies its SHA-256, extracts it if it is an archive, and registers the tool so Cake's aliases and Context.Tools.Resolve(...) find it.

Install

Cake .NET Tool (build.cake):

#module nuget:?package=Cake.Download.Module&version=0.1.0-preview.1
#tool "download:https://github.com/jqlang/jq/releases/download/jq-{version}/jq-{os}-{arch}{exe}?package=jq&version=1.8.2&os.darwin=macos&checksums=sha256sum.txt&checksums_sha256=dc86824a41c165ece971ff691aff6e08bbfe6e1d1f531688b47ee78c283a85cd"

Cake SDK (cake.cs):

#:sdk Cake.Sdk@6.3.0
#:package Cake.Download.Module@0.1.0-preview.1

InstallTool("download:https://github.com/jqlang/jq/releases/download/jq-{version}/jq-{os}-{arch}{exe}?package=jq&version=1.8.2&os.darwin=macos&checksums=sha256sum.txt&checksums_sha256=dc86824a41c165ece971ff691aff6e08bbfe6e1d1f531688b47ee78c283a85cd");

Cake Frosting:

return new CakeHost()
    .UseModule<Cake.Download.Module.DownloadModule>()
    .InstallTool(new Uri("download:https://github.com/jqlang/jq/releases/download/jq-{version}/jq-{os}-{arch}{exe}?package=jq&version=1.8.2&os.darwin=macos&checksums=sha256sum.txt&checksums_sha256=dc86824a41c165ece971ff691aff6e08bbfe6e1d1f531688b47ee78c283a85cd"))
    .Run(args);

The directive

download:<url-template>?package=<name>&version=<version>[&<parameter>=<value>]*
Parameter Meaning
package Tool name: install folder, default file name and default include. Required.
version Exact version; fills {version}. Required. latest is rejected.
sha256=<hex> Pin the downloaded file.
sha256.<rid>=<hex> Pin the file per platform, e.g. sha256.linux-x64=….
checksums=<file> + checksums_sha256=<hex> Pin a checksums file (relative to the download URL, or absolute) and look the asset up in it.
sha256=skip Install without verification (a warning is logged).
dialect Placeholder vocabulary: go (default), dotnet or rust.
os.<value>=, arch.<value>=, archive.<os>= Override a dialect value, e.g. os.darwin=macOS.
triple.<rid>= Override the Rust target triple for one platform.
url= / url.<rid>= Percent-encoded URL template instead of / per platform.
format file, zip, tar or tar.gz; detected from the URL by default.
filename File name for a raw download; default <package> plus .exe on Windows.
include / exclude Globs (repeatable) choosing the files registered with Cake. Default: the raw file, or **/<package>{exe} in archives.

Exactly one integrity option is required. Leave it out once, and the error message contains the exact parameter to paste, with the hash of what was downloaded.

Parameter values are percent-decoded, so a value containing =, &, ? or # (notably url=) must be percent-encoded; otherwise Cake reports "Could not parse query string.". package and version must start with a letter or digit. Placeholders are expanded in the URL, url, url.<rid>, checksums, filename, include and exclude. Validation is strict: unknown parameters are errors.

Placeholders and dialects

Placeholder go dotnet rust
{os} windows / linux / darwin win / linux / osx windows / linux / darwin
{arch} amd64 / arm64 / 386 / arm x64 / arm64 / x86 / arm x86_64 / aarch64 / i686 / armv7
{triple} – – e.g. x86_64-pc-windows-msvc, aarch64-apple-darwin, x86_64-unknown-linux-musl

{version}, {rid} (win-x64, linux-arm64, osx-arm64, …), {exe} (.exe on Windows) and {archive} (zip on Windows, tar.gz elsewhere) work in every dialect. Supported platforms: win-x64, win-x86, win-arm64, linux-x64, linux-arm64, linux-arm, osx-x64, osx-arm64.

In the rust dialect, {triple} on Linux defaults to musl (x86_64-unknown-linux-musl); override it per platform with triple.<rid>=.

Examples

// Archive whose format differs per OS (gh)
#tool "download:https://github.com/cli/cli/releases/download/v{version}/gh_{version}_{os}_{arch}.{archive}?package=gh&version=2.62.0&os.darwin=macOS&archive.darwin=zip&checksums=gh_{version}_checksums.txt&checksums_sha256=89dc6f5225aa0c70d6f90950f5246225afff2f423f3d242f7d8813fe9993af4d"

// Rust target triples (ripgrep), per-platform pins
#tool "download:https://github.com/BurntSushi/ripgrep/releases/download/{version}/ripgrep-{version}-{triple}.{archive}?package=rg&version=14.1.1&dialect=rust&sha256.win-x64=d0f534024c42afd6cb4d38907c25cd2b249b79bbe6cc1dbee8e3e37c2b6e25a1&sha256.linux-x64=4cf9f2741e6c465ffdb7c26f38056a59e2a2544b51f7cc128ef28337eeae4d8e&sha256.osx-arm64=24ad76777745fbff131c8fbc466742b011f925bfa4fffa2ded6def23b5b937be"

// .NET RIDs (cyclonedx-cli)
#tool "download:https://github.com/CycloneDX/cyclonedx-cli/releases/download/v{version}/cyclonedx-{rid}{exe}?package=cyclonedx&version=0.30.0&dialect=dotnet&sha256.win-x64=1f563ba9644d2f2966fc8029fd701ca4af4f388d44c017c1d60559a1ecc9114f&sha256.linux-x64=f89876326620f5fc78a9b27cc1af57d6ed13d019aab87490e1246a44a910babb&sha256.osx-arm64=dabbaf07e543e7996f708147475e2daa69ddf8a8683c5b06febc7d3f074e5e24"

Where tools go

Each tool is installed into <tools>/<package>.<version>/ (Cake's tools folder, ./tools by default). Archives are extracted verbatim. A .cake-download.json file records what was installed, and later builds with the same directive make no network requests. Different versions are installed side by side and never deleted automatically.

Limitations

Only public HTTPS downloads: no authentication, private repositories, mirrors or signature verification. Archive formats are zip, tar and tar.gz. Authenticated (NTLM) proxies are not supported. On Windows, symbolic links to directories inside tar archives are not materialized.

License

MIT

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 is compatible.  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 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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 61 10/6/2026
0.1.0-preview.1 53 10/4/2026