This example target provides a command-line interface for sending a simple example Slack message to a configured channel.
This example should always be executed from inside this directory (since it searches for a configuration file here).
At the end of this quick start, you should be able to post an example message like the following to your configured channel:

Derived from Slack's setup guide for the equivalent GitHub Actions workflow.
- In this directory, copy
config.example.yaml
toconfig.yaml
- Create a Slack App for your workspace (alternatively use an existing app you have already created and installed)
- Add the
chat.write
bot scope under OAuth & Permissions - Install the app to your workspace
- Copy the app's Bot Token from the OAuth & Permissions page and replace the example value for the key
authToken
inconfig.yaml
- Invite the bot user into the channel you wish to post messages to (
/invite @bot_user_name
). - Click the channel name in the upper bar, then copy the channel ID from the resulting screen and replace the example value for the key
channel
inconfig.yaml
:

Here are some example commands for sending messages or showing help information about the CLI:
swift run
: send the exact example message shown aboveswift run SlackMessageClientCli --help
: print the CLI's help messages (which show what values can be configured)swift run SlackMessageClientCli --user Bunkyr
: replace the profile picture and username in the example above