Reference

This reference guide describes the various methods and properties which make up the Cake build language, or DSL. If you're looking for other kind of information, check out the API reference or the documentation.

The DSL is made up of script aliases, that offers specific functionality within the context of a Cake build script. A script alias is an extension method for ICakeContext.

Built-In

Category Summary
Arguments Contains functionality related to arguments.
Assembly Info Contains functionality related to assembly info.
Build System Contains functionality related to build systems.
Cake Contains functionality related to running Cake scripts out of process.
Chocolatey

Contains functionality for working with Chocolatey.

In order to use the commands for this alias, Chocolatey will require to be installed on the machine where the build script is being run. See this page for details on how Chocolatey can be installed.

Compression Contains functionality related to compress files.
Directory Operations Contains extension methods for working with directories.
DotCover

Contains functionality related to DotCover.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the appropriate settings class:

#tool "nuget:?package=JetBrains.dotCover.CommandLineTools"

DotNetBuild Contains functionality to run either MSBuild on Windows or XBuild on Mac/Linux/Unix.
DotNetCore

Contains functionality related to .NET Core CLI.

In order to use the commands for this alias, the .Net Core CLI tools will need to be installed on the machine where the Cake script is being executed. See this page for information on how to install.

Environment Several extension methods when using Environment Variables.
File Operations Several extension methods when using File.
Fixie

Contains functionality related to running Fixie tests.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the FixieSettings class:

#tool "nuget:?package=Fixie"

GitLink

Contains functionality related to GitLink.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the GitLinkSettings class:

#tool "nuget:?package=gitlink"

GitReleaseManager

Contains functionality related to GitReleaseManager.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the appropriate settings class:

#tool "nuget:?package=gitreleasemanager"

GitReleaseNotes

Contains functionality related to GitReleaseNotes.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the GitReleaseNotesSettings class:

#tool "nuget:?package=GitReleaseNotes"

GitVersion

Contains functionality related to GitVersion.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the GitVersionSettings class:

#tool "nuget:?package=GitVersion.CommandLine"

Globbing Contains functionality related to file system globbing.
HTTP Operations

Contains functionality for working with HTTP operations such as GET, PUT, POST, DELETE, PATCH, etc.

ILMerge

Contains functionality related to ILMerge.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the ILMergeSettings class:

#tool "nuget:?package=ilmerge"

ILRepack

Contains functionality related to ILRepack.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the ILRepackSettings class:

#tool "nuget:?package=ILRepack"

Inno Setup

Contains functionality related to Inno Setup.

In order to use the commands for this alias, Inno Setup will need to be installed on the machine where the Cake script is being executed. See this page for information on how to download/install.

Logging Contains functionality related to logging.
MSBuild

Contains functionality related to MSBuild.

In order to use the commands for this alias, MSBuild will already have to be installed on the machine the Cake Script is being executed.

MSBuild Resource Contains functionality related to MSBuild project files.
MSTest

Contains functionality related to running MSTest unit tests.

In order to use the commands for this alias, MSTest will need to be installed on the machine where the Cake script is being executed. This is typically achieved by having either Visual Studio installed, or by using the Micrsoft Build Tools, for example, for 2015.

NSIS

Contains functionality related to NSIS.

In order to use the commands for this alias, NSIS will need to be installed on the machine where the Cake script is being executed. See this page for information on how to download/install.

NuGet Extended NuGet Aliases
NUnit

Contains functionality related to running NUnit tests.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the NUnitSettings class:

#tool "nuget:?package=NUnit.Runners&version=2.6.4"

NUnit v3

Contains functionality related to running NUnit v2 and v3 unit tests.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the NUnit3Settings class:

#tool "nuget:?package=NUnit.ConsoleRunner"

Octopus Deploy

Contains functionality related to Octopus Deploy.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the appropriate settings class:

#tool "nuget:?package=OctopusTools"

OpenCover

Contains functionality related to OpenCover.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the OpenCoverSettings class:

#tool "nuget:?package=OpenCover"

Process Contains functionality related to processes.
Release Notes Contains functionality related to release notes.
ReportGenerator

Contains functionality related to ReportGenerator.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the ReportGeneratorSettings class:

#tool "nuget:?package=ReportGenerator"

ReportUnit

Contains functionality related to ReportUnit.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the ReportUnitSettings class:

#tool "nuget:?package=ReportUnit"

ReSharper

Contains functionality related to ReSharper's InspectCode tool.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the InspectCodeSettings class:

#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools"

Roundhouse

Contains functionality related to RoundhousE.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the RoundhouseSettings class:

#tool "nuget:?package=roundhouse"

Security Contains security related functionality, such as calculating file hashes.
Signing Contains functionality for working with VsixSignTool. Aliases for VsixSignTool.
SpecFlow

Contains functionality related to SpecFlow.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the appropriate settings class:

#tool "nuget:?package=SpecFlow"

Text Contains functionality related to text transformation.
VSTest Contains functionality related to running VSTest unit tests.
VSWhere

Contains functionality related to running VSWhere tool.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the settings class:

#tool "nuget:?package=vswhere"

WiX

Contains functionality related to WiX.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the appropriate settings class:

#tool "nuget:?package=WiX.Toolset"

XBuild

Contains functionality related to XBuild.

In order to use the commands for this alias, XBuild (which is part of Mono) will already have to be installed on the machine the Cake Script is being executed.

XML Contains functionality related to XML XPath queries.
xUnit

Contains functionality related to running xunit tests.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the XUnitSettings class:

#tool "nuget:?package=xunit.runners&version=1.9.2"

xUnit v2

Contains functionality related to running xunit tests.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the XUnit2Settings class:

#tool "nuget:?package=xunit.runner.console"

Addins

Category Summary
ActiveDirectory Contains functionality related to managing Active Directory.
Android Cake build aliases for Android ADB commands
Android SDK Manager Android SDK related aliases.
AndroidAppManifest
Apigee Contains functionality for proxy import and deployments within Apigee.
AppleSimulator
AppPacakager
AppVeyor AppVeyor API related cake aliases.
Assembly Info Contains functionality related to assembly info.
AutoRest Provides a wrapper around AutoRest functinoality for use in Cake scripts
AWS Amazon Route53 aliases
AzureStorage Contains functionality for workign with Azure Storage
Cake Extension for XcStudio Cake Extension for XComponent Studio
Cake Extension for XcTools Cake Extension for XComponent Tools
CakeMail

Contains aliases related to CakeMail.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.CakeMail

CMake Contains functionality to running CMake.
CocoaPods Cocoapods aliases.
Code Analysis Reporting Contains functionality for creating report from code analysis log files.
Collection Helpers Several extension methods when using IEnumerable.
Communication Contains functionality for working with Plink. Aliases for Putty. Contains functionality for working with PSCP.
Compression Contains functionality related to compress files.
Configuration
Coveralls

Contains aliases related to Coveralls.io.

In order to use the commands for this addin, you will need to include either of the following in your build.cake file to download and reference from NuGet.org:

#tool coveralls.net
#tool coveralls.io
In addition, you will need to include the following:
#addin Cake.Coveralls

CsvHelper Contians functionality related to reading and writing CSV files.
Curl

Contains aliases related to curl.

In order to use the commands for this add-in, a version of curl will need to be installed on the machine where the Cake script is being executed. While curl is usually included in most Unix-based operating systems, you will likely have to install it yourself on Windows. The Windows version of curl is also part of Cygwin.

#addin Cake.Curl
Database Cake AddIn that packages multiple SQL Scripts into one file to speed up deployment and minimize the probability of errors.
#addin Cake.SqlServerPackager
Deployment

Contains functionality for working with the MsDeploy.exe (Web Deploy) command line interface (cli).

MsDeploy v3.6 will already have to be installed on the machine the Cake Script is being executed on.

See also https://www.microsoft.com/en-us/download/details.aspx?id=43717
Directory Helpers Several extension methods when operating on a Directory.
DocFx Contains functionality related to DocFx.
Docker Contains functionality for working with docker-compose up command. Contains functionality for working with docker-compose unpause command. Contains functionality for working with docker-compose stop command. Contains functionality for working with docker-compose start command. Contains functionality for working with docker-compose scale command. Contains functionality for working with docker-compose run command. Contains functionality for working with docker-compose rm command. Contains functionality for working with docker-compose restart command. Contains functionality for working with docker-compose pull command. Contains functionality for working with docker-compose build command. Contains functionality for working with docker-compose pause command. Contains functionality for working with docker-compose down command. Contains functionality for working with create command. Contains functionality for working with cp command. Contains functionality for working with login command. Contains functionality for working with network remove command. Contains functionality for working with network disconnect command. Contains functionality for working with network create command. Contains functionality for working with network connect command. Contains functionality for working with ps command. Contains functionality for working with build command. Contains functionality for working with push command. Contains functionality for working with load command. Contains functionality for working with run command. Contains functionality for working with save command. Contains functionality for working with stop command. Contains functionality for working with rmi command. Contains functionality for working with swarm init command. Contains functionality for working with swarm update command. Contains functionality for working with swarm leave command. Contains functionality for working with swarm join command. Contains functionality for working with tag command. Contains functionality for working with rm command.
DoInDirectory Contains functionality for changing the current directory for an operation
DotNetCore

Contains functionality related to .NET Core CLI.

In order to use the commands for this alias, the .Net Core CLI tools will need to be installed on the machine where the Cake script is being executed. See this page for information on how to install.

Email Contains functionality related to emails
Environment Several extension methods when using Environment Variables.
Figlet Figlet aliases.
File Helpers File helper aliases. A set of aliases for Cake Build to help with simple File operations such as Reading, Writing and Replacing text.
File Operations Several extension methods when using File.
FluentMigrator

Contains aliases related to FluentMigrator.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.FluentMigrator

FTP Contains functionality for working with FTP
Gem

Contains functionality related to the RubyGems Package Manager.

In order to use the commands for this addin, the gem utility will need to be installed and available, or you will need to provide a ToolPath to where it can be located, and also you will need to include the following in your build.cake file to download and reference the addin from NuGet.org:

#addin Cake.Gem

Genymotion
Git Cake AddIn which copies files based on Git log.
#addin Cake.GitPackager
Gitter

Contains aliases related to gitter.im.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.Gitter

Guard Contains extensions for guard clauses
HipChat

Exposes functionality in the HipChat.Net NuGet package as a Cake Addin.

In order to use the commands for this addin, include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.HipChat

HockeyApp Contains functionality related to HockeyApp
HTTP Operations

Contains functionality for working with HTTP operations such as GET, PUT, POST, DELETE, PATCH, etc.

JMeter Contains functionality for using the JMeter tool
Json JSON related cake aliases.
Kudu Contains aliases related to Kudu web site environment and deployment
Microsoft Teams Contains functionality related to Microsoft Teams.
MSBuild Resource Contains functionality related to MSBuild project files.
MsDeploy

Contains functionality for working with the MsDeploy.exe (Web Deploy) command line interface (cli).

MsDeploy v3.6 will already have to be installed on the machine the Cake Script is being executed on.

See also https://www.microsoft.com/en-us/download/details.aspx?id=43717
Node contains functionality to interact with gulp
Npm Provides a wrapper around Npm functionality within a Cake build script
NuGet Extended NuGet Aliases
OctoDeploy Simple GitHub release publishing
Orchard
Paket

Contains functionality for working with paket.

In order to use the commands for this addin, you will need to include the following in your build.cake file:

#addin paket:?package=Cake.Paket

This assumes your using the Cake.Paket.Module. If you'd rather use NuGet then include:

#addin nuget:?package=Cake.Paket
#tool nuget:?package=Paket

Path Contains functionality for manipulating the path.
plist Contains functionality to work with plist files.
Postman

Contains functionality related to the Newman CLI.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.Newman

Pull Request Code Analysis Contains functionality related to writing code analysis issues to pull requests.
Raygun
ReSharperReports

Contains functionality related to the ReSharperReports tool.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#tool ReSharperReports
In addition, you will need to include the following:
#addin Cake.ReSharperReports

ResxConverter Contains alias for converting .NET Resx files to different output formats.
Scripty

Alias to evaluate C# scripts using Scripty

#tool "nuget:?package=Scripty"
Semantic Versioning Semantic Versioning aliases.
SendGrid

Contains aliases related to SendGrid.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.SendGrid

Services Windows service aliases.
Signing Contains functionality for working with VsixSignTool. Aliases for VsixSignTool.
Sonar

Contains functionality for running a Sonar analysis on a c# project using the MSBuild SonarQube Runner.

In order to use the commands for this addin, include the following in your build.cake file to download and reference from NuGet.org:

#addin "nuget:?package=Cake.Sonar"
#tool "nuget:?package=MSBuild.SonarQube.Runner.Tool"

SqlServer

Contains functionality to deal with SQL Server: DropDatabase, CreateDatabase, execute SQL, execute SQL from files, etc. Provides functionality to manage LocalDb instances: Create, Start, Stop, Delete instances;

In order to use the commands for this addin, include the following in your build.cake file to download and reference from NuGet.org:

#addin "nuget:?package=Cake.SqlServer"

SqlTools
Squirrel
Storyteller Alias for Cake Storyteller
Strong Naming Strong name verify tool aliases. If one has turned off strong name verification on a machine you can provide the StrongNameToolSettings with ForceVerification set to true.
Swagger Alias to access the code generation functionality from the NSwag toolchain
SynVer

Contains functionality related to the SyntacticVersioning.

In order to use the commands for this addin you will need to include the following in your build.cake file to download and reference the addin from NuGet.org:

#addin Cake.SynVer

Terraform
Tfx

Contains functionality related to the TFS Cross Platform Command Line Interface.

In order to use the commands for this addin, the tfx-cli utility will need to be installed and available, or you will need to provide a ToolPath to where it can be located, and also you will need to include the following in your build.cake file to download and reference the addin from NuGet.org:

#addin Cake.Tfx

Topshelf Topshelf aliases
Transifex Provides a wrapper around transifex client functionality within a Cake build script.
Twitter

Contains functionality related to Twitter REST API.

In order to use the commands for this addin, include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.Twitter

Vagrant Gets a runner to control Vagrant through the CLI. See the documentation on GitHub for a full API reference.
Version Reader Contains functionality for retrieving version numbers from assemblies
VS .proj file helpers Helpers to ease manipulation of vs proj files.
Vsce

Contains aliases related to VSCode Extension Manager.

In order to use the commands for this addin, you will need to include the following in your build.cake file to download and reference from NuGet.org:

#addin Cake.VsCode

VsMetrics

Contains functionality related to Visual studio's metrics.exe command line tool.

In order to use the commands for this addin, you will need to register metrics.exe in your cake build file after you have installed the metrics power tool:

Setup(context => {
    context.Tools.RegisterFile("C:/Program Files (x86)/Microsoft Visual Studio 14.0/Team Tools/Static Analysis Tools/FxCop/metrics.exe");
});
In addition, you will need to include the following:
#addin Cake.VsMetrics

Watch Contains functionality for watching file changes.
WebDeploy Contains Cake aliases for WebDeploy
Webpack Provides a wrapper around Webpack functionality within a Cake build script
Wyam

Contains functionality related to Wyam.

In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the WyamSettings class:

#addin "nuget:?package=Cake.Wyam"
#tool "nuget:?package=Wyam"

Xamarin Xamarin related cake aliases.
XCode XCode aliases.
XDT
Yaml YAML related cake aliases.
Yarn Provides a wrapper around Yarn functionality within a Cake build script