Simple CLI tool and Go library to post formatted status messages to a Slack channel ๐
Slackstatus is available as pre-built binaries for macOS, Linux, FreeBSD and Windows on the release page.
slackstatus "message body" --webhook=https://hooks.slack.com/services/XXXX --color=good --chanel=status --user=slackstatus --footer="V1.0.0" --iconemoji=":monkey_face:"
You can also pipe your message text from another output:
echo "message text" | slackstatus --color=good
All flag values can also be pre-set in a config file .slackstatus.yml
in the current directory or in your $HOME
like so:
webhook: https://hooks.slack.com/services/XXXX
user: slackstatus
channel: status
footer: V1.0.0
iconemoji: :monkey_face:
It is also possible to provide a specific path to your config file as --config=/path/to/config
.
Get help on all available flags:
slackstatus --help
package main
import "github.com/pteich/slackstatus"
var slackmsg = slackstatus.Message{
WebhookURL: "https://hooks.slack.com/services/XXXX",
Username: "slackstatus",
Channel: "#status",
IconEmoji: ":monkey_face:",
Footer: "Version 1.0.0",
}
func main() {
slackmsg.Send("Hello Slackstatus! Everything works fine.", slackstatus.ColorGood)
slackmsg.Send("Oh crap, something went wrong!", slackstatus.ColorWarning)
slackmsg.Send("Damn, we are in serious trouble!", slackstatus.ColorDanger)
slackmsg.Send("Ok.", "#439FE0")
}