Cake.Slack 5.0.0

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

Cake.Slack

Cake AddIn that extends Cake with Slack messaging features Build status

Usage

Post message

Using token

#addin "Cake.Slack"
var slackToken = EnvironmentVariable("SLACK_TOKEN");
var slackChannel = "#cake";
var postMessageResult = Slack.Chat.PostMessage(
            token:slackToken,
            channel:slackChannel,
            text:"This _is_ a `message` from *CakeBuild* :thumbsup:\r\n```Here is some code```"
    );

if (postMessageResult.Ok)
{
    Information("Message {0} successfully sent", postMessageResult.TimeStamp);
}
else
{
    Error("Failed to send message: {0}", postMessageResult.Error);
}

Cake output will be similar to below:

Message 1420896696.000057 successfully sent

This will result in an message in your Slack channel similar to below:

Sample message

Using incoming web hook url

#addin "Cake.Slack"
var slackhookuri = EnvironmentVariable("slackhookuri");
var slackChannel = "#cake";
var postMessageResult = Slack.Chat.PostMessage(
            channel:slackChannel,
            text:"This _is_ a `message` from *CakeBuild* :thumbsup:\r\n```Here is some code```",
            messageSettings:new SlackChatMessageSettings { IncomingWebHookUrl = slackhookuri }
    );

if (postMessageResult.Ok)
{
    Information("Message successfully sent");
}
else
{
    Error("Failed to send message: {0}", postMessageResult.Error);
}

Cake output will be similar to below:

Message successfully sent

This will result in an message in your Slack channel similar to below:

Sample message

Using message attachments

#addin "Cake.Slack"
var slackWebHookUrl = EnvironmentVariable("slackWebHookUrl");
var slackChannel = "#cake";
var slackAssemblyFieldAttachment = new SlackChatMessageAttachmentField[]
{
            new SlackChatMessageAttachmentField
            {
                Title =  "Message Attachment Title",
            	Value =  "Message Attachment Value"
            }
};
var postMessageResult = Slack.Chat.PostMessage(
	channel:slackChannel,
	text:"Starting Cake Build...",
	messageAttachments:new SlackChatMessageAttachment[]
	{
	            new SlackChatMessageAttachment
	            {
	                        Text = "Cake Text",
	                        Pretext = "Cake Pretext",
	                        Color = "#67A0E1",
	                        Fields = slackAssemblyFieldAttachment
	            }
     },
	messageSettings:new SlackChatMessageSettings { IncomingWebHookUrl = slackWebHookUrl });

if (postMessageResult.Ok)
{
    Information("Message successfully sent");
}
else
{
    Error("Failed to send message: {0}", postMessageResult.Error);
}

This will result in a message in your Slack channel similar to below:

Sample message attachment

Discussion

For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.

Join in the discussion on the Cake repository

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 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.
  • 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
5.0.0 2,154 10/9/2025
4.0.0 864 10/8/2025
3.0.0 209 10/7/2025
2.0.0 633,234 12/10/2021
1.3.0 5,292 12/10/2021
1.0.1 191,099 3/12/2021
1.0.0 127,850 2/9/2021
0.13.0 895,692 4/21/2019
0.12.0 46,106 7/3/2018
0.11.0 145,525 2/28/2018
0.10.0 21,739 2/8/2018
0.9.0 71,676 11/23/2017
0.8.0 1,479 11/23/2017
0.7.0 7,230 9/14/2017
0.6.0 11,259 2/22/2017
0.5.0 12,327 11/11/2016
0.4.0 3,721 7/11/2016
0.3.0 1,978 4/18/2016
0.2.0 1,873 12/7/2015
0.1.2 1,734 12/1/2015
0.1.1 1,786 9/15/2015
0.1.0 1,650 9/15/2015
0.0.2 1,655 6/27/2015
0.0.1 1,754 1/22/2015