Skip to content

🎉 Simple CLI tool and Go library to post formatted status messages to a Slack channel / Go Slack Client

License

Notifications You must be signed in to change notification settings

pteich/slackstatus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slackstatus GoDoc

Simple CLI tool and Go library to post formatted status messages to a Slack channel 🎉

Slackstatus in Action

Usage as CLI tool

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

Usage as Go library

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")
  
}

About

🎉 Simple CLI tool and Go library to post formatted status messages to a Slack channel / Go Slack Client

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages