Post to Slack from stdin.
Grab the latest release from Github.
echo "hello" | slackcat -channel=$YOUR_CHANNEL
export SLACK_TOKEN=$SLACK_TOKEN
echo "hello" | slackcat -channel=$YOUR_CHANNEL
echo "hello" | slackcat -channel=$YOUR_CHANNEL -token=$SLACK_TOKEN
treat stdin as a Slack attachment
cat attachment.json | slackcat -channel=$YOUR_CHANNEL -attachment
Check out the Slack Message Builder to give you an idea. Also please find some simple example JSON below:
{
"fallback": "Required plain-text summary of the attachment.",
"color": "#36a64f",
"title": "Slack API Documentation",
"title_link": "https://api.slack.com/",
"text": "Optional text that appears within the attachment",
}
echo "hello" | slackcat -channel=$YOUR_CHANNEL -tee
echo "hello" | slackcat -channel=$YOUR_CHANNEL -v
There are lots of repos named slackcat (written in Go even). The one I tried didn't work and it seemed too simple to implement hence the re-write.